Skip to content

FLUX.1 Kontext: Character-Consistent Multi-Round Iterative Image Editing ​

FLUX.1 Kontext is Black Forest Labs' multimodal image editing model: text and images are input together, it first understands the visual context, then acts precisely according to the instruction. The open-source dev version is a 12B-parameter diffusion Transformer, and the capability the official team emphasizes most is character consistency—edit the same character over multiple rounds of iteration, and facial features and composition still remain stable.

This page walks you through the official FLUX Kontext workflow from start to finish: install the fp8 weight four-piece set, run the first round of instruction-based editing with the official template, then feed the result back round after round, experiencing iterative editing where "after three rounds of changes, the person is still the same person."

What You'll Be Able to Do After Learning ​

  • Run the official FLUX Kontext workflow: template loading → four-piece set in place → first round of instruction-based editing output
  • Do character-consistent editing with English prompts: change outfits, change backgrounds, without the face or pose drifting
  • Multi-round iterative editing: feed the previous round's result into the next round, and the character stays stable after several rounds of changes
  • Master dual-image references: stitch a character image + a style image to change the character's scene in a specified style
  • Remember Kontext's iron rules: English-only prompts, cfg 1, 20-step sampling

Your Current Struggles ​

  • You finally roll a character you like, want to change the outfit, and regenerate a new image—the face has changed
  • Forcing edits with image-to-image: turn the denoise strength up and the whole image drifts; turn it down and it's as if nothing changed
  • You've heard Kontext can "edit images with a single sentence," but you don't know which files to download in ComfyUI or how to connect the nodes

When to Use This Technique ​

When you need to:

  • Repeatedly polish the same character: change outfits, backgrounds, and poses while keeping the look and art style consistent
  • Instruction-based editing: state clearly in one sentence what to change, and keep everything else in the image as is
  • Style referencing: give a reference image and have the model generate a new scene in that style
  • Run a 12B open-source model locally without relying on cloud editing APIs

And you don't want to:

  • Re-roll every time you change one spot, with character consistency left entirely to luck
  • Paint bit by bit with a mask marking the area—that's the job of the next lesson, FLUX.1 Fill

