Skip to content

Fooocus #3 - removing objects

Introduction

In the previous post (painting a palm tree into a photo) we checked whether the tool can add common objects, such as a palm tree or a turtle, to a photo. The prompts were simple, very general. The tool could add the object in the marked area, though it tended to insert complete objects strongly shaped by their surroundings. For example, a palm tree grows from the ground (shocking 😉 ), usually starting at the line between sand and water. I assume that comes from prompts that were too simple (general), which made the tool add objects rather randomly.

Besides generating photorealistic images, Fooocus can change, add or remove objects, in photos for example. Whether it can generate new images or add new elements we have already checked. Today we focus on removing unwanted objects from a photo.

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.

Removing people from a photo

First, let's take a drone photo of a beach. It shows a few boats moored by the beach, but there are also people in the water. Let's try to remove them. To do that, tick "Input image" and go to the "Inpaint or Outpaint" tab. Choose the photo.

Fooocus: an aerial photo of a beach with boats on turquoise water
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. I marked the parts with people. I did not change the method and left the default "Inpaint or Outpaint". In the prompt field I typed "remove people".

Fooocus: masks over the people in the water and the prompt remove people
Fooocus - objects marked for removal (the lighter, round areas)

Click "Generate". Here is the result:

The beach with boats after removing the people from the water
The photo with the people removed

You can see the people were removed correctly and replaced with the water around them. But the pattern of the waves gives away where they were. Those spots look slightly blurred. To check the effect, let's try removing a bigger object - one of the boats.

Removing a boat from the photo

Removing a small object on a demanding background (waves that create a varied texture, hard to "fill in") left slightly blurred areas, which really just do not match the pattern of the waves.

The beach after removing one of the boats

The effect is similar - an area that looks a bit as if it was pasted in from another photo. The tool can also modify areas, so it can probably be improved, but today we are only checking plain object removal. As you can see, it works by covering the object with the background around it. For a better effect you can, of course, generate several versions of the result and simply pick the one that looks natural.

Removing text from clothing

We already know a varied background leaves artefacts, so let's try something simpler - removing the lettering from a T-shirt. The lettering is one connected area, and the background is white.

Fooocus: a man in a white T-shirt with lettering, the lettering masked for removal
Fooocus - the text on the T-shirt marked for removal

Without beating around the bush, here is the result for the prompt "remove the text":

The man in the T-shirt: instead of the lettering, a landscape picture appeared
Fooocus - the text on the T-shirt has been removed 😉

Well, the old text is gone, but some picture with wonky text appeared instead. Let's change the prompt to "set white". Here is the result:

The man in a plain white T-shirt after removing the lettering with the prompt set white
Fooocus - the lettering removed properly

The area where the lettering was looks a bit blurred, but the folds of the T-shirt fall naturally. Only around the chest does the tool seem to bend towards rounded shapes, but it still looks pretty good.

Summary

Fooocus handles object removal quite well, and importantly, relying only on the default options or the ones visible "on the surface" of the interface. Tools like Fooocus usually (and this one too) have a preprocessor for the prompt, to make "everyday work" easier for the user. But keep in mind it is geared towards popular use cases. Options such as removing objects need more knowledge of the tool or of writing prompts. Today we managed to remove people, a boat and the lettering on a T-shirt, but as you can see, the lettering did not go "right away". I ran more tests on removing the lettering, with the prompts "remove the text", "set white" and with no prompt. With enough attempts, one of them always returned a "clean" T-shirt, though admittedly the prompt "set white" gave the most satisfying effect. The tool has learned certain behaviours and tries to fit the result to the surroundings it "knows". Longer prompts would probably solve the problem, making the effect repeatable rather than a matter of luck.

Sources

  1. Aerial photo of the beach Gaddafi Rusli / Unsplash
  2. Photo of the man in the T-shirt Vinícius Henrique Photography / Unsplash
Advertisement