Instruction-Based Image Editing Without a Single Mask
For two years, "editing" an AI image meant fighting with inpainting masks, ControlNet stacks, and prompt gymnastics just to change the color of a shirt. FLUX.1 Kontext changes the interaction model entirely: you give it an image and a plain-language instruction — "make the car red," "put the subject in a snowy forest," "remove the person on the left" — and it returns an edited image that keeps everything else consistent. No mask, no second model.
This post covers what Kontext is, how to wire it up in ComfyUI, and how to get reliable edits instead of full regenerations.
Why Kontext Is Different
Kontext, from Black Forest Labs (the FLUX team), is an in-context image editing model. Instead of denoising from pure noise guided only by text, it conditions generation on an existing image plus an instruction, so it understands both "what is here" and "what should change."
The practical wins for developers and creators:
Character and product consistency across edits. You can iterate — edit the output, edit that output again — and the subject's identity holds far better than a text-to-image reroll.
Local, targeted changes without hand-painting a mask. The model infers the region from your instruction.
Style and relighting transforms ("make it look like a watercolor," "change to golden-hour lighting") that preserve composition.
The open-weights FLUX.1 Kontext [dev] variant is the one you run locally in ComfyUI; the hosted [pro]/[max] tiers live behind the BFL API. Check the license terms before commercial use — the [dev] weights ship under BFL's non-commercial community license.
Installing and Loading Kontext
Update ComfyUI. Kontext support is native in current builds; older versions lack the reference-conditioning nodes.
Download the weights. Place the Kontext [dev] diffusion model in ComfyUI/models/diffusion_models/. For 12–16 GB cards, grab the FP8 version; a GGUF quant exists for tighter budgets.
Text encoders. Kontext uses the standard FLUX pair — clip_l and t5xxl (FP8 t5 is fine) — in ComfyUI/models/text_encoders/.
VAE. The usual FLUX ae.safetensors in ComfyUI/models/vae/.
The quickest way in is the built-in template: Workflow > Browse Templates > FLUX Kontext.
The Node Graph
At its core the graph looks like a normal FLUX text-to-image workflow with one addition: your source image is encoded and injected as reference conditioning.
Load Image > VAE Encode to turn your source into a latent reference.
Load Diffusion Model (Kontext) + DualCLIPLoader (type flux) + VAE Loader.
CLIP Text Encode holds your instruction, not a full description. Feed it into the reference-conditioning node (in current builds, a ReferenceLatent / Kontext conditioning node) alongside the encoded source image.
KSampler > VAE Decode > Save Image.
Sampler Settings That Work
Steps: 20–28. Kontext is not a Turbo model; too few steps leave edits half-applied.
CFG / guidance: FLUX uses a distilled guidance value — start around 2.5–3.5. Higher pushes the edit harder but can drift from the source.
Sampler/scheduler: euler + simple or beta are reliable starting points.
Denoise: keep it at 1.0 — Kontext's consistency comes from reference conditioning, not from a partial-denoise trick. Lowering denoise here is a common mistake that weakens edits.
Writing Good Edit Instructions
Kontext rewards specific, single-change instructions and punishes vague ones.
Say what changes and what stays: "Change the jacket to bright yellow, keep the same pose and background."
One edit per pass. Chaining "make it night, add rain, and change her hair" produces compromises. Run three passes instead; each output feeds the next.
For text edits, quote the exact string: Replace the sign text with "OPEN 24/7".
To preserve identity, add "keep the same face and features" — it measurably reduces drift.
Avoid describing the whole scene from scratch; that nudges the model toward a regeneration rather than an edit.
Optimization Tips
VRAM: FP8 fits comfortably in 16 GB; the GGUF Q4/Q5 quants run on 8–12 GB with a modest quality cost. Add --lowvram if you hit OOM during VAE decode.
Speed: a FLUX Turbo/Hyper LoRA can cut steps to ~8 for quick previews — lock your composition on previews, then do a full-step final pass for clean edges.
Multi-reference: current Kontext workflows support chaining more than one reference image (e.g., a subject plus a style reference). Encode each and combine in the conditioning stage.
Batch consistency: fix the seed when producing a series so unrelated regions stay stable frame to frame.
Conclusion
Kontext collapses a whole category of masking-and-ControlNet busywork into a sentence. For product shots, character work, and rapid concept iteration it is the most practical open editing model available to run locally right now. Start with single, explicit instructions, keep denoise at 1.0, and treat editing as a chain of small passes rather than one big prompt — that is where the consistency that makes Kontext special actually shows up.
Downloadable Workflow & References
|


0 Comments