🎒 Preparation Before Starting ​

  • You've completedFLUX.1 Text-to-Image: the four-piece set directory rules, cfg 1, and other FLUX family common knowledge are all in that lesson
  • You can load templates, write prompts, and run with Ctrl+Enter (if you've forgotten, review First Generation)
  • Reserve about 16.5GB of disk space: diffusion model 11.09GB + t5xxl fp8 version 4.8GB + clip_l 234.7MB + VAE 319.8MB (if you installed clip_l / t5xxl / ae in the previous lesson, reuse them directly; you only need to download the diffusion model)
  • ComfyUI updated to a relatively new version: this template requires 0.3.42 or above (it uses the subgraph feature)
  • Your network can reach Hugging Face; if the connection is unstable, use the ModelScope domestic mirror (address given in Step 2)
  • Prepare an image to edit—a portrait, product photo, or illustration all work; to align with the official examples, go ahead and download the official example image
  • A cup of water ☕—the biggest wait in this lesson is still downloading the model

Core Idea ​

Kontext is not the same as ordinary image-to-image. Ordinary image-to-image takes your image as a starting point and regenerates, with the extent of change controlled by the denoise strength—crank it up and the whole image drifts along. Kontext is a multimodal editing model: the official introduction describes it as "receiving text and image input simultaneously, understanding the image context, and then making precise edits"—it only touches the parts the instruction involves and leaves everything else untouched.

The four core capabilities the official team lists for the Kontext suite:

CapabilityDescription
Character consistencyPreserve the reference character or object in the image across multiple scenes and environments—features remain stable even after multiple rounds of editing
Precise editingChange only the specified elements without affecting the rest of the image
Style referencingGenerate new scenes from text prompts while preserving the distinctive style of the reference image
Interactive speedLow latency for generation and editing, well suited for back-and-forth iteration

Three versions; this page runs dev:

VersionPositioningUsage
FLUX.1 Kontext ProCommercial version, focused on fast iterative editingUses the Partner Nodes API in ComfyUI
FLUX.1 Kontext MaxExperimental version, stronger prompt adherenceSame as above, via API call
FLUX.1 Kontext Devopen-source version, 12B parameters, officially positioned for research useThis page: local deployment

Why doesn't the character drift off-model? Just look at the data flow—your image takes two paths before entering the KSampler:

Load Image ─→ ImageStitch (stitches when using two reference images) ─→ FluxKontextImageScale (scales to the preferred resolution)
                                              │
                                              └→ VAEEncode ─┬→ KSampler (latent_image: the starting canvas)
                                                             └→ ReferenceLatent ─→ FluxGuidance ─→ KSampler(positive)
CLIPTextEncode (English instruction) ──┬─→ ReferenceLatent (attaches the source image latent into the condition)
                            └─→ ConditioningZeroOut ─→ KSampler (negative: zeroed out)
UNETLoader (kontext model) ────────────────────────→ KSampler
KSampler ─→ VAEDecode ─→ Save Image

The key is ReferenceLatent (displayed in the node library as Set Reference Latent): it attaches the encoded latent of the source image into the positive condition, effectively telling the model "this is the image to reference—keep it consistent when making changes." The source code comments also state: when the model supports it, you can chain multiple ReferenceLatent nodes to reference several images at once—an idea used in step 6.

FluxKontextImageScale is a Kontext-specific preprocessor: the official node description is just one sentence—scale the image to a resolution that is "better for Flux Kontext." The actual logic (from the source code): based on the aspect ratio, pick the closest of 17 preferred resolutions, ranging from 672×1568 (portrait) to 1568×672 (landscape), with 1024×1024 right in the middle; total pixels are all around 1 MP.

Follow Along ​

Step 1: Load the official FLUX Kontext workflow template ​

Why: the official template already has the parameters, model download links, and a prompt-tips sticky note configured—you just need to swap in your own image and instruction to get it running.

How: open the template library from Templates in the left sidebar, search for Kontext, and pick "Flux Kontext Dev Image Edit" (template ID flux_kontext_dev_basic). If you'd rather not use the template library, download the JSON and open it via the menu Workflows → Open (Ctrl+O): flux_kontext_dev_basic.json. For the full walkthrough of the template library, see Template Library.

You should see: a compact three-node structure on the canvas—Load Image (referencing the official sample image flux_kontext_dev_basic_input_image.jpg) → a subgraph node named Image Edit (Flux.1 Kontext Dev) → Save Image. The subgraph node's surface directly exposes prompt, seed, and four model-file dropdowns. Next to it there is also a second Load Image bypassed by default, plus two sticky notes: one filled with model download links, and one with official prompt tips (used in step 4).

  • Template loaded successfully; the subgraph node and two sticky notes are visible on the canvas

Step 2: Download the Kontext dev four-file set and put them in place ​

Why: Kontext is an independently trained editing model—don't try to make do with the flux1-dev from the previous lesson; each of the four files must go in its proper place so the loader's dropdown lists can find them.

How: download the four files from Hugging Face (the template's sticky note has all the links):

FileSizeWhich subdirectory to put it inDownload
flux1-dev-kontext_fp8_scaled.safetensors11.09 GBmodels/diffusion_models/Hugging Face · ModelScope mirror
clip_l.safetensors234.7 MBmodels/text_encoders/Hugging Face
t5xxl_fp8_e4m3fn_scaled.safetensors (or t5xxl_fp16.safetensors)4.8 GB (fp16 version 9.12 GB)models/text_encoders/Hugging Face
ae.safetensors319.8 MBmodels/vae/Hugging Face · ModelScope mirror

The directory structure looks like this:

ComfyUI/
├── models/
│   ├── diffusion_models/
│   │   └── flux1-dev-kontext_fp8_scaled.safetensors
│   ├── text_encoders/
│   │   ├── clip_l.safetensors
│   │   └── t5xxl_fp8_e4m3fn_scaled.safetensors
│   └── vae/
│       └── ae.safetensors

💡 Can the files from the previous lesson be reused?

The three files clip_l, t5xxl, and ae are shared with FLUX.1 text-to-image—if you've already installed them, reuse them directly. Only the diffusion model must be newly downloaded: flux1-dev-kontext_fp8_scaled.safetensors is a Kontext-specific weight, a different file from the text-to-image flux1-dev.safetensors, and the two are not interchangeable. For downloads in China, use the ModelScope mirror (linked in the table above).

Once everything is in place, press r on the canvas to refresh, then select the corresponding files in the subgraph's four dropdowns (or double-click into the subgraph and select them in the loader nodes).

You should see: all the red missing-file warnings are gone, and the dropdowns show the correct file names.

  • All four files are in place, and the model dropdowns on the subgraph have the files selected

Step 3: Understand the node chain for Kontext image editing ​

Why: knowing where the image and the instruction converge and which parameters you can tweak gives you direction for tuning and troubleshooting later.

How: double-click the subgraph node to enter it, and check each node against this table:

NodeWhat it doesKey parameters in the template
UNETLoader (Load Diffusion Model)Loads the Kontext diffusion modelflux1-dev-kontext_fp8_scaled.safetensors
DualCLIPLoaderLoads both text encoders at onceFirst slot clip_l.safetensors, second slot t5xxl_fp8_e4m3fn_scaled.safetensors, type flux
VAELoader (Load VAE)Loads the VAEae.safetensors
ImageStitchWith two-image reference, stitch the second image to the rightSingle image passes through by default
FluxKontextImageScaleScale to Kontext preferred resolution17 tiers, about 1MP, snap to the nearest one proportionally
VAEEncodeEncode the image into a latent—
CLIPTextEncodeEncode the English instruction (positive conditioning)Output splits into two paths: zeroing out and attaching the reference
ReferenceLatentAttach the original image latent into the positive conditioningDisplay name Set Reference Latent
ConditioningZeroOutZero out the negative conditioningcfg 1, no negative prompt needed
FluxGuidanceFLUX-specific guidance strength2.5
KSamplerDenoising sampling20 steps, cfg 1, euler, simple, denoise 1.0
VAEDecode → SaveImageDecode and savefile prefix flux.1_kontext_dev, lands in ComfyUI/output/

The slot order of DualCLIPLoader follows the FLUX family recipe: first slot clip_l, second slot t5xxl, type set to flux (the source-code basis was covered in the previous lesson).

You should see: you can state each node's responsibility from left to right; you can point out that "the image takes two paths—one goes into KSampler as the starting canvas, one is attached into the conditioning as the reference".

  • I can state the role of ReferenceLatent and the key parameters of KSampler

Step 4: Write an English editing instruction and run the first round of image editing ​

Why: Kontext's input = image + instruction. The official tutorial states clearly: prompts support English only—the more specific the instruction, the more accurate the edit.

How to do it:

  1. Write the instruction in the subgraph's prompt box. The example that comes with the official template is a style-reference instruction:
text
Using this elegant style, create a portrait of a swan wearing a pearl tiara and lace collar, maintaining the same refined quality and soft color tones.
  1. To try the most basic single-point edit first, swap in the example from the official note: Change the car color to red
  2. Replace the Load Image node with your own image (or upload the official sample image)
  3. Click Run (called Queue in the old interface), or press Ctrl+Enter

Four principles for instructions (the "Core Principles" section of the official note):

PrincipleHow to do it
Be specific and clearUse precise descriptions, avoid vague references—write "the woman with short black hair", not just "she"
Edit in stepsBreak complex edits into multiple rounds of simple instructions—change the background first, then the action
Explicit preservationState explicitly what must not change: while maintaining the same facial features, hairstyle, and expression
Verb choiceUse change, replace, not transform (the latter tends to repaint the whole subject)

Four universal formulas (the "Best Practice Templates" section of the official note, replace the brackets with your content):

ScenarioFormula
Object modificationChange [object] to [new state], keep [content to preserve] unchanged
Style transferTransform to [specific style], while maintaining [composition/character] unchanged
Background replacementChange the background to [new background], keep the subject in the exact same position and pose
Text editingReplace '[original text]' with '[new text]', maintain the same font style

You should see: the progress bar runs through 20 steps, SaveImage produces the image—the elements mentioned in the instruction have changed, and the parts not mentioned stay as they were.

  • First round of image editing produced: the changed parts match the instruction, the rest of the image hasn't drifted

Step 5: Multi-round iteration—feed the previous round's result into the next round ​

Why: Iteration is Kontext's signature—the official introduction emphasizes that after multiple rounds of iterative editing, character features and composition remain stable. The essence of iteration is one sentence: the previous round's output is the next round's input.

How to do it:

Method A: Use the template's built-in Load Image and re-upload (simplest) ​

After the first round finishes, the result image is already saved in ComfyUI/output/. Re-upload it into the Load Image node (replacing the first round's input image), change the instruction, and press Ctrl+Enter again.

Method B: Switch to the Load Image(from output) node (the officially recommended way to iterate) ​

The official tutorial specifically introduced this node: it loads images from the output directory, making it more convenient to grab the previous round's result during multi-round editing. The node has a built-in refresh button—click it to update the file list and automatically select the first image. The node description in the source code says verbatim: "convenient for iteration".

How to do it: add a Load Image(from output) node (typing output image or previous generation in node search also finds it), connect its IMAGE output to the subgraph's image1 input, replacing the wire from the original Load Image.

Iteration rhythm (advice from the "Character Consistency" section of the official note): break complex edits into multiple rounds of simple instructions—change the background first, then the action. Raise only one change point per round, and keep writing the preservation clause.

You should see: the second round's input is the first round's output. After two rounds, the character's face, hairstyle, and expression are still the same person, and the composition hasn't drifted.

  • After two rounds of edits, the character is still the same person

Step 6: Two-image reference—character image plus style image (optional) ​

Why: If you want the character to appear in the style of another image, one reference image isn't enough—Kontext supports multi-image reference, and the template already has a second image-loading entry pre-built.

How to do it:

  1. Un-bypass the second Load Image node that is bypassed by default (switch it back to enabled) and upload the style reference image
  2. The ImageStitch in the subgraph will stitch the two images side by side into one, as a shared reference
  3. State clearly in the instruction what you want—the example bundled with the official template is exactly this usage: In this elegant style, create a portrait of a swan wearing a pearl headdress and a lace collar, while maintaining refined texture and soft tones

Want to reference more images? The sub-graph note offers another path: no stitching needed—encode each image separately with VAEEncode, then chain multiple latent conditions with ReferenceLatent (source comment: multiple reference images can be chained when the model supports it); customize the output size using the EmptySD3LatentImage node connected to KSampler's latent_image.

You should see: the output carries information from both references—the character comes from image A, the style from image B.

  • Dual-image reference working: character and style each taken as needed

Checkpoint ✅ ​

  • First round of instruction-based editing working: template + four model files + English instruction
  • After two or three consecutive iterations, the character's face and composition stay on track
  • Can explain ReferenceLatent's role: attach the original image's latent into the positive condition as a reference
  • Remember the iron rules: prompts in English only, cfg 1, 20 steps, guidance 2.5
  • (Optional) Dual-image reference working, character and style controlled separately

Pitfall reminders ​

❌ Writing prompts in Chinese ​

Reason: the official tutorial explicitly states that Kontext prompts support English only—the model doesn't understand Chinese instructions. Correct approach: first think through in Chinese what to change, then translate it into English for the prompt; "what to keep unchanged" must also be written in English.

❌ Replacing the whole person in one instruction ​

text
❌ Transform the person into a Viking
✅ Change the clothes to be a viking warrior while preserving facial features

Reason: words like transform make the model repaint the entire subject, and the character's features drift accordingly—this is a typical error example in the official notes. Correct approach: use change/replace to specify which item to change, then add a sentence preserving the features.

❌ The person shifts position when changing the background ​

text
❌ Put him on a beach
✅ Change the background to a beach while keeping the person in the exact same position, scale, and pose

Reason: without writing "position, scale, pose unchanged," the model interprets it as recomposing the image. Correct approach: follow the background replacement formula and write out the full set of three preservation phrases (position, scale, pose).

❌ Using flux1-dev.safetensors as Kontext ​

Reason: flux1-dev is the text-to-image weight, while flux1-dev-kontext is the editing weight—the two files are not interchangeable; if the file is placed in the wrong subdirectory, the loader won't find it. Correct approach: download and place the files per the table in step 2; if it still can't be found, see model loading failure.

Advanced tips (optional) ​

🔧 Three ways to write style transfer instructions (official note's "style transfer" section, combinable): name the style explicitly—Transform to Bauhaus art style; describe the style's characteristics—Transform to oil painting with visible brushstrokes, thick paint texture; preserve the composition—Change to Bauhaus style while maintaining the original composition.

🔧 Text in images can be edited too: wrap the original and new text in quotes—Replace 'joy' with 'BFL', then add maintaining the same font style to keep the font unchanged (official note's "text editing" section).

🔧 Want the original weights: the template uses the fp8_scaled quantized package from the official release; for the original weights, the official Tip points the way—get them from the relevant Black Forest Labs repository.

🔧 How to choose an editing route: for whole-image instruction-based editing, use this lesson's Kontext; for masked local inpainting and outpainting, use the next lesson's FLUX.1 Fill; for multi-reference consistency, go with FLUX.2 and FLUX.3 Klein; to edit images with Chinese instructions, see Qwen-Image-Edit and Qwen-Image-2.1.

Lesson summary ​

✅ FLUX Kontext workflow up and running: load template → place the four model files → English instruction → image output at 20 steps.

✅ Both pillars of character consistency mastered: structurally, ReferenceLatent attaches the original image into the condition; instructionally, rely on "change/replace + explicit preservation + step-by-step iteration".

✅ Feeding images across multiple iterations: output becomes input; use the Load Image(from output) node to pull images from the output directory, avoiding repeated uploads.

✅ Iron rules memorized: prompts in English only, cfg 1, 20 steps euler/simple, guidance 2.5.

Key configuration recap:

ConfigurationRecommended valueNotes
Diffusion modelflux1-dev-kontext_fp8_scaled.safetensors (11.09 GB)Place in models/diffusion_models/; note the filename contains kontext
Text encodersclip_l.safetensors + t5xxl_fp8_e4m3fn_scaled.safetensors (4.8 GB)Place in models/text_encoders/; with ample VRAM you can switch to t5xxl_fp16.safetensors (9.12 GB)
VAEae.safetensors (319.8 MB)Place in models/vae/; shared with FLUX.1 text-to-image
DualCLIPLoaderFirst slot clip_l, second slot t5xxl, type fluxFLUX family recipe
KSampler20 steps, cfg 1, euler, simple, denoise 1.0Official template configuration
FluxGuidance2.5Official template default
PromptEnglish only; change/replace + preservation phrasesOfficially stated to support English only
Save prefixflux.1_kontext_devOutput goes to ComfyUI/output/, pull images from here when iterating

Next lesson preview ​

Kontext is instruction-based editing over the "whole image range"; the next lesson's FLUX.1 Fill focuses on the "masked range": change only what the mask covers. Next lesson: FLUX.1 Fill: local inpainting and outpainting.

You will learn:

  • FLUX.1 Fill model download and deployment
  • Inpainting: use a mask to define the area and only change the content within the selection
  • Outpainting: extend the image boundaries outward, turning a square image into a landscape one
  • Division of labor between Fill and Kontext: use Fill for local edits, and Kontext for whole-image instruction-based editing
gaodong.aiAboutPrivacyContact

Independent tutorials, not affiliated with any product mentioned. Product names and trademarks belong to their owners. Check official pages for prices and policies.