dustysys / ddetailer

339 stars 73 forks source link

Not an issue but a feature request. #2

Closed scrambled2 closed 2 years ago

scrambled2 commented 2 years ago

It would be fantastic to be able to embed the mattes into the final image or to write out a separate file of the mask itself. Great tool!

dustysys commented 2 years ago

Thank you. Saving of individual detected object masks, or the overall mask preview for all detected objects in the primary and secondary model run, can be enabled in the settings. The object mask images are saved individually because they must be run individually to benefit from full-res inpainting. Does this take care of your use case?

scrambled2 commented 2 years ago

Oh man, I feel like a knob. Thank you for pointing out the obvious lol. I should have checked first.

lhucklen commented 2 years ago

What is the directory path? Any way to encompass a body in a mask without a face?

lhucklen commented 2 years ago

Never mind I found it

dustysys commented 2 years ago

@lhucklen The path is configurable in the settings, by default it is in the extensions/ddetailer/outputs folder. Saving masks is disabled by default and must be enabled with a checkbox.

To get a mask of the full body, you'd just use the dd-person as model A with no model B. If you mean you want a mask of just the body and not the head, you would need an (A - B) mask operation, or an A - (A&B) mask operation. It's an interesting idea though rerolling the body tends to have less benefit in full-res inpainting detail and a higher likelihood of inpaint artifacts/ghosting compared to rerolling the face. Are you trying to reroll outfits on characters?

lhucklen commented 2 years ago

Yup that is the idea, that and make funny face swaps of friends in superhero movies lol

lhucklen commented 2 years ago

Think you could make an operation like that?

lhucklen commented 2 years ago

Perhaps use the current inpainting tool to block what should or shouldn’t be masked and then running the process through detection - what was I painted?

dustysys commented 2 years ago

A-B is very easy so I threw it in. I'll need to think on the gradio painter mask bit. For now you can manually black out the parts of the mask you don't want in an image editor and feed that back via the 'Upload mask' option in inpaint mode.