Nodes/FiL_Design_ImageMind/🎯 Edit Encoder
ComfyUI Node

🎯 Edit Encoder

One node where core FLUX.2 editing wants six

By FiL-Design-Ai·Created 2 months ago·Updated 2 days ago· 3
🎯 Edit Encoder
  • clip
  • vae
  • images
  • mask
  • conditioning
  • summary
  • references
  • latent
prompt
system_presetnone
reference_modevision
reference_treatmentnormal
reference_latents_methodindex_timestep_zero
reference_cards
system_prompt
treatment_per_reference
reference_strength1.00
vision_megapixels0.15
latent_megapixels1.00
prompt_strength1.00

If you've ever hand-built an edit workflow for a FLUX.2-family model, you know the drill: for every reference image you chain ImageScaleToTotalPixels → VAEEncode → ReferenceLatent, plus a separate CLIPTextEncode for the prompt, and you keep all those wires straight across ten images. FiL Edit Encoder replaces that whole scattered chain with one node: prompt plus as many reference images as you can feed it in, one CONDITIONING out, ready for the sampler. It targets the instruction-edit family that runs on vision-language text encoders - Krea 2, Klein, FLUX.2 Dev, and the Kontext-lineage models that read reference_latents the FLUX.2 way.

This family edits the way it does because the text encoder is a vision-language model (Qwen3-VL on Krea 2, Mistral-3 on FLUX.2) - a "CLIP" node here isn't just reading your words, it can look at pictures. That's the whole game.

Two channels, one decision

The most important knob on this node is reference_mode, because it picks which half of the model receives your references, and they produce visibly different results:

  • vision (default) - the reference goes to the text encoder, which looks at it without putting anything into the frame. Nothing of your source image gets baked into the canvas. This is Krea 2's native behaviour and the mode the node is aimed at.
  • latents - the reference is VAE-encoded and concatenated into the frame's own tokens, which is the FLUX.2/Kontext behaviour. This is what tiles the source into the output - you're re-denoising on top of the picture.
  • both - only sensible if the model was trained for it; measured on Krea 2 it edits correctly but shows the reference bleeding through as a mosaic.

The trap people fall into: they expect Kontext-style "paste my photo in and repaint it" and leave it on vision, then wonder why the output ignores the source layout - or the reverse, they get their source tiled into the frame when they only wanted it read. Decide which you want first, then set the mode.

The inputs and outputs that matter

For a first working graph you set four things: clip (the edit model's text encoder - wire the CLIP socket from your model's loader), prompt (the edit instruction: "keep the pose, change her dress to red"), images (auto-growing reference slots), and reference_mode. vae is only required when reference_mode uses latents or when you wire a mask - if you forget it, the node raises a clear error telling you exactly that, rather than failing mysteriously in the sampler.

Outputs: conditioning feeds the sampler's positive input. latent is the first reference VAE-encoded - the thing you sample on top of, carrying your mask aligned when one is wired. references shows the prepared copies the model actually received (wire a Preview Image to see what it read - great for debugging). summary is plain text describing what the run did with each reference, and it flags settings that look like bugs but aren't.

The deeper controls - per-reference reference_cards as JSON roles ([{"role": "style"}] washes that picture to a colour field so there's no subject left to copy), vision_megapixels (0.15 is core's value; push toward 1 MP to hold structure and detail at the cost of tokens), and prompt_strength (cross-fades how loudly the written instruction speaks against the pictures) - are for when the default "use it as-is" isn't cutting it. Each reference you add grows VRAM and sampling time, so the auto-growing image list isn't a licence to dump your whole folder into it.

Installing FiL_Design_ImageMind

The pack needs ComfyUI 0.3.60+ (V3 node API). ComfyUI Manager → search FiL_Design_ImageMind → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/FiL-Design-Ai/FiL_Design_ImageMind.git
pip install -r FiL_Design_ImageMind/requirements.txt

Windows portable installs: run install_requirements.bat. Dependencies are light (requests, aiohttp, PyYAML, Pillow, numpy, pydantic), no model downloads, no API keys - this node is pure conditioning work and doesn't touch the pack's LLM-provider side at all. The nodes appear under the 🎨 FiL Design menu.

Troubleshooting

  • A clear error about vae - you're in latents/both mode or you wired a mask without the VAE. Wire the edit model's VAE (or switch to vision).
  • The source image is baked into the result - you're in latents; that's what it does. Drop to vision if you only wanted the model to study it.
  • Mosaic/bleed-through with both on Krea 2 - expected and measured; use vision.
  • Reference looks too loosely held - raise vision_megapixels toward 1.0 MP; the default 0.15 keeps the subject only loosely by design.
  • Nothing changed or something odd happened - read the summary output and preview references; the node tells you what it actually did with each picture, and it's almost always a mode misunderstanding rather than a bug.

The pack is young, small and MIT-licensed - file issues upstream if a run misbehaves.

Category🎨 FiL Design/🔗 Conditioning

Inputs (16)

NameTypeDefaultDescription
clipCLIPText encoder of the edit model (e.g. Qwen3-VL for FLUX.2/Krea2).
promptSTRINGEdit instruction: what to change, keep, or compose from the references.
system_presetCOMBOnoneRole sent to the text encoder. 'none' for a prompt that gives an instruction ('change X, keep Y') — it is followed most closely that way. 'use reference' for a prompt that only describes a style, which otherwise leaves the model no reason to look at the reference. On 'none' the system_prompt field below supplies a role of your own, if you type one.
reference_modeCOMBOvisionHow references reach the model. 'vision': the text encoder looks at them, nothing enters the frame (Krea 2). 'latents': VAE-encoded into the frame itself (FLUX.2/Kontext) — this is what tiles the source into the output. 'both': both channels.
reference_treatmentCOMBOnormalWhat to do to each reference before the text encoder looks at it. The blurs and 'palette wash' strip detail the model should not copy. Applies to every reference that was not given a role — a role brings its own treatment. Never touches the copy the VAE encodes.
reference_latents_methodCOMBOindex_timestep_zeroOnly used when reference_mode sends latents. On Krea 2 every value behaves the same except index_timestep_zero.
vaeoptVAEVAE of the edit model. Only needed when reference_mode uses latents.
imagesoptCOMFY_AUTOGROW_V3Reference images to edit from. Each adds its latent to the conditioning — VRAM and sampling time grow with every one.
maskoptMASKEdit only this area of the FIRST reference. The node returns that reference as a latent with the mask aligned to it, so the sampler re-denoises the marked part and leaves the rest. Needs the VAE wired.
reference_cardsoptSTRINGA job for each reference, in slot order, as JSON: [{"role": "subject"}, {"role": "style"}]. The role decides what the model takes from that picture and brings the treatment that makes it true — 'style' washes the reference to a colour field so there is no subject left to copy. Add "treatment" to a card to override that. Empty means every reference is used as it is.
system_promptoptSTRINGYour own role text. Used whenever system_preset is 'none' and this field is not empty.
treatment_per_referenceoptSTRINGOverride the treatment for each reference separately: names in slot order, comma separated, e.g. 'normal, palette wash'. Fewer names than references repeats the last one. Empty uses the treatment above for all of them.
reference_strengthoptFLOAT1.000–3How hard the references pull on the text encoder. 1.0 is the plain encode and costs nothing; anything else encodes a second time against blank references and interpolates, so 0 ignores them and above 1 exaggerates them. No effect in reference_mode 'latents'.
vision_megapixelsoptFLOAT0.150.01–4Size of the copy the text encoder reads. This is the dial for holding a reference more closely: measured on Krea 2, 0.15 MP keeps the subject only loosely while 1.0 MP holds its structure and detail. 0.15 (~384x384) is core's value and stays the default because raising it changes every saved workflow's output.
latent_megapixelsoptFLOAT1.000.1–4Cap for the copy the VAE encodes, when reference_mode uses latents.
prompt_strengthoptFLOAT1.000–2How loudly the written instruction speaks against the pictures. 1 is as written and costs nothing. Below 1 the references decide more and the text less; 0 is what the model takes from the pictures alone. Above 1 pushes the instruction harder. Anything but 1 encodes a second time with the instruction silenced.

Outputs (4)

NameTypeDescription
conditioningCONDITIONINGPrompt conditioning carrying every reference latent — feed the sampler's positive input.
summarySTRINGWhat this run did with the references, and a note when a setting looks like a bug but is not.
referencesIMAGEThe prepared copies the model actually received — the text encoder's in 'vision' and 'both', the VAE's in 'latents'. Wire a Preview Image here to see what it read.
latentLATENTThe first reference, VAE-encoded, to sample on top of — carrying the mask when one is wired. Empty unless the VAE encoded it.