Files
aigen/server/api/comfy/force-reset.post.ts
T
TowstyandCursor 5df9e2d8ac Add Force reset to clear stuck jobs and kill a wedged Comfy.
Settings and the header menu can cancel invisible queue/pending work and force-stop Beast when Sleep is blocked.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-03 21:24:10 -05:00

16 lines
546 B
TypeScript

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 stuck jobs and force-stopped Comfy. Use Wake / Poke when you want the GPU again.',
cleared,
comfy
}
})