Skip to content

Fooocus #2 - inpainting

Introduction

In the previous post (a quick test of Fooocus) we checked whether the tool can generate common objects such as shoes or people's faces from simple prompts. The results were satisfying, but admittedly, generating fairly random images may not be all that useful. For now we will hold off on writing complex prompts and focus on one very interesting option - repainting objects in an existing image.

An important option in this tool is editing existing images. It lets you fix, add or remove parts of an image. That way you can add a wild animal to your holiday photo, change the colour of the sea or remove a random passer-by. Today we focus on painting something in, the "inpaint" option.

2026 update. Fooocus still works, but since 2024 it only gets bug fixes (a long-term support version). Newer models such as Flux are handled by other programs, e.g. Forge or ComfyUI. The way you work - prompts, styles, inpainting and outpainting - stays the same, so this series still shows well how image generation works in practice.

Painting a palm tree into a photo

First, let's take a "holiday" photo and add something extra. To do that, tick "Input image" and go to the "Inpaint or Outpaint" tab. Choose the photo.

Fooocus, Inpaint or Outpaint tab with a photo of a beach with people loaded
Fooocus - the menu for repainting parts of an image

On the photo you can paint over the area (or areas) to be changed. It is like adding a mask in a graphics program. Choose the "Modify content" method. In the "Inpaint additional prompt" field, type what you want to add ("palm tree"). You can leave the standard prompt field empty. I set 3 variants to generate at 1024x1024. I did not change the styles selected by default.

Fooocus, Inpaint or Outpaint tab: a beach photo with a mask in the top left corner and the prompt palm tree
Fooocus - painting a palm tree into a holiday photo

Click "Generate". The tool returns these images:

It looks really good, though you can see the tool tries to "latch on" to something, so in all three cases the generation starts near the log the man is sitting on, not in the area marked on the photo.

Let's change where the palm tree should appear and try again. Here is the view with the corrected input image:

Fooocus, Inpaint or Outpaint tab: a beach photo with a mask along the right edge and the prompt palm tree, palm tree leaves
Fooocus - painting a palm tree into the photo

This time I generated 9 variants - maybe we need to "hit" the chance of a palm tree being painted in. Here are the results:

No luck 😉 It looks like the line between sand and water is a very strong signal that "this is where palm trees usually start".

Painting a turtle into the photo

OK, let's leave the palm trees alone and try to add an exotic animal that would not pose for a photo so easily - a turtle. I mark the area:

Fooocus: a mask on the sand in the foreground and the prompt add turtle
Fooocus - painting in a turtle

After a few longer moments I got these two photos:

A turtle is a turtle, as anyone can see. Unfortunately, you can also see that the sand under the turtle does not quite match its surroundings. The turtle itself is also very sharp, while that part of the photo is blurred. Maybe it can be improved - I will try to come back to it in later posts.

Painting a model into a shoe photo

Now something more commercial. We have a nice shoe, but our model did not show up for the shoot 😉 So let's replace them with a neural network. On the shoe photo, let's paint a mask for part of a leg and a trouser leg:

Fooocus: a photo of a red shoe with a mask above it and a prompt to add a leg
Fooocus - painting a leg into the shoe photo

Let's look at the first three results:

I must say I am impressed. Apart from the middle photo - which is no surprise really, since the prompt "a shoe on feet" is not very precise and even fits the result - the other two look great. Note that both photos have a generated shoe tongue that fits the foot. The shadows look good too. If only painting the mask were not necessary...

Summary

Compared with the effort, the results are more than satisfying. You can see the network's "tendency" to repeat familiar behaviour (painting the palm tree from the shoreline) or carrying part of the sand under the turtle over from the source images. I think that is a fairly common trait of generative networks. Note also that we still have not written complex prompts that could describe more precisely the effect we want. No settings were changed either, other than the resolution and the number of variants.

Sources

  1. Photo of people on the beach Patrick Beznoska / Unsplash
  2. Photo of the shoe Wengang Zhai / Unsplash
Advertisement