From 054c07ae03dbda52851c3d54e19c319be8ca5a0f Mon Sep 17 00:00:00 2001 From: Towsty Date: Wed, 26 Aug 2026 23:18:45 -0500 Subject: [PATCH] Fix V2 identity queue validation by filling unused ref slots. Co-authored-by: Cursor --- pages/index.vue | 2 +- server/assets/workflow_minimax_video_v2.json | 1 - server/utils/comfy.ts | 28 +++++++++++++++++--- server/utils/workflow.ts | 9 ++----- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index 1747b58..16725c5 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -321,7 +321,7 @@ -

Picture 1 is the start still. Extra stills map to Picture 2–5 in MiniMax. Empty slots are omitted. Identity refs are not reused on queued extensions.

+

Picture 1 is the start still. Extra stills map to Picture 2–5. Empty extra slots reuse the start still so Comfy does not error. Identity refs are not reused on queued extensions.

diff --git a/server/assets/workflow_minimax_video_v2.json b/server/assets/workflow_minimax_video_v2.json index d8a386f..4b87b34 100644 --- a/server/assets/workflow_minimax_video_v2.json +++ b/server/assets/workflow_minimax_video_v2.json @@ -3,7 +3,6 @@ "inputs": { "filename_prefix": "video/MiniMax_H3", "format": "auto", - "format.codec": "auto", "codec": "auto", "video": [ "172", diff --git a/server/utils/comfy.ts b/server/utils/comfy.ts index 2c3c1cf..82922af 100644 --- a/server/utils/comfy.ts +++ b/server/utils/comfy.ts @@ -77,6 +77,29 @@ export function comfyInputFilename(original: string, jobId?: string) { return `aigen_${id}_${base}${ext}` } +function comfyQueueMessage(payload: unknown, status: number) { + const body = payload as { + error?: { message?: string; details?: string } + node_errors?: Record + }> + } + const parts: string[] = [] + const headline = String(body.error?.message || '').trim() + const extra = String(body.error?.details || '').trim() + if (headline) parts.push(headline) + if (extra) parts.push(extra) + for (const [id, node] of Object.entries(body.node_errors || {})) { + for (const item of node.errors || []) { + const bit = [item.message, item.details, item.extra_info?.input_name].filter(Boolean).join(' — ') + if (bit) parts.push(`${node.class_type || `Node ${id}`}: ${bit}`) + } + } + const message = [...new Set(parts.filter(Boolean))].join('. ') + return message || `Queue failed (${status})` +} + export async function queuePrompt(graph: unknown, clientId: string) { const res = await comfyFetch('/prompt', { method: 'POST', @@ -85,10 +108,7 @@ export async function queuePrompt(graph: unknown, clientId: string) { }) const payload = await res.json().catch(() => ({})) if (!res.ok) { - const message = (payload as { error?: { message?: string } }).error?.message - || (payload as { node_errors?: unknown }).node_errors - || `Queue failed (${res.status})` - throw createError({ statusCode: 502, statusMessage: String(message), data: payload }) + throw createError({ statusCode: 502, statusMessage: comfyQueueMessage(payload, res.status), data: payload }) } return payload as { prompt_id: string; number?: number } } diff --git a/server/utils/workflow.ts b/server/utils/workflow.ts index 37e0d87..e005a31 100644 --- a/server/utils/workflow.ts +++ b/server/utils/workflow.ts @@ -234,13 +234,8 @@ function applyV2IdentityPath( graph['176'].inputs.lora_name = 'minimax_h3_ref2v_turbo_4step_v0.1_comfyui_bf16.safetensors' } V2_REF_LOADERS.forEach((id, index) => { - const name = refs[index] - if (name && graph[id]) { - graph[id].inputs.image = name - return - } - delete graph[id] - if (graph['155']?.inputs) delete graph['155'].inputs[`ref_images.ref_image_${index + 1}`] + if (!graph[id]) return + graph[id].inputs.image = refs[index] || params.imageName }) if (graph['150']?.inputs) graph['150'].inputs.value = true return