Coordinate shared GPU access across studio instances

This commit is contained in:
Towsty
2026-09-06 16:32:18 -05:00
parent 911ddeab55
commit 0c6a035d04
17 changed files with 582 additions and 64 deletions
+11 -8
View File
@@ -1,15 +1,18 @@
import { withSharedGpuReset } from '~/server/utils/sharedGpu'
import { libraryOwnerKey } from '~/server/utils/library'
import { requestComfyForceReset } from '~/server/utils/comfyLifecycle'
import { clearStuckStudioWork } from '~/server/utils/studioQueue'
export default defineEventHandler(async (event) => {
const owner = libraryOwnerKey(event)
const cleared = await clearStuckStudioWork(owner)
const comfy = await requestComfyForceReset()
return {
ok: true,
message: 'Cleared every stuck Studio/music/shot job and force-stopped Comfy. Use Wake / Poke when you want the GPU again.',
cleared,
comfy
}
return withSharedGpuReset(async () => {
const cleared = await clearStuckStudioWork(owner)
const comfy = await requestComfyForceReset()
return {
ok: true,
message: 'Cleared every stuck Studio/music/shot job and force-stopped Comfy. Use Wake / Poke when you want the GPU again.',
cleared,
comfy
}
})
})