chrisgoringe / cg-image-picker

198 stars 13 forks source link

FEATURE REQUEST Persist Masks #86

Closed aegis72 closed 3 months ago

aegis72 commented 4 months ago

I love this node, but have one issue with it that would be great to fix. Some context:. I have a modular system that uses Image Picker in a 3-stage workflow. The idea is that the user can see the results at each stage and improve the prompt and settings before moving to the next stage: image

And it works splendidly for that. The issue comes when later, I want to send this final image to another node, f/e this preview bridge, for masking and then further refinement in another module. Because of the way the chooser seems to work, if I define a mask, then the next time I queue that mask gets destroyed by the incoming image from the chooser.

Before Progress Choice: image

After Progress Choice image

Is there a way that we could have a node for masking after a choice is made that: A) If no mask is present, allows us to make one and save back to the node to be carried along until the mask is replaced or the generated image changes. B) If the option is set to "repeat last selection", persists the mask so that it isn't destroyed (or some better method if you think of one)?

Something similar to the Preview Bridge, but with Image, Latent, Mask outputs and where an incoming image doesn't destroy the mask?

If you could think of other ways that this might be done in a single workflow, I'm all ears (eyes?)

za-wa-n-go commented 3 months ago

I want the input and output of the mask.

chrisgoringe commented 3 months ago

A simple option would be to have an optional mask input and output, like is currently done with latents - so you can feed a batch of masks in, and it will pass the one corresponding to your selections through.

Perhaps to enhance that; if you only pass a single mask in, it would simply pass the same mask out again.

I don't think that editing the image to create a mask is trivial (although it might be possible by reusing the existing code)

chrisgoringe commented 3 months ago

masks are now supported (passed through) - you can pass a batch of masks, or a single mask which will then be repeated to form a batch at the output.