Nodes/ICEdit-ComfyUI-official/InContextEditInstruction~
ComfyUI Node

InContextEditInstruction~

Type the edit, skip the preamble

By hayd-zju·Created about a year ago·Updated about a year ago· 209
InContextEditInstruction~
  • clip
  • In_context
editText

This is the node you actually talk to. InContextEditInstruction takes your edit instruction and a CLIP model, and returns the conditioning that tells the ICEdit framework what to change. Everything else in this pack - DiptychCreate building the side-by-side canvas, ICEFConditioning wiring it into the sampler - is the how.

What makes this node worth reading about is what it hides from you. ICEdit's whole prompt format is a fixed template: "A diptych with two side-by-side images of the same scene. On the right, the scene is the same as on the left but [your instruction]." You never type that. The node wraps your words in it automatically, then tokenizes and encodes the whole thing with your Flux CLIP. A note in the bundled workflow says it outright: "there is no need to enter it repeatedly. Just enter the editing instructions directly." So the interface you see is a plain text box, and the machinery does the templating.

Inputs and output

Two inputs, both required, both obvious:

  • editText (STRING, multiline) - your edit instruction. The author's own tooltip: "Your edit instruction." Keep it natural language - Flux runs on the T5 encoder and rewards full sentences, not tag soup.
  • clip (CLIP) - the text encoder pair. In the official workflow that's a DualCLIPLoader set to flux mode with t5xxl_fp16.safetensors + clip_l.safetensors.

One output: In_context (CONDITIONING), described by the author as "a conditioning containing the embedded text used to guide the diffusion model." It feeds the In_context input of ICEFConditioning, which combines it with the diptych and the VAE. Nothing else to wire - this is a deliberately thin node.

Installing it

It ships in the ICEdit-ComfyUI-official pack, the official ComfyUI integration of the ICEdit research project from Zhejiang University (upstream: River-Zhang/ICEdit). Install via ComfyUI Manager - search "ICEdit" - or:

cd ComfyUI/custom_nodes
git clone https://github.com/hayd-zju/ICEdit-ComfyUI-official.git

Restart ComfyUI and the three ~-suffixed nodes appear under "In-context_Editing_Framework". The pack has no Python dependencies of its own, though the README wants ComfyUI_essentials and ComfyUI-Easy-Use installed for the bundled example workflows. You'll also need the shared model stack: Flux.1 Fill dev, the ICEdit LoRA, the FLUX VAE, and the T5/CLIP text encoders - auto-downloaded from HuggingFace if you can reach it.

Writing instructions that work

ICEdit was released in May 2025 with a real claim attached - instruction-based editing using roughly 0.5% of the training data and 1% of the parameters of prior SOTA - and it's best at the classic three jobs: deleting something, adding something, or changing an attribute ("remove the bottle," "add a neon sign," "make her hair dark green and her clothes checked"). Phrase the edit as a change to what's already there: because the left panel is your untouched original, the model understands "same scene, but…" natively. Vague instructions get you a timid edit; specific ones get you a real one.

Common issues

If your edit comes back with nothing changed, two usual suspects. First, the sampler: with add_noise disabled in KSamplerAdvanced the right half tends to come out blurry or untouched - keep it enabled, which is how the shipped workflow runs. Second, the prompt itself: "make it better" won't do anything; name the change. People also swap the stock clip_l.safetensors for a beefier CLIP-L (the zer0int GmP variants are a known community upgrade) when edits come out weak, and there's a separate ICEdit-MoE LoRA on HuggingFace that some users reach for when the normal LoRA gives them no-ops. One last thing: don't feed the clip from a checkpoint loader expecting it to work - this needs the Flux dual text encoder.

CategoryIn-context_Editing_Framework

Inputs (2)

NameTypeDefaultDescription
editTextSTRINGYour edit instruction.
clipCLIPThe CLIP model used for encoding the text.

Outputs (1)

NameTypeDescription
In_contextCONDITIONINGA conditioning containing the embedded text used to guide the diffusion model.