Skip to content

Flux Fill Workflow Step-by-Step Guide

Flux Fill is a powerful model specifically designed for image repair (inpainting) and image extension (outpainting). This tutorial will guide you through the complete process from installation to usage.

Flux Fill Workflow

This tutorial is a detailed guide based on the official ComfyUI workflow. Official original tutorial address: https://comfyanonymous.github.io/ComfyUI_examples/flux/

Introduction to the Flux Fill Model

The Flux Fill model is primarily used for:

  • Image repair: filling in missing or removed areas of an image
  • Image extension: seamlessly extending the boundaries of an existing image
  • Precise control over generated content using masks and prompt words

Flux Fill model repository address: Flux Fill

Preparation

1. Update ComfyUI

First, ensure your ComfyUI is updated to the latest version. If you’re unsure how to update and upgrade ComfyUI, please refer to How to Update and Upgrade ComfyUI

2. Download Required Models

You need to download the following model files:

Model NameFile NameInstallation LocationDownload Link
CLIP Modelclip_l.safetensorsComfyUI/models/clipDownload
t5xxl_fp16.safetensorsComfyUI/models/clipDownload
Flux Fill Modelflux1-fill-dev.safetensorsComfyUI/models/unetFlux Fill Release

3. Download Workflow Files

Workflow Usage Guide

Workflow Node Explanation

The workflow primarily includes the following key nodes:

  1. Model Loading Node
  • UNETLoader: Loads the Flux Fill model
  • DualCLIPLoader: Loads the CLIP text encoding model
  • VAELoader: Loads the VAE model
  1. Prompt Encoding Node
  • CLIPTextEncode (Positive): Positive prompt encoding
  • CLIPTextEncode (Negative): Negative prompt encoding
  • FluxGuidance: Flux-specific prompt guidance strength control
  1. Image Processing Node
  • LoadImage: Loads the image to be repaired and the mask
  • InpaintModelConditioning: Processes the conditions for image repair
  • KSampler: Sampler settings
  • VAEDecode: Converts the latent image to a visible image
  • SaveImage: Saves the generated image

Usage Steps

  1. Load Models

    • Select flux1-fill-dev.safetensors in UNETLoader
    • Load clip_l.safetensors and t5xxl_fp16.safetensors in DualCLIPLoader
    • Load ae.safetensors in VAELoader
  2. Prepare Images and Masks

    • Load the image you need to repair in the LoadImage node
    • The image should include white areas as the mask for the repair region
  3. Set Prompts

    • Input the description of the content you want to generate in the positive prompt box
    • Input the description of the content you do not want to appear in the negative prompt box
    • Adjust the prompt guidance strength through the FluxGuidance node (default value 30)
  4. Adjust Sampling Parameters In the KSampler node, set:

    • Steps: Recommended 20-30 steps
    • CFG: Recommended 7-8
    • Sampler: Recommended euler
    • Scheduler: Recommended normal
    • Denoise: Recommended 1

Parameter Tuning Suggestions

Here are some practical parameter tuning suggestions:

  • Prompt guidance strength (FluxGuidance):

    • The larger the value, the closer the generated content is to the prompt description
    • The smaller the value, the more natural the generated content is
    • Recommended range: 20-40
  • Sampling steps (Steps):

    • The more steps, the richer the details, but the longer the processing time
    • Recommended range: 20-30 steps
  • Denoise strength (Denoise):

    • 1.0 means complete regeneration
    • Lower values will preserve more original image features

Common Issues Solutions

  1. Unsatisfactory Generation Results

    • Try adjusting the FluxGuidance value
    • Increase the sampling steps
    • Optimize the prompt descriptions
  2. Unnatural Edges

    • Ensure the mask edges have a suitable blur transition
    • Adjust the Denoise value to 0.8-0.9
  3. Insufficient VRAM

    • Reduce the sampling steps
    • Lower the image resolution
    • Use a smaller batch size

Advanced Techniques

  1. Mask Creation Techniques

    • Use soft brush edges
    • Slightly expand the mask range
    • Consider the continuity of the surrounding environment
  2. Prompt Optimization

    • Provide detailed descriptions of the visual features of the target area
    • Include material, lighting, and other detail information
    • Use negative prompts to avoid unwanted elements
  3. Parameter Combination Recommendations

    • Realistic scenarios: Higher Steps (25-30), lower FluxGuidance (20-25)
    • Artistic creations: Lower Steps (15-20), higher FluxGuidance (35-40)

Example Showcase

You can try the following examples to familiarize yourself with Flux Fill’s usage:

  1. Simple Repair
  • Positive prompt: a natural landscape with trees and mountains
  • FluxGuidance: 30
  • Steps: 20
  1. Creative Filling
  • Positive prompt: magical forest with glowing mushrooms and fairy lights
  • FluxGuidance: 35
  • Steps: 25

Remember to save your satisfactory parameter combinations for future use.