mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-11 12:17:45 +08:00
fix imageupload widget requiring a specific name
This commit is contained in:
parent
2e79919b5a
commit
31bc856aa3
@ -189,6 +189,9 @@ function buildNodeDef(config, nodeName, defs, source = "workflow") {
|
|||||||
if (inputName === "seed" || inputName === "noise_seed") {
|
if (inputName === "seed" || inputName === "noise_seed") {
|
||||||
inputDef = [...inputDef];
|
inputDef = [...inputDef];
|
||||||
inputDef[1] = { control_after_generate: `${prefix} control_after_generate`, ...inputDef[1] };
|
inputDef[1] = { control_after_generate: `${prefix} control_after_generate`, ...inputDef[1] };
|
||||||
|
} else if (inputDef[0] === "IMAGEUPLOAD") {
|
||||||
|
inputDef = [...inputDef];
|
||||||
|
inputDef[1] = { widget: `${prefix} ${inputDef[1]?.widget ?? "image"}`, ...inputDef[1] };
|
||||||
}
|
}
|
||||||
newDef.input.required[name] = inputDef;
|
newDef.input.required[name] = inputDef;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -376,7 +376,7 @@ export const ComfyWidgets = {
|
|||||||
return { widget: node.addWidget("combo", inputName, defaultValue, () => {}, { values: type }) };
|
return { widget: node.addWidget("combo", inputName, defaultValue, () => {}, { values: type }) };
|
||||||
},
|
},
|
||||||
IMAGEUPLOAD(node, inputName, inputData, app) {
|
IMAGEUPLOAD(node, inputName, inputData, app) {
|
||||||
const imageWidget = node.widgets.find((w) => w.name === "image");
|
const imageWidget = node.widgets.find((w) => w.name === (inputData[1]?.widget ?? "image"));
|
||||||
let uploadWidget;
|
let uploadWidget;
|
||||||
|
|
||||||
function showImage(name) {
|
function showImage(name) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user