From e89bb23fa6eff469432d5caa05b09de5fc21438a Mon Sep 17 00:00:00 2001 From: iammojogo-sudo Date: Wed, 24 Jun 2026 14:39:47 -0400 Subject: [PATCH 1/2] fix: handle text-input model nodes (dit1.2 t2i) --- src/areas/workflows/workflowRunStore.ts | 30 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/areas/workflows/workflowRunStore.ts b/src/areas/workflows/workflowRunStore.ts index 0f0341d..a3f9a93 100644 --- a/src/areas/workflows/workflowRunStore.ts +++ b/src/areas/workflows/workflowRunStore.ts @@ -176,16 +176,26 @@ async function executeExtensionNode( const isModelNode = ext?.type === 'model' if (isModelNode) { - const activeImagePath = nodeInputPath ?? selectedImagePath - if (!selectedImageData && (!activeImagePath || activeImagePath.trim().length === 0)) { + const isTextInput = ext?.input === 'text' || (ext?.inputs && ext.inputs.every((i) => i === 'text')) + const activeImagePath = isTextInput ? undefined : (nodeInputPath ?? selectedImagePath) + if (!isTextInput && !selectedImageData && (!activeImagePath || activeImagePath.trim().length === 0)) { throw new Error('No input image selected for model node') } - const base64 = selectedImageData && nodeInputPath === undefined - ? selectedImageData - : await window.electron.fs.readFileBase64(activeImagePath as string) - const bytes = Uint8Array.from(atob(base64), (c) => c.charCodeAt(0)) - const blob = new Blob([bytes], { type: 'image/png' }) - const fname = activeImagePath?.split(/[\\/]/).pop() ?? 'image.png' + + let blob: Blob + let fname: string + if (isTextInput || (!activeImagePath && selectedImageData)) { + const base64 = selectedImageData && nodeInputPath === undefined + ? selectedImageData + : 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==' // 1x1 transparent PNG + fname = 'placeholder.png' + blob = new Blob([Uint8Array.from(atob(base64), (c) => c.charCodeAt(0))], { type: 'image/png' }) + } else { + const base64 = await window.electron.fs.readFileBase64(activeImagePath as string) + const bytes = Uint8Array.from(atob(base64), (c) => c.charCodeAt(0)) + blob = new Blob([bytes], { type: 'image/png' }) + fname = activeImagePath?.split(/[\\/]/).pop() ?? 'image.png' + } const extraParams: Record = {} if (nodeInputMeshPath) { @@ -194,6 +204,10 @@ async function executeExtensionNode( ? norm.slice(workspaceDir.length).replace(/^\//, '') : norm } + if (nodeInputText !== undefined && nodeInputText.trim().length > 0) { + extraParams.prompt = nodeInputText + extraParams.text = nodeInputText + } const schemaDefaults = Object.fromEntries( (ext.params ?? []).map((p) => [p.id, p.default]), From 4caebf9d69e9b744939570744d45ce3145cc75d6 Mon Sep 17 00:00:00 2001 From: iammojogo-sudo Date: Wed, 24 Jun 2026 16:06:48 -0400 Subject: [PATCH 2/2] fix: skip empty text values and correctly detect text-only models --- src/areas/workflows/workflowRunStore.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/areas/workflows/workflowRunStore.ts b/src/areas/workflows/workflowRunStore.ts index a3f9a93..5ea6acd 100644 --- a/src/areas/workflows/workflowRunStore.ts +++ b/src/areas/workflows/workflowRunStore.ts @@ -163,20 +163,20 @@ async function executeExtensionNode( if (src.outputType === 'mesh') nodeInputMeshPath = src.filePath else if (src.outputType === 'image') nodeInputPath = src.filePath else if (src.filePath !== undefined) nodeInputPath = src.filePath - if (src.text !== undefined) nodeInputText = src.text + if (src.text !== undefined && src.text.trim().length > 0) nodeInputText = src.text } } else { for (const edge of incomingEdges) { const src = resolveSource(edge.source) if (src?.filePath !== undefined) nodeInputPath = src.filePath - if (src?.text !== undefined) nodeInputText = src.text + if (src?.text !== undefined && src.text.trim().length > 0) nodeInputText = src.text } } const isModelNode = ext?.type === 'model' if (isModelNode) { - const isTextInput = ext?.input === 'text' || (ext?.inputs && ext.inputs.every((i) => i === 'text')) + const isTextInput = ext?.inputs ? ext.inputs.every((i) => i === 'text') : ext?.input === 'text' const activeImagePath = isTextInput ? undefined : (nodeInputPath ?? selectedImagePath) if (!isTextInput && !selectedImageData && (!activeImagePath || activeImagePath.trim().length === 0)) { throw new Error('No input image selected for model node')