Skip to main content

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.

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.

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:
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)
This mode uses the full inpaint pipeline and produces the most context-aware results.

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):
DirectionEffect
UpExtends the image upward
DownExtends the image downward
LeftExtends the image to the left
RightExtends the image to the right
Multiple directions can be selected simultaneously to expand on several sides at once.

Inpaint Engine Versions

Fooocus supports multiple inpaint engine versions, selectable in the advanced inpaint settings:
VersionNotes
NoneDisables the custom inpaint engine; falls back to standard diffusion
v1First-generation Fooocus inpaint engine
v2.5Improved second-generation engine with better edge blending
v2.6Latest 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
# Main prompt
a serene mountain landscape at sunset

# Inpaint additional prompt (for the masked region)
a wooden cabin with warm glowing windows

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 model
  • u2netp — Lightweight variant
  • u2net_human_seg — Optimized for human subjects
  • u2net_cloth_seg — Clothing segmentation
  • silueta — Silhouette extraction
  • isnet-general-use — IS-Net general model
  • isnet-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 VRAM
  • vit_l — Balanced speed and quality
  • vit_h — Highest quality, most VRAM

Cloth Segmentation Categories

When using u2net_cloth_seg, you can specify which garment region to mask:
CategorySegments
fullEntire outfit
upperUpper body clothing
lowerLower body clothing

SAM with GroundingDINO

When using the sam 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.
# Example GroundingDINO prompt
the red hat
SAM produces the most accurate masks for complex or irregularly shaped subjects. Use vit_h for the highest quality when VRAM allows, or vit_b for faster processing on lower-end GPUs.

Step-by-Step Inpainting Workflow

1

Upload your image

Open Input Image → Inpaint or Outpaint and upload the image you want to edit.
2

Create a mask

Paint over the area to edit using the brush tool, or select a mask model to generate the mask automatically.
3

Select an inpaint mode

Choose between Inpaint or Outpaint, Improve Detail, or Modify Content depending on your editing goal.
4

Add an inpaint prompt (optional)

Fill in the Inpaint Additional Prompt field to describe what should appear in the masked region.
5

Select an engine version

Use v2.6 for best results unless you have a specific reason to use an older version.
6

Generate

Click Generate. Fooocus will apply the inpaint model to regenerate only the masked region while preserving the rest.

Build docs developers (and LLMs) love