Beyond the Frame: A Step-by-Step Workflow for FLUX Model Image Outpainting

CN
ComfyUI.org
2025-03-14 18:10:04

Workflow Overview

m88mdbji5bw53xyk9vpflux_fill_outpaint_example_input.png

This workflow focuses on image outpainting using the FLUX model. It leverages Stable Diffusion techniques, incorporating FluxGuidance for controlled expansion, InpaintModelConditioning for inpainting missing areas, and VAEDecode for high-quality image reconstruction.

Ideal for:

  • Extending image borders

  • Filling missing parts

  • Enhancing image quality


Core Models

  1. FLUX Outpainting Model (flux1-dev-fp8.safetensors)

    • Used for expanding images while maintaining consistency.

  2. Stable Diffusion VAE (ae.safetensors)

    • Encodes and decodes latent space images.

  3. Dual CLIP (clip_l.safetensors, t5xxl_fp16.safetensors)

    • Encodes text prompts into latent space.

  4. UNET (flux1-dev-fp8.safetensors)

    • Handles diffusion for image generation.


Key Components (Nodes)

  1. LoadImage

    • Loads the original image as input.

  2. ImagePadForOutpaint

    • Expands the canvas size for outpainting.

  3. FluxGuidance

    • Guides the expansion process to match the original style.

  4. InpaintModelConditioning

    • Ensures seamless integration between extended and original content.

  5. KSampler

    • Performs diffusion sampling (20 iterations).

  6. VAEDecode

    • Converts latent space into real pixel images.

  7. SaveImage

    • Saves the final outpainted image.


Workflow Structure

This workflow consists of four major stages:

1. Input & Preprocessing

  • LoadImage reads the base image.

  • ImagePadForOutpaint extends image borders.

  • CLIPTextEncode processes text prompts.

2. Computing Outpainting Features

  • FluxGuidance controls content generation.

  • InpaintModelConditioning optimizes conditions.

3. Generating Expanded Content

  • KSampler performs diffusion-based image expansion.

  • VAEDecode reconstructs the final image.

4. Output

  • SaveImage stores the expanded image.


Input & Output

Inputs

  • Base image

  • Expansion size (default: 400px left & right)

  • Text prompt

  • FLUX Model

  • VAE Model

Outputs

  • Expanded image

  • Seamless outpainting results

  • Saved final image


Considerations

  1. Performance

    • Requires RTX 3090+ for optimal performance.

  2. Troubleshooting

    • If outpainting looks unnatural, tweak FluxGuidance strength or modify text prompts.

    • If details are blurry, increase KSampler iterations.

  3. Compatibility

    • Works with ComfyUI 0.4+, requires some custom nodes.


This analysis provides a comprehensive guide for beginners using FLUX for image outpainting in ComfyUI! πŸš€