WASasquatch / was-node-suite-comfyui

An extensive node suite for ComfyUI with over 210 new nodes
MIT License
1.15k stars 170 forks source link

[Question] Load image batch sorting dont work #376

Open Milor123 opened 5 months ago

Milor123 commented 5 months ago

How can I load a folder of images, and that it keep the order?

image

I have this config

image

but the problems is that the image generator dont have sense, it looks like Random generator, i have it in incremental

how can i do send me the imagenes by name order? Please help! Thank u very much

WAS-PlaiLabs commented 5 months ago

Not sure. I didn't have issues with incremented file, and that's exactly what the code does in general with the list:

            self.load_images(directory_path, pattern)
            self.image_paths.sort()

Which sorts the list lexicographic, regardless of the mode it's on.

Zeelyne commented 4 months ago

Same problem, it doesnt seem to sorts. In my folder it is : image But when i use Load Image Batch with the follwoing workflow: image

I could see from the Show Text node that it wasnt in the order. It is strange.

BTW, what does "label" mean and how does it influence the output? I did modify it but nothing happened.

WAS-PlaiLabs commented 4 months ago

I can't reproduce the issue. The class sorts the list explicitly, and that sorting is lexicographic, the same as say Windows File Explorer you take pictures of.

Here's an example of incrementing, and single index:

https://github.com/WASasquatch/was-node-suite-comfyui/assets/160535949/f626c3d8-45dc-45e0-b33e-3aaee5cbccac

D4KU commented 2 months ago

@Zeelyne By any chance, could it be that your output order is 10uComfyUI.png, 11uComfyUI.png, ... 1uComfyUI.png, 20uComfyUI.png, ...? Because that's what happens when you sort these file names alphabetically. You should try to zero-pad them.