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.31k stars 2.32k forks source link

[enhancement]: Built-in ADetailer #4944

Open vrubzov1957 opened 8 months ago

vrubzov1957 commented 8 months ago

Is there an existing issue for this?

Contact Details

No response

What should this feature add?

Feature for automatically fix faces and hands. That detects areas with faces and hands, automaticaally masks it, and do 2-th pass of generation for this specific areas.

And for text2image and for image2image modes.

Alternatives

Bing-su/adetailer

Additional Content

No response

vrubzov1957 commented 8 months ago

Guys, "High Resolution Fix" in 3.4 InvokeAI version - it is works same as ADetailer, or it is other function? Or does it do the same thing as ADetailer but in a different way?

Husky110 commented 7 months ago

@vrubzov1957 - I think it is something completely different.

To the issue: Perfect would be to replicate the basic functions of the linked github-repo. It would be suffice to have a folder where to place the addetailer-models so we can use them on invokations. Plus - there are several models out there that can do several stuff.

The big advantage of ADetailer vs. the normal "FaceRestore" (Codeformer, GFPGAN) is that ADetailer actually keeps any face-features that have been invoked. For example - when you create an image with SD and that image contains moles or freckles than those are beeing kept by ADetailer vs. Facerestore which removes them most of the times resulting in a "plastic" look. TBH: THAT aspect drives me away from invokeAI right now to keep using A1111. I don't say that invoke should compete with A1111, since A1111 is way more versitile at the moment, but invoke should take notes from the most popular extensions of A1111.

davidiwharper commented 5 months ago

There is a Diffusers pipeline for ADetailer asdiff, which may make implementing this request more feasible.

hansfuchs commented 4 months ago

I was just looking for the same. Is there any other way to replicate this without having to manually do the inpainting yourself?

Husky110 commented 4 months ago

@hansfuchs - The only way I could see right now is to do your stuff in Invoke, then fire up A1111 with the img2img-tab, leaving the interfiering noise at 0 and activate ADetailer to let it run over your image.
We totally need this in Invoke, since there are many Detailer-models out there by now. I know - they focus on nsfw-content, but that shouldn't stop the Repo itself.

hansfuchs commented 4 months ago

@Husky110 thought so... I already switched to A1111, not having such an important feature is really a deal-breaker. Guess I'll stop using InvokeAI for now.

Husky110 commented 4 months ago

@hansfuchs - Depends on what you are doing. Img2Img is still very powerfull in invoke. But yeah - it lacks the adetailer very much.

nidhoggr-nil commented 2 months ago

Started to get into stable diffusion and been going through the landscape, invoke-ai is by far the best ux/ui. Sadly adetailer seems key in many workflows incorporating faces, sad that it isn't supported :/ Too bad I don't know more about all this stuff.

ThesiiNCey commented 1 month ago

adetailer can automatic inpaint and give face more details or hands depents on the model for adetailer this would be great if we got support for it to use the model from adetailer 1111 and Comfy has support for it

joshgura commented 1 month ago

invoke is really polished. was looking for adetailer, since it's a high res fix for faces, and it's faster than running an upscale on the whole thing. or?

ThesiiNCey commented 1 month ago

it's a after detailer it ad more Details after Image is ready generated, on civit are Models for face Hands Body breasts and genitals Original it wil autodetect these and edit the stuff you selected

Husky110 commented 1 month ago

The problem with ADetailer inside Invoke seems to be that people ask "Why?", since you have the unified canvas that can take care of most of the problems. I can only answer that in laymens-terms, since I use AI more as a hobby and not really professionally. I think if you try out an ADetailer in A1111 or Forge would give the best reasons and answers. For me it's the faces. Using a Facerestore leaves me with "plastic"-looking faces with virtually no imperfections. ADetailer seems to be able to take some of the mess left behind by the basic-image-creation and create good looking faces. I don't know how it does that specifically, but for me the results are better than anything that can be accomplished by a manual process.

nidhoggr-nil commented 1 month ago

I don´t get the "it's also being used for porn" comment which is supposed to dismiss its usefulness. I just see that tutorials for face and hand restoration use that, and if you make any kind of marketing, character design or concept art, it seems like having this in a pipeline is just useful. Also, so what if people use it for whatever they want, it doesn´t immediately nullify all the useful cases as well. And being a type of "morality police" does not suit a project like this, where it seems you are guilty by association to something which is presumably based on puritan ideals.

I used to work as a game developer, but changed fields and still enjoy game-dev, now, having a quick pipeline for asset design and storyboarding would be great, but try presenting something off putting to someone, with an asymmetrical/ugly face or distracting detail, and that single out of place thing is going to stay in their brain instead of what you want to say.

I mean, I would take this feature if it was hardcoded to blur pornographic images, but that is just too hard to implement reliably and easily worked around.

PenDrag0n7 commented 1 month ago

going to though In my 2cent XD

1) I dont think aDetailer should be implemented at the UI level, yes it s a killer feature, but

2) Workflows should have better integration into the txt2img ang img2img UI, Look at ComfyUI integration for A1111, where us can set a pre or post process workflow for both Latent or an Image and Send it to and from the UI https://github.com/ModelSurge/sd-webui-comfyui

Husky110 commented 1 month ago

Those who still run the "But it can be used for porn duh!"-argument just didn't realize that the whole internet is in big parts defined by the porn-industry. Plus the good old attic "The internet is for porn.": https://www.youtube.com/watch?v=tBlTSzLAzJE

I can see @PenDrag0n7's argument with the UI. However - I think we have to think about what users use Invoke for. I would assume that Invoke is mainly used for image-creating in a sense to build a good baseline, trying to max that out and do some other stuff with it later on. Doing anything else can be acchieved with complex workflows using ComfyUI (just check at civitai...) but those come with a learning curve, which (in my oppinion) is good to have. Adding ADetailer on UI-level as an optional feature (like Loras) would actually benefit the "I will max-out my baseline"-part. I'm not arguing for a feature-creep here, but I think the absence of ADetailer repells a good amount of users, since I could see a good portion of users creating images in Invoke and HAVE to use img2img in another UI to have ADetailer run over their images and then reimport them to Invoke for finer modifications. Adding ADetailer to Invoke inside the UI would streamline that workflow.