Drop the unused Klein branch from image-edit prompts and show the real Comfy error.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-27 09:20:34 -05:00
co-authored by Cursor
parent 13ecec949c
commit f88dfa1146
2 changed files with 37 additions and 15 deletions
+8 -11
View File
@@ -1,6 +1,5 @@
import template from '../assets/workflow_flux2_klein_edit.json'
const BYPASS = 4
const IMAGE1 = '76'
const IMAGE2 = '81'
const SINGLE_SAVE = '9'
@@ -16,7 +15,7 @@ const DUAL_NOISE = '92:105'
const DUAL_SCHEDULER = '92:115'
const DUAL_CFG = '92:114'
type WorkflowNode = { class_type: string; inputs: Record<string, unknown>; mode?: number; _meta?: { title?: string } }
type WorkflowNode = { class_type: string; inputs: Record<string, unknown>; _meta?: { title?: string } }
type WorkflowGraph = Record<string, WorkflowNode>
export interface EditParams {
@@ -38,7 +37,6 @@ export function buildEditWorkflow(params: EditParams) {
const prefix = params.filenamePrefix || 'aigen-edit'
setImage(graph, IMAGE1, params.imageName)
setImage(graph, IMAGE2, params.referenceImageName || '')
setText(graph, SINGLE_PROMPT, prompt)
setText(graph, DUAL_PROMPT, prompt)
setText(graph, SINGLE_NEGATIVE, negative)
@@ -52,16 +50,15 @@ export function buildEditWorkflow(params: EditParams) {
setInput(graph, SINGLE_SAVE, 'filename_prefix', prefix)
setInput(graph, DUAL_SAVE, 'filename_prefix', prefix)
for (const [id, node] of Object.entries(graph)) {
if (!node) continue
if (id === IMAGE1) {
delete node.mode
continue
}
if (dual) {
setImage(graph, IMAGE2, params.referenceImageName || '')
}
for (const id of Object.keys(graph)) {
if (id === IMAGE1) continue
const dualNode = id === IMAGE2 || id === DUAL_SAVE || id.startsWith('92:')
const singleNode = id === SINGLE_SAVE || id.startsWith('75:')
if (dual ? singleNode : dualNode) node.mode = BYPASS
else delete node.mode
if (dual ? singleNode : dualNode) delete graph[id]
}
return graph