FLUX|Kontext: The Ultimate AI Image Editing Workflow for Pros

CN
ComfyUI.org
2025-06-23 10:17:37

1. Workflow Overview

mc8xy8g4genwqvjkqig压缩版本.png

Purpose:
This workflow (named FLUX丨Kontext) enables AI-powered image editing via natural language commands (e.g., "Replace the goose head with a snake head"), combining inpainting, semantic understanding, and multilingual support.

Core Models:

  • FluxKontextMaxImageNode: Edits images based on text prompts (object/background replacement).

  • Stable Diffusion (implicit): Powers underlying image generation.

  • LibLibTranslate: Translates non-English prompts (e.g., Chinese→English).


2. Critical Nodes

Node Name

Function

Installation

FluxKontextMaxImageNode

Modifies images using text prompts (requires SD model)

Manual install via GitHub

ImageScaleByAspectRatio V2

Resizes images while preserving aspect ratio (Letterbox support)

Install LayerStyle via ComfyUI Manager

LibLibTranslate

Translates prompts in real-time (e.g., Chinese→English)

Requires LibLibAI custom plugin

Model Dependencies:

  • Download .safetensors checkpoint (e.g., SD 1.5/XL) to models/checkpoints.


3. Workflow Structur

mc8xyyyz3odwxanqpriimage.png
graph LR
  A[Input Image] --> B[Resolution Adjust]
  B --> C[Flux Image Edit]
  D[Text Prompt] --> C
  C --> E[Output Image]

Group Breakdown:

  1. Input Group:

    • LoadImage: Loads source image (e.g., 1152x1536 PNG).

    • Get_提示词: Accepts text commands (e.g., "Change background to flower field").

  2. Process Group:

    • ImageScaleByAspectRatio: Scales image to 1024x1024 (maintains aspect ratio).

    • FluxKontextMaxImageNode: Executes edits (uses prompt + seed).

  3. Output Group:

    • PreviewImage: Displays final result.


4. Inputs & Outputs

Input Parameters:

  • Image: PNG/JPG, recommended resolution ≥1024x1024.

  • Text Prompt: Supports multilingual input (auto-translated).

  • Seed: Fixed (e.g., 944134171880156) or randomized.

Output:

  • Edited image (retains original dimensions/metadata).


5. Important Notes

⚠️ Hardware:

  • Requires NVIDIA GPU (≥8GB VRAM). RTX 3060+ recommended.

  • High-resolution images may cause OOM; pre-scale inputs.

⚠️ Installation:

  • FluxKontextMaxImageNode must be manually installed from GitHub to custom_nodes.

  • LibLibTranslate may require API key (some versions are paywalled).

⚠️ Troubleshooting:

  • If output is unchanged, verify prompt translation to English.

  • Disable mask input in ImageScaleByAspectRatio if unused.

Recommend