Fix ('STRING',) input node (#1457)

* Fix ('STRING',) input node

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-11-07 13:03:54 -05:00
committed by GitHub
parent 8ae9210298
commit 073638672d
5 changed files with 55 additions and 3 deletions

View File

@@ -0,0 +1,42 @@
{
"last_node_id": 1,
"last_link_id": 0,
"nodes": [
{
"id": 1,
"type": "DevToolsNodeWithStringInput",
"pos": [
15,
48
],
"size": [
315,
58
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [],
"properties": {
"Node name for S&R": "DevToolsNodeWithStringInput"
},
"widgets_values": [
""
]
}
],
"links": [],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 1,
"offset": [
0,
0
]
}
},
"version": 0.4
}

View File

@@ -527,6 +527,13 @@ test.describe('Load workflow', () => {
await comfyPage.loadWorkflow('string_node_id')
await expect(comfyPage.canvas).toHaveScreenshot('string_node_id.png')
})
test('Can load workflow with ("STRING",) input node', async ({
comfyPage
}) => {
await comfyPage.loadWorkflow('string_input')
await expect(comfyPage.canvas).toHaveScreenshot('string_input.png')
})
})
test.describe('Load duplicate workflow', () => {

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -25,7 +25,7 @@ import { ComfyNodeDef, StatusWsMessageStatus } from '@/types/apiTypes'
import { adjustColor, ColorAdjustOptions } from '@/utils/colorUtil'
import { ComfyAppMenu } from './ui/menu/index'
import { getStorageValue } from './utils'
import { ComfyWorkflow, useWorkflowStore } from '@/stores/workflowStore'
import { ComfyWorkflow } from '@/stores/workflowStore'
import {
LGraphCanvas,
LGraph,
@@ -1976,8 +1976,11 @@ export class ComfyApp {
widget?: IBaseWidget
} = { minWidth: 1, minHeight: 1 }
for (const inputName in inputs) {
const inputData = inputs[inputName]
const type = inputData[0]
const _inputData = inputs[inputName]
const type = _inputData[0]
const options = _inputData[1] ?? {}
const inputData = [type, options]
const inputIsRequired = requiredInputs && inputName in requiredInputs
let widgetCreated = true