Achieve Photorealistic Edits with the Flux+ICEdit Workflow: A Comprehensive Overview

CN
ComfyUI.org
2025-05-14 14:09:44

1. Workflow Overview

manjky1h2fn519hsymvabae3e6ef160e052eea7b61391d179d285b08d8f6d9a41e6f28235119772e72f.png

This workflow, named "Flux+ICEdit Single-Command Image Editing with Consistency", is designed for text-guided image editing. It allows modifying images via natural language (e.g., changing outfits, colors, or accessories) while preserving structural consistency. Key features:

  • Image Editing: Uses ICEdit-MoE-LoRA for localized/global edits.

  • Text Guidance: Accepts Chinese commands (auto-translated to English).

  • Upscaling: Enhances resolution with 4x-UltraSharp.

  • Style Control: Applies StyleModel (e.g., flex1_redux_siglip2_512).

Core Models:

  • Stable Diffusion: Base generative model (loaded via UNETLoader).

  • ICEdit-MoE-LoRA: Fine-tuned LoRA for editing.

  • CLIP Vision (sigclip_vision_patch14_384): Encodes image semantics.

  • 4x-UltraSharp: Upscaling model.


2. Key Nodes

  1. ICEdit-MoE-LoRA (Node 345)

    • Function: Loads the editing-specific LoRA.

    • Installation: Manually download .safetensors to models/loras.

  2. ACEPlusLoraProcessor (Node 472)

    • Function: Processes input image/mask for edits.

    • Dependency: Requires ComfyUI-ICEdit (GitHub).

  3. DeepTranslatorTextNode (Node 424)

    • Function: Translates Chinese commands to English (Google API).

    • Install: Via ComfyUI Manager (search DeepTranslator).

  4. StyleModelApply (Node 443)

    • Function: Applies style models (e.g., flex1_redux_siglip2_512).

  5. ImageUpscaleWithModel (Node 439)

    • Function: Upscales images with 4x-UltraSharp.

Special Dependencies:

  • Model Files:

    • ICEdit-MoE-LoRA: Download from CivitAI.

    • sigclip_vision_patch14_384: Available on Hugging Face.


3. Workflow Structure (Groups)

  1. Group 1: Upload Image (Node 240)

    • Input: Original image (e.g., 768-1152.png).

    • Output: Image data for editing.

  2. Group 2: Load Models (Nodes 329, 345, 32, 227)

    • Loads Stable Diffusion, ICEdit-LoRA, VAE, CLIP, etc.

  3. Group 3: Text Command (Nodes 461, 424, 114)

    • Input: Natural language command (e.g., "Change to yoga pants").

    • Output: Translated English prompts for CLIPTextEncode.

  4. Group 4: Generate & Upscale (Nodes 454, 439, 437)

    • Edits image → Upscales → Downscales for optimization.

  5. Group 5: Output (Nodes 493, 464)

    • Output: Comparison view (original vs. edited) and saved final image.


4. Inputs & Outputs

Inputs:

  • Original image (e.g., 768x1152 resolution).

  • Chinese text command (e.g., "Change shirt color").

  • Seed value (fixed or randomized).

Outputs:

  • Edited high-res image (saved as PNG).

  • Slider comparison tool (original vs. edited).


5. Notes

  1. Common Issues:

    • Missing ICEdit-LoRA → Check models/loras.

    • GPU OOM → Reduce resolution or use --medvram.

  2. Optimization:

    • Enable --xformers for faster inference.

    • Increase KSampler steps (default: 20) for complex edits.

  3. Compatibility:

    • Requires ComfyUI ≥ 0.3.30 and PyTorch 2.0+.

    • ACEPlusLoraProcessor needs manual dependency install.