mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 06:19:58 +00:00
Fix load workflow with converted widget (#1222)
f74973 introduced a regression where a node which has had an input added, will clobber a converted input of in a workflow created before the input was added. The prior behaviour was also incorrect (the new input would not exist on the node), but would often be runnable. Keeping the position of the converted widget and adding the new input to the end is an unfortunate compromise. Doing it the other way around breaks primitive nodes
This commit is contained in:
@@ -38,7 +38,7 @@ import {
|
||||
SYSTEM_NODE_DEFS,
|
||||
useNodeDefStore
|
||||
} from '@/stores/nodeDefStore'
|
||||
import { Vector2 } from '@comfyorg/litegraph'
|
||||
import { INodeInputSlot, Vector2 } from '@comfyorg/litegraph'
|
||||
import _ from 'lodash'
|
||||
import {
|
||||
showExecutionErrorDialog,
|
||||
@@ -2093,6 +2093,11 @@ export class ComfyApp {
|
||||
incoming: Record<string, any>
|
||||
) => {
|
||||
const result = { ...incoming }
|
||||
if (current.widget === undefined && incoming.widget !== undefined) {
|
||||
// Field must be input as only inputs can be converted
|
||||
this.inputs.push(current as INodeInputSlot)
|
||||
return incoming
|
||||
}
|
||||
for (const key of ['name', 'type', 'shape']) {
|
||||
if (current[key] !== undefined) {
|
||||
result[key] = current[key]
|
||||
|
||||
Reference in New Issue
Block a user