Add Nuxt MiniMax H3 relay studio for local ComfyUI.
Headless image-to-video UI queues jobs on the desktop ComfyUI instance with live SSE progress and Authentik SSO.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
export default defineEventHandler(async (event) => {
|
||||
const query = getQuery(event)
|
||||
const filename = String(query.filename || '')
|
||||
if (!filename) {
|
||||
throw createError({ statusCode: 400, statusMessage: 'filename is required' })
|
||||
}
|
||||
const subfolder = String(query.subfolder || 'video')
|
||||
const type = String(query.type || 'output')
|
||||
const params = new URLSearchParams({ filename, subfolder, type })
|
||||
const res = await comfyFetch(`/view?${params.toString()}`)
|
||||
if (!res.ok) {
|
||||
throw createError({ statusCode: res.status, statusMessage: 'Failed to fetch video from ComfyUI' })
|
||||
}
|
||||
const buf = Buffer.from(await res.arrayBuffer())
|
||||
setHeader(event, 'Content-Type', res.headers.get('content-type') || 'video/mp4')
|
||||
setHeader(event, 'Content-Disposition', `inline; filename="${filename}"`)
|
||||
setHeader(event, 'Cache-Control', 'private, max-age=3600')
|
||||
return buf
|
||||
})
|
||||
Reference in New Issue
Block a user