Fix V2 identity queue validation by filling unused ref slots.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+1
-1
@@ -321,7 +321,7 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="useIdentityRefs" class="text-xs text-zinc-500">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.</p>
|
||||
<p v-if="useIdentityRefs" class="text-xs text-zinc-500">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.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"inputs": {
|
||||
"filename_prefix": "video/MiniMax_H3",
|
||||
"format": "auto",
|
||||
"format.codec": "auto",
|
||||
"codec": "auto",
|
||||
"video": [
|
||||
"172",
|
||||
|
||||
+24
-4
@@ -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<string, {
|
||||
class_type?: string
|
||||
errors?: Array<{ message?: string; details?: string; extra_info?: { input_name?: string } }>
|
||||
}>
|
||||
}
|
||||
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 }
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user