ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Load image batches

Open space-nuko opened this issue 2 years ago • 9 comments

2023-05-29 17_11_37-ComfyUI - Chromium 2023-05-29 16_40_37-ComfyUI - Chromium

Closes #628, closes #23

space-nuko avatar May 29 '23 22:05 space-nuko

I think there should be an OK button beside the clear button in the "Pick Images" UI.

With this I can no longer queue prompts if there is an extra SaveImage in the workflow not connected to anything for example.

comfyanonymous avatar Jun 01 '23 04:06 comfyanonymous

I think there should be an OK button beside the clear button in the "Pick Images" UI.

Added

With this I can no longer queue prompts if there is an extra SaveImage in the workflow not connected to anything for example.

Isn't that how it's always been? The executor always tries to verify starting from output nodes even if they're not attached to the "main" graph right? (It still works if the detached node isn't an output node)

space-nuko avatar Jun 01 '23 17:06 space-nuko

I have 30000 images in my output folder so this is a bit slow, it also doesn't allow you to filter the list like the current LoadImage node

The pick images should default to the Input folder and there should be a "Replace" and an "Add" instead of just an "Add" because I assume most people just want to pick a single image.

comfyanonymous avatar Jun 05 '23 05:06 comfyanonymous

Okay I made it use the list filtering behavior for normal combo boxes like with current LoadImage, so it shouldn't be any slower than that.

I also made the widget display on the node back into an interactable combo box like current LoadImage does. The only thing I couldn't preserve was the behavior when clicking the arrow buttons on the combo box which unfortunately needs litegraph changes to work

Also added the Replace button and it defaults to the input folder

space-nuko avatar Jun 09 '23 01:06 space-nuko

Looks clunky and unrefined, but functionality is great.

WASasquatch avatar Jun 09 '23 02:06 WASasquatch

Is it normal that the arrow buttons for the file combo are broken?

comfyanonymous avatar Jun 11 '23 06:06 comfyanonymous

How is this working? I see no mode? This should output

  1. A image tensor batch
  2. A tensor image list
  3. A single tensor per prompt run

That way it can be used with all methods of image handling and diffusion.

WASasquatch avatar Jun 11 '23 16:06 WASasquatch

Is it normal that the arrow buttons for the file combo are broken?

With this implementation yes. The list of paths is sent back as an array (which other widgets/types haven't done before) but litegraph assumes that when picking an item with the left/right combo buttons the index of the selected value can be found in the choices array. Since the value is an array instead of a string, and list of choices are strings, it won't report the correct value

It needs a way to ignore the index if it isn't found, or better yet a way for widgets to override their behavior if a button is pressed, but both of those are litegraph patches

I see no mode?

I could add this but I can foresee it needing changes to the executor, currently I don't think you can configure a node to be different modes of OUTPUT_IS_LIST based on settings, instead you'd have to create a new node with it set to true or false

space-nuko avatar Jun 12 '23 14:06 space-nuko

This is why, like I have mentioned a few times, all execution should double check the class.

1 get defaults 2 class function ran 3 double check class var settings and handle accordingly 4 return result from class function

We're using classes and can use them much more powerfully. When we envoke the class to run the function we have an opportunity to check the class attributes again for dynamic changes.

WASasquatch avatar Jun 12 '23 15:06 WASasquatch

I think OUTPUT_IS_LIST supports values per output: https://github.com/comfyanonymous/ComfyUI/blob/7ddfed001e8439dfddbdcb523edd3e355b3fb1e4/execution.py#L87-L98

Whereas the INPUT_IS_LIST applies to all inputs.

While less dynamic, it should be doable with an output for each "mode"

M1kep avatar Jul 20 '23 05:07 M1kep

Can it be dynamically set or is it static? I've tried changing like return types and stuff and didn't take.

WASasquatch avatar Jul 20 '23 21:07 WASasquatch

where can i find this node?

joaodafonseca avatar Sep 27 '23 15:09 joaodafonseca

where can i find this node?

This is pretty old code and not sure it's compatible anymore. The fork its in is pretty ancient

WASasquatch avatar Sep 27 '23 16:09 WASasquatch