mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-16 16:32:34 +08:00
groupnode imageupload test
give widget unique name
This commit is contained in:
parent
31bc856aa3
commit
3ef9395a96
@ -627,4 +627,14 @@ describe("group node", () => {
|
|||||||
expect(decode.outputs[0].connections[0].targetNode.id).toBe(preview1.id);
|
expect(decode.outputs[0].connections[0].targetNode.id).toBe(preview1.id);
|
||||||
expect(decode.outputs[0].connections[1].targetNode.id).toBe(preview2.id);
|
expect(decode.outputs[0].connections[1].targetNode.id).toBe(preview2.id);
|
||||||
});
|
});
|
||||||
|
test("works with IMAGEUPLOAD widget", async () => {
|
||||||
|
const { ez, graph, app } = await start();
|
||||||
|
const img = ez.LoadImage();
|
||||||
|
const preview1 = ez.PreviewImage(img.outputs[0]);
|
||||||
|
|
||||||
|
const group = await convertToGroup(app, graph, "test", [img, preview1]);
|
||||||
|
const widget = group.widgets["LoadImage upload"];
|
||||||
|
expect(widget).toBeTruthy();
|
||||||
|
expect(widget.widget.type).toBe("button");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -490,9 +490,10 @@ export const ComfyWidgets = {
|
|||||||
document.body.append(fileInput);
|
document.body.append(fileInput);
|
||||||
|
|
||||||
// Create the button widget for selecting the files
|
// Create the button widget for selecting the files
|
||||||
uploadWidget = node.addWidget("button", "choose file to upload", "image", () => {
|
uploadWidget = node.addWidget("button", inputName, "image", () => {
|
||||||
fileInput.click();
|
fileInput.click();
|
||||||
});
|
});
|
||||||
|
uploadWidget.label = "choose file to upload";
|
||||||
uploadWidget.serialize = false;
|
uploadWidget.serialize = false;
|
||||||
|
|
||||||
// Add handler to check if an image is being dragged over our node
|
// Add handler to check if an image is being dragged over our node
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user