"git@developer.sourcefind.cn:chenpangpang/ComfyUI.git" did not exist on "4650e7d6e9e846160906b94d575705151d59fdd1"
Commit d7b3b0f8 authored by comfyanonymous's avatar comfyanonymous
Browse files

Don't hardcode node names for image upload widget.

parent afcb9cb1
......@@ -1306,7 +1306,7 @@ class LoadImage:
input_dir = folder_paths.get_input_directory()
files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f))]
return {"required":
{"image": (sorted(files), )},
{"image": (sorted(files), {"image_upload": True})},
}
CATEGORY = "image"
......@@ -1349,7 +1349,7 @@ class LoadImageMask:
input_dir = folder_paths.get_input_directory()
files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f))]
return {"required":
{"image": (sorted(files), ),
{"image": (sorted(files), {"image_upload": True}),
"channel": (s._color_channels, ), }
}
......
......@@ -5,7 +5,8 @@ import { app } from "../../scripts/app.js";
app.registerExtension({
name: "Comfy.UploadImage",
async beforeRegisterNodeDef(nodeType, nodeData, app) {
if (nodeData.name === "LoadImage" || nodeData.name === "LoadImageMask") {
console.log(nodeData);
if (nodeData?.input?.required?.image?.[1]?.image_upload === true) {
nodeData.input.required.upload = ["IMAGEUPLOAD"];
}
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment