Master Local Edits & Style Transfers with This Cutting-Edge Workflow

CN
ComfyUI.org
2025-06-12 08:01:31

1. Workflow Overview

mbt3a4q5w6xhepml1a图片压缩4c25f7162043e9f3fae72c9bca89fbb6e3e2fca0f957e2b194e113c6c51b4f25.jpg

This workflow specializes in local inpainting and style transfer, leveraging ICEdit (In-Context Editing) and Flux models to:

  • Edit Specific Areas: Modify masked regions (e.g., changing couch color to sky blue).

  • Apply Artistic Styles: Support Van Gogh-style transformations.

  • Auto-Upscaling: Default 512px output with ESRGAN enlargement.

Core Models:

  • Flux Fill dev: Official redraw model (FP8 optimized).

  • ICEdit-LoRA: Fine-tuned for local edits.

  • T5-XXL & CLIP-L: Dual-text encoders for multilingual prompts.


2. Key Nodes

Built-in Nodes:

  • DiptychCreate: Splits input image into original + mask pairs.

  • ICEFConditioning: Fuses text instructions with image context.

  • FluxGuidance: Controls semantic guidance intensity (default=50).

Custom Nodes:

  1. LibLibTranslate (Install via ComfyUI Manager)

    • Translates Chinese prompts to English (e.g., "梵高画风" → "Van Gogh style").

  2. easy cleanGpuUsed (From ComfyUI-Easy-Use)

    • Prevents OOM errors by clearing VRAM.

Model Dependencies:

  • ESRGAN_4x: Upscale model loaded via UpscaleModelLoader.

  • ae.sft: Custom VAE (place in models/vae).


3. Workflow Structure

Group

Function

Input/Output

Global Control

Image upload + prompt translation

Input: Image + Chinese → Output: English + Mask

Model Loaders

Loads UNET, VAE, LoRA

Input: Config → Output: Initialized models

Sampling

Generates images via KSamplerAdvanced

Input: Text + Mask → Output: Latent space

Upscaling

Enhances resolution with ESRGAN

Input: 512px → Output: HD (e.g., 1024px)

Output

Preview & save results

Input: Processed image → Output: PNG


4. Inputs & Outputs

Required:

  • Image: Upload via DiptychCreate (e.g., 原图2.png).

  • Prompt: Enter Chinese in LibLibTranslate (e.g., "Van Gogh style").

Optional:

  • Seed: Randomized by default (editable in KSamplerAdvanced).

  • Guidance Scale: Adjust in FluxGuidance (affects style strength).

Output:

  • Final images saved to /ComfyUI/output/ with metadata.

  • Real-time preview via PreviewImage.


5. Notes

  1. VRAM: Recommend 12GB+ GPU. Disable ImageUpscaleWithModel for low-end GPUs.

  2. Troubleshooting:

    • Missing VAE: Ensure ae.sft is in models/vae.

    • Mask issues: Verify DiptychCreate mask channels.

  3. Optimization:

    • Reduce KSamplerAdvanced steps (default 28 → 20).

    • Use easy cleanGpuUsed to free VRAM periodically.