Minor CSS/JS Syntax Preventing Image Stacker Nodes
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 155
Description
This is a partly a discussion on design and a bit of a feature request, but I was digging around when I tried to make a custom node and which involved stacking uploaded images. I believe it was almost working however you could not easily actually upload image via a button because the CSS uses a reserved word "image" to indicate that an image can be uploaded. If however you added a wildcard syntax like if a node is name _image*** then it can also have the upload button this might allow for a large array of interesting stackers to be created. There are other problems such as making the viewer for load images support multiple images, but I think a lot of that can probably be re-used (or perhaps is already solved) from the PreviewImage nodes which seem to handle that gracefully.
This seems to be the part of `widgets.js` `IMAGEUPLOAD` method that handles creating the upload button.
```
// Create the button widget for selecting the files
uploadWidget = node.addWidget("button", inputName, "image", () => {
fileInput.click();
});
uploadWidget.label = "choose file to upload";
uploadWidget.serialize = false;
```
I was wondering if other changes would need to be made outside this, or perhaps a multi-image upload IMAGEUPLOADS section can be made in the widgets to ensure 100% backwards compatibility. There are many types of nodes and use cases for uploading batched pictures and as people start to deploy headless workflows based on prototyped ComfyUI configurations it would really expand on the versatility of models.
There are a large number of nodes which already start to accept or convert images into batches, and even Preview Image in large parts has batch accepting capabilities. I think this could be a quite minor adjustment, and you can leave implementation details to custom node makers until a dominant design pattern emerges.
Contributor guide
Assessment
This issue has not been assessed yet.