djbielejeski / a-person-mask-generator

Extension for Automatic1111 and ComfyUI to automatically create masks for Background/Hair/Body/Face/Clothes in Img2Img
MIT License
247 stars 30 forks source link

Request for Background Color Customization Option #10

Closed Vitali774 closed 8 months ago

Vitali774 commented 8 months ago

This is not an issue but more like a request. Can we have options to set (assuming the background-only option is chosen) the background color to be solid white, black, chroma green (#00b140), or chroma blue (#0047BB) instead of a randomly generated background from prompts?

djbielejeski commented 8 months ago

Can you describe your use case and how this would add value?

All this extension does is create a Black and White mask

Vitali774 commented 8 months ago

Hello David, thank you for your quick reply. The primary use will be for post-processing in other applications like Photoshop and Illustrator. Since your "masterpiece" produces very high-quality results by regenerating the entire image, this level of quality cannot be achieved using Photoshop's masking feature alone (it's very time-consuming). Having the ability to easily select the subject in an external application will greatly improve the workflow after using SD. I tried to achieve it using the prompt, but even with prompt weighting and the use of the in-paint model, the results are less than ideal, to say the least. It often attempts to fill the space with random content from the source generation.

All this extension does is create a Black and White mask<<<

Not really. Your extension has the ability to regenerate the entire image, which is much more powerful than using a black-and-white mask alone. Your extension can be used by simply enabling ControlNet, selecting Inpaint, and setting the noise to a value of 1. In that case, we don't even need to use an additional inpaint model at all.

djbielejeski commented 8 months ago

@Vitali774 Would you use a tool for generating these masks for post processing outside of Automatic1111? Aka a standalone python script could be made relatively quickly for this that could allow different colors for each selected mask.

Vitali774 commented 8 months ago

I will try to explain with pictures. Images from left to right:

1.Generated image. 2.Generated image with your mask applied and the prompt set to "white wall." 3.Photoshop image with your generated mask applied separately.

Please notice the quality of the edges. When I generate an image inside img2img with your mask applied, the result is completely different because SD tries to regenerate a significant part of the image in order too match new background. As of now, PNG mask files have very rough edges, so they are not really useful outside of automatic1111.

758

Vitali774 commented 8 months ago

This is essentially how I envision it, with the options being "none (default)," white, black, green, and blue for background customization. Untitled-2

djbielejeski commented 8 months ago

I don't think building this into the tool would be helpful for general use. You can download the preview and perform those edits and upload the mask into SD manually using the "Inpaint upload" feature.

djbielejeski commented 8 months ago

@Vitali774 I made you something

https://davidbielejeski.com/segment-image

image

Vitali774 commented 8 months ago

That's perfect! Thank you a lot, David. I appreciate your help. I suggest you try Compy UI (if you haven't already). They offer numerous possibilities with custom nodes.


From: David B. @.> Sent: Tuesday, November 21, 2023 3:07 PM To: djbielejeski/a-person-mask-generator @.> Cc: Vitali774 @.>; Mention @.> Subject: Re: [djbielejeski/a-person-mask-generator] Request for Background Color Customization Option (Issue #10)

@Vitali774https://github.com/Vitali774 I made you something

https://davidbielejeski.com/segment-image

[image]https://user-images.githubusercontent.com/2463282/284703491-20f12bc8-a0c0-4727-9b1a-ac09e873292e.png

— Reply to this email directly, view it on GitHubhttps://github.com/djbielejeski/a-person-mask-generator/issues/10#issuecomment-1821604686, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A56FPQW7JJGG4FZAYRQ444LYFUCXNAVCNFSM6AAAAAA7TFNADSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRRGYYDINRYGY. You are receiving this because you were mentioned.