Start ComfyUI automatically before queueing MiniMax jobs.

Health-check /system_stats, wait if the desktop is booting or busy, and start the host instance when it is fully offline.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-25 19:39:28 -05:00
co-authored by Cursor
parent f8a3be0fe8
commit f5829995c8
11 changed files with 791 additions and 8 deletions
+10 -2
View File
@@ -1,10 +1,18 @@
function comfyBase() {
const config = useRuntimeConfig()
const host = (config.comfyHost || process.env.COMFY_HOST || '').replace(/\/$/, '')
let host = String(config.comfyHost || process.env.COMFY_HOST || '').trim().replace(/\/$/, '')
const port = String(config.comfyPort || process.env.COMFY_PORT || '').trim()
if (!host) {
throw createError({ statusCode: 500, statusMessage: 'COMFY_HOST is not configured' })
}
return host
if (!/^https?:\/\//i.test(host)) host = `http://${host}`
try {
const url = new URL(host)
if (port && !url.port) url.port = port
return url.origin
} catch {
return port ? `${host}:${port}` : host
}
}
export function getComfyHost() {