invoke-ai / InvokeAI

InvokeAI is a leading creative engine for Stable Diffusion models, empowering professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry leading WebUI, supports terminal use through a CLI, and serves as the foundation for multiple commercial products.
https://invoke-ai.github.io/InvokeAI/
Apache License 2.0
22.27k stars 2.32k forks source link

[enhancement]: Duplicate and Complement regions #6438

Open clsn opened 1 month ago

clsn commented 1 month ago

Is there an existing issue for this?

Contact Details

clsn on discord

What should this feature add?

Regarding regional prompting and auto-negative. Sometimes, auto-negative isn't what you really want. You'd like to be able to say "I want this negative prompt in the complement of that region." If I have a region that contains "an adorable long-haired cat," I'd like the complement of that region to have "cat" as its negative prompt, but not necessarily the qualifiers. Also, at least in a video presentation someone wound up drawing two regions that were more or less the same. So probably the simplest and most flexible way to do this is to have a "duplicate this region/layer" action, and a "take the complement of this region" switch or button, so the user can compose these things as needed. That seems like the most intuitive and flexible way to provide this.

Alternatives

Other possibilities are more complicated, "linking" a layer to its complement (which has the advantage that editing the region automatically updates the complement, but I don't think that's really an important advantage). The "take the complement of this layer" could be a switch (setting a flag or something) or it could be an operation (actually converting the region); either way would be okay and would probably be about the same for the user.

Additional Content

No response

psychedelicious commented 1 month ago

My during initial testing I had auto negative as an option along with invert mask. You could choose either or - it doesn't make sense to enable both at once.

The problem is visualizing the inverted mask, I'll need to think about how to handle that. Or maybe it's not something that is visualized.

clsn commented 1 month ago

You might (or might not) want to keep the "auto-negative" feature as it is even if you implement these things, as a shorthand convenience form. I don't really see anything wrong with "Invert region" literally recalculating the region as its inverse and thereby making potentially a huge big color rectangle over most of the image. That's the image you're talking about after all, you might as well see it. I also don't see anything wrong with not doing that and having that region tagged as an "inverse region" and you just have to remember what that means, like with the current auto-negative, though that is potentially more confusing. Other options involve things like filling it with a special pattern or outline (cross-hatching, concentric circles or outlines, drawing only the outline and hoping people don't confuse it for a skinny region, a check-pattern, halftone), or reserving some section of the color-space for negatives and some for positives (that last sounds like more trouble than it's worth.)