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.
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 Name | File Name | Installation Location | Download Link |
---|---|---|---|
CLIP Model | clip_l.safetensors | ComfyUI/models/clip | Download |
t5xxl_fp16.safetensors | ComfyUI/models/clip | Download | |
Flux Fill Model | flux1-fill-dev.safetensors | ComfyUI/models/unet | Flux Fill Release |
3. Download Workflow Files
Workflow Usage Guide
Workflow Node Explanation
The workflow primarily includes the following key nodes:
- Model Loading Node
UNETLoader
: Loads the Flux Fill modelDualCLIPLoader
: Loads the CLIP text encoding modelVAELoader
: Loads the VAE model
- Prompt Encoding Node
CLIPTextEncode (Positive)
: Positive prompt encodingCLIPTextEncode (Negative)
: Negative prompt encodingFluxGuidance
: Flux-specific prompt guidance strength control
- Image Processing Node
LoadImage
: Loads the image to be repaired and the maskInpaintModelConditioning
: Processes the conditions for image repairKSampler
: Sampler settingsVAEDecode
: Converts the latent image to a visible imageSaveImage
: Saves the generated image
Usage Steps
-
Load Models
- Select
flux1-fill-dev.safetensors
inUNETLoader
- Load
clip_l.safetensors
andt5xxl_fp16.safetensors
inDualCLIPLoader
- Load
ae.safetensors
inVAELoader
- Select
-
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
- Load the image you need to repair in the
-
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)
-
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
-
Unsatisfactory Generation Results
- Try adjusting the FluxGuidance value
- Increase the sampling steps
- Optimize the prompt descriptions
-
Unnatural Edges
- Ensure the mask edges have a suitable blur transition
- Adjust the Denoise value to 0.8-0.9
-
Insufficient VRAM
- Reduce the sampling steps
- Lower the image resolution
- Use a smaller batch size
Advanced Techniques
-
Mask Creation Techniques
- Use soft brush edges
- Slightly expand the mask range
- Consider the continuity of the surrounding environment
-
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
-
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:
- Simple Repair
- Positive prompt:
a natural landscape with trees and mountains
- FluxGuidance: 30
- Steps: 20
- 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.