TextEncodeMageFlowEdit
Type the edit, point at the image, and let the model do the Photoshopping
- clip
- images
- vae
- positive
- negative
- latent
Mage-Flow-Edit is Microsoft's instruction-based image editor, and with the July 2026 core release ComfyUI speaks it natively. The workflow is the modern version of "make it a dragon": you give it one or more reference images and a plain-English instruction, and this node turns that pair into the conditioning plus the starting latent that a normal sampler denoises. It sits in the same family as TextEncodeQwenImageEdit and the other *Edit encoders - the idea being that the model understands an instruction, not just a caption.
What it does
Think of it as a text-encode node with attachments. It does four things in one pass:
- Tokenizes your prompt (the edit instruction) and negative_prompt through the Mage-Flow CLIP, a Qwen3-VL-4B text encoder.
- VAE-encodes every reference image into "reference latents" and staples them onto the conditioning. The negative branch carries the same reference images - only the instruction differs - so the model knows what not to change.
- Resizes all references to the output resolution first. That's not cosmetic: Mage's RoPE aligns reference and target content by position, so if references and output don't match in size, the alignment is off.
- Hands you a ready-made latent to sample - which brings us to the one tip that matters most.
The input that decides your resolution
width and height default to 0, which means "use the first reference image's size", floored to a multiple of 16. Set them explicitly and every reference gets resized to that. Either way, use the node's latent output for sampling - that's the whole reason it exists. Roll your own empty latent at a different size and the conditioning and latent won't line up, and you'll chase subtle misalignment artifacts for an hour.
The rest of the inputs are quick: images is an autogrow slot that takes up to 16 references, batch_size controls how many results you sample at once, and vae is technically optional but you want it - it's what encodes the references into those latent blocks.
Outputs
positiveandnegativeCONDITIONING → samplerlatent→ sampler's latent input
How you get it
Ships with ComfyUI core since July 2026. The node loads nothing itself - feed it the clip and vae from the Mage-Flow checkpoint you load (Microsoft's weights; the edit variant is the one this node is built for).
Gotchas
- The instruction is the whole game. Prompt it like you're talking to a person: "make it night, keep the composition." Keep the negative prompt short; it's doing the same instruction job with references attached.
- Safety filters. Some Mage-Flow builds ship with a filter that blanks outputs on recognizable people - it's a known community complaint about the model, not a sign your prompt is broken.
- Size mismatch = artifacts. Always sample the node's own latent.
This is the node to reach for when you want "change this thing in this picture" without redrawing the whole image or fighting an inpaint mask. Point, type, sample.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| prompt | STRING | — | |
| negative_prompt | STRING | — | |
| images | COMFY_AUTOGROW_V3 | Reference image(s) to edit. All references are resized to the output resolution before encoding. | |
| width | INT | 00–8192 | Output width. 0 = use the first reference image's size. |
| height | INT | 00–8192 | Output height. 0 = use the first reference image's size. |
| batch_size | INT | 11–4096 | — |
| vaeopt | VAE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |
| latent | LATENT | — |