Skip to content

Commit

Permalink
fix imageupload widget requiring a specific name
Browse files Browse the repository at this point in the history
  • Loading branch information
pythongosssss committed Nov 15, 2023
1 parent 2e79919 commit 31bc856
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions web/extensions/core/groupNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ function buildNodeDef(config, nodeName, defs, source = "workflow") {
if (inputName === "seed" || inputName === "noise_seed") {
inputDef = [...inputDef];
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;
}
Expand Down
2 changes: 1 addition & 1 deletion web/scripts/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ export const ComfyWidgets = {
return { widget: node.addWidget("combo", inputName, defaultValue, () => {}, { values: type }) };
},
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;

function showImage(name) {
Expand Down

0 comments on commit 31bc856

Please sign in to comment.