Fooocus includes its own custom inpaint algorithm and dedicated inpaint models, entirely separate from the standard SDXL inpainting method. This purpose-built approach produces significantly more satisfying results than software that relies on the generic SDXL inpaint model, particularly for detail refinement and content modification tasks.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lllyasviel/Fooocus/llms.txt
Use this file to discover all available pages before exploring further.
Accessing Inpaint & Outpaint
Go to Input Image → Inpaint or Outpaint tab. Upload your source image, then either paint a mask directly on the canvas or use automatic mask generation to select a region.The first time you use inpaint, Fooocus will automatically download its dedicated inpaint patch model (
inpaint_v26.fooocus.patch, ~1.28 GB) from Hugging Face. Subsequent uses load the cached model instantly.Inpaint Modes
Fooocus provides three distinct inpaint modes to cover different editing tasks:- Inpaint or Outpaint (default)
- Improve Detail
- Modify Content
The general-purpose mode for replacing masked regions or expanding the canvas. Use this for:
- Removing and replacing objects
- Changing backgrounds
- Expanding image borders (outpainting)
Outpainting Directions
To expand the canvas beyond the original image boundaries, select one or more outpaint directions. Fooocus will extend the image content naturally in the chosen direction(s):| Direction | Effect |
|---|---|
| Up | Extends the image upward |
| Down | Extends the image downward |
| Left | Extends the image to the left |
| Right | Extends the image to the right |
Inpaint Engine Versions
Fooocus supports multiple inpaint engine versions, selectable in the advanced inpaint settings:| Version | Notes |
|---|---|
None | Disables the custom inpaint engine; falls back to standard diffusion |
v1 | First-generation Fooocus inpaint engine |
v2.5 | Improved second-generation engine with better edge blending |
v2.6 | Latest engine (default); best overall quality and context awareness |
Additional Prompt for Inpainting
The Inpaint Additional Prompt field lets you describe the content you want to place in the masked region, independently of your main prompt. This is especially useful when:- The main prompt describes the overall scene and the inpaint prompt describes the specific replacement
- You want to add a new object without re-describing the entire image
Automatic Mask Generation
Instead of painting a mask manually, Fooocus can generate one automatically using background removal and segmentation models.Mask Models
Select a mask model from the Mask Model dropdown:U2Net Models
General-purpose background removal and segmentation:
u2net— Standard U2Net modelu2netp— Lightweight variantu2net_human_seg— Optimized for human subjectsu2net_cloth_seg— Clothing segmentationsilueta— Silhouette extractionisnet-general-use— IS-Net general modelisnet-anime— IS-Net optimized for anime/illustration
SAM (Segment Anything)
Meta’s Segment Anything Model for precise region selection guided by a text prompt (via GroundingDINO):
vit_b— Fastest, lowest VRAMvit_l— Balanced speed and qualityvit_h— Highest quality, most VRAM
Cloth Segmentation Categories
When usingu2net_cloth_seg, you can specify which garment region to mask:
| Category | Segments |
|---|---|
full | Entire outfit |
upper | Upper body clothing |
lower | Lower body clothing |
SAM with GroundingDINO
When using thesam mask model, Fooocus pairs it with GroundingDINO for text-guided detection. Enter a description of what you want to select and SAM will generate a precise mask around that region.
Step-by-Step Inpainting Workflow
Create a mask
Paint over the area to edit using the brush tool, or select a mask model to generate the mask automatically.
Select an inpaint mode
Choose between Inpaint or Outpaint, Improve Detail, or Modify Content depending on your editing goal.
Add an inpaint prompt (optional)
Fill in the Inpaint Additional Prompt field to describe what should appear in the masked region.
Select an engine version
Use
v2.6 for best results unless you have a specific reason to use an older version.