chrisgoringe/cg-image-picker

[Feature Request] Output the selected images as a list of integers

QuackAstra opened this issue · 5 comments

Use case: Image generation with 4 different prompts, Images 1 and 4 get chosen and processed, further refinement follows with prompts 1 and 4

Output example: 1, 4

So this is an additional output - to be consumed by another custom node, I assume?

I would need to be sure of the format the output needs to be in - when you say "list of integers" I'm not sure if you are referring to a 'list' in the Python sense (a variable of type list[int]), or a string with the number comma-separated as you showed it.

What does the downstream node need?

I think a string separated by commas would suffice, this could be split with a "," separator and the string type converted to integers.

A single integer for the 'Progress first node' mode would also work for all my use cases.

A single integer for the 'Progress first node' mode would also work for all my use cases.

The output needs to be a well defined type, so if it's to be a comma separated list of integers (as a string) that it'll need to be a string always. Will that work?

Yes, absolutely! Thank you, that would be a great solution.

While I got your attention: It might be an interesting idea to just split or duplicate the 'Progress first' mode into a separate node and then output the integer for the selected single image.

OK - this is added. Note that we use zero indexing (so the first image is '0', the second is '1' etc)