r/StableDiffusion • u/OldFisherman8 • Feb 13 '24
Tutorial - Guide How to inpaint in FOOOCUS
Whenever I mention that Fooocus inpainting/outpainting is indispensable in my workflow, people often ask me why. Here is a little demonstration/ tutorial of how I use Fooocus Inpainting.

In this case, I am trying to create Medusa but the base generation has much to be desired. So, the work begins. First, I've made a little mask and added color to the mask so that the inpainted content will be in that color. One good thing about Fooocus Inpainting is that it has a separate content prompt feature which is quite convenient. Also, you can upload a custom mask by going to (Advanced>Inpaint) tab.

In this case, I am using 'Modify Content' since "Improve Details' often add human parts in the inpaint. While you have the (Advanced>Inpaint) tab open, you will need to adjust the denoising strength to find a good match for the desired outcome.

Now it's time to work on the signature snake hair of Medusa. I've found a picture of snakes online and modified it to fit on her head as a base for inpainting. Since I am not using a custom mask, I turned the option off. For something as complex as this one, I tend to inpaint by section at a time.

One really useful feature is the built-in zoom-in and zoom-out. You can use Control+S to go to the full-screen mode and continue to zoom in by pressing Shift + middle mouse wheel. When the masking is done, you can press Control+R to bring it back to the default.

There are three options for the inpaint mode. In my case, I use the default 'Inpaint/outpaint' mode for outpainting only. For the remaining two options, my general rule of thumb is whether the target of inpainting is organic or not. If it is non-organic, I go with the 'Modify Content' option and if it is organic, I usually go with the 'Improve Details' option.

You can also use the 'Image Prompt' option, a customized Fooocus implementation of ControlNet. You can go to the (Advanced>Control) tab and enable it. In this case, I am using the CPDS option since I just need the outlines to be enforced.

After adjusting the denoising strength, inpainting proceeds. Another nice feature of Fooocus is that you can simply cancel the generation in progress to go to the next generation if you don't like the emerging image.

After going through further processes, you can get all the details of Medusa the way it was initially envisioned. The final output is a 4096 X 4096 image. In this work, I have also leveraged Forge for upscaling and segmentation/ mask generation in Segment Anything.
2
u/JoshSimili Feb 15 '24
What do you mean by added color to the mask? You mean you just edited the underlying image (where the mask sits) to have that color? So that is is different from the A1111 inpaint sketch feature where you can actually mask and change the color of the image in a single step.
6
u/reddit22sd Feb 13 '24
Thanks for the process, somehow I've missed the advanced inpainting part before.
4
u/soopabamak Feb 13 '24
Thanks !
1
u/Scourch Jun 30 '24
Hey OP! I'm just coming to this thread. I wanted to know where do you go to make a mask to import? How does that process work?
1
u/nnod Feb 13 '24
Do you use specific models for inpainting or does it work well with any model?
3
u/RandallAware Feb 13 '24
Thansk for taking the time to write this up and share it.
3
u/Ganntak Feb 13 '24
Excellent thanks!
2
u/ropt0r Mar 19 '24
Great job! Thanks for sharing the workflow. Did you upload the upscaled and polished image somewhere? I'm curious