Ship MiniMax v2 identity refs and Qwen sidecar edits.
Keep v1 as the default video graph, relay image edits to the Qwen Lightning box, and keep /api/health up if one Comfy host is unset. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { execFile, spawn } from 'node:child_process'
|
||||
import { promisify } from 'node:util'
|
||||
import { getComfyHost, setComfyHostOverride } from '~/server/utils/comfy'
|
||||
import { getComfyHost, setComfyHostOverride, comfyConfigured } from '~/server/utils/comfy'
|
||||
|
||||
const execFileAsync = promisify(execFile)
|
||||
|
||||
@@ -48,20 +48,26 @@ function settings() {
|
||||
}
|
||||
}
|
||||
|
||||
export async function checkComfyHttp(timeoutMs = 2500, host = getComfyHost()) {
|
||||
export async function checkComfyHttp(timeoutMs = 2500, host?: string) {
|
||||
let resolved = host || ''
|
||||
try {
|
||||
const res = await fetch(`${host}/system_stats`, { signal: AbortSignal.timeout(timeoutMs) })
|
||||
if (!res.ok) return { ok: false as const, host, status: res.status, stats: null }
|
||||
if (!resolved) {
|
||||
if (!comfyConfigured()) return { ok: false as const, host: '', status: 0, stats: null }
|
||||
resolved = getComfyHost()
|
||||
}
|
||||
const res = await fetch(`${resolved}/system_stats`, { signal: AbortSignal.timeout(timeoutMs) })
|
||||
if (!res.ok) return { ok: false as const, host: resolved, status: res.status, stats: null }
|
||||
const stats = await res.json().catch(() => null)
|
||||
return { ok: true as const, host, status: res.status, stats }
|
||||
return { ok: true as const, host: resolved, status: res.status, stats }
|
||||
} catch {
|
||||
return { ok: false as const, host, status: 0, stats: null }
|
||||
return { ok: false as const, host: resolved, status: 0, stats: null }
|
||||
}
|
||||
}
|
||||
|
||||
export async function fetchQueue() {
|
||||
const host = getComfyHost()
|
||||
if (!comfyConfigured()) return { running: 0, pending: 0 }
|
||||
try {
|
||||
const host = getComfyHost()
|
||||
const res = await fetch(`${host}/queue`, { signal: AbortSignal.timeout(2500) })
|
||||
if (!res.ok) return { running: 0, pending: 0 }
|
||||
const payload = await res.json() as { queue_running?: unknown[]; queue_pending?: unknown[] }
|
||||
|
||||
Reference in New Issue
Block a user