chrisgoringe / cg-image-picker

198 stars 13 forks source link

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

Closed QuackAstra closed 3 months ago

QuackAstra commented 4 months ago

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

chrisgoringe commented 4 months ago

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?

QuackAstra commented 4 months ago

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.

chrisgoringe commented 4 months ago

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?

QuackAstra commented 4 months ago

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.

chrisgoringe commented 3 months ago

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