Fat Mex Image Edit Sampler
Tell Qwen-Image-Edit what to change. That's the whole workflow.
- model
- clip
- vae
- image1
- image2
- image3
- images
- latent
The old way of editing an image - paint a mask, hope the inpaint holds, re-roll forever - has mostly been replaced by telling a model what to change in a sentence. This node is that workflow, collapsed into one box: reference images in, an edit described in plain English, an edited image out.
It wraps the entire Qwen Image Edit stack - TextEncodeQwenImageEditPlus + EmptyQwenImageLayeredLatentImage + KSampler + VAEDecode - which is exactly why it's fiddly to build by hand and why you'd rather have it as a single node. Qwen-Image-Edit is the default open instruction editor of this era (Apache 2.0, no Kontext-style content policing), and it handles object removal, garment swaps, relighting, re-posing, and face edits from a sentence, no mask and no ControlNet.
How it works
Under the hood it replicates TextEncodeQwenImageEditPlus conditioning. Each reference image gets two jobs:
- A small 384×384 version goes into the vision-language encoder, so the Qwen2.5-VL text encoder actually sees the picture and understands "image 1" when you say it.
- A ~1MP reference latent is attached as identity conditioning, so the model has real pixel-level information about the subject, not just a fuzzy thumbnail.
It then builds the Qwen layered latent - a 5D tensor with layers + 1 layers, one per reference plus the output - samples, decodes, and keeps only the final layer (the intermediate ones are internal reconstruction passes).
The inputs that matter
prompt- describe the edit and refer to your references as "image 1", "image 2", "image 3". That's the contract:image1is "image 1" in the prompt.image1/image2/image3- the references. One is often enough; three lets the model compose (subject + outfit + scene, for example).layers- the Qwen layered-latent depth, default 3, "usually = number of images." If you use two references, 2-3 layers is right.model,clip,vae- from the Fat Mex Model Loader, and here's the catch: load a Qwen Image Edit preset (2509 or 2511), not Klein.width/height- output size;steps,cfg,preset_hintbehave like the other samplers (0 / auto = preset defaults).
Outputs: images (the edit) and latent.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/FatMex/ComfyUI-FatMex-Nodes.git FatMex-Nodes
pip install -r FatMex-Nodes/requirements.txt
Or ComfyUI Manager → search "Fat Mex Nodes" → Install → restart. You'll also need the Qwen Image Edit model files in your ComfyUI/models/ folders (the loader presets name them exactly).
Where people get burned
- Wrong model loaded. If you loaded a Klein or Z-Image preset, this node is sampling with an architecture that doesn't do layered Qwen editing. The model, clip, and vae inputs expect the Qwen Edit trio. This is the #1 cause of garbage output here.
- Prompt says "image 2" but no
image2is connected. Referencing a picture you didn't wire in just confuses the encoder. Keep prompt references and connected inputs in sync. - It edits the whole canvas. Like all instruction editors, Qwen-Image-Edit takes the context and emits a new image - regions you didn't mention will drift slightly. For surgical, mask-locked changes you want the classic mask route; for "change the shirt / add sunglasses / different background," this is the right tool and the KB says most of the community moved to it.
- Negative prompt is real here. Unlike the pack's inpaint variant (which zeroes the negative for quality), this node actually encodes your negative text - but on Qwen Edit models it's a light touch, so don't rely on it for structural fixes.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | Model from Fat Mex Model Loader (Qwen Edit preset). | |
| clip | CLIP | CLIP from Fat Mex Model Loader. | |
| vae | VAE | VAE from Fat Mex Model Loader. | |
| prompt | STRING | Describe the edit. Reference images as 'image 1', 'image 2', etc. | |
| negative_prompt | STRING | ugly, blurry, deformed, bad anatomy, low quality | What to avoid. |
| seed | INT | 00–18446744073709550000 | — |
| image1opt | IMAGE | Reference image 1 (e.g. the face to use). | |
| image2opt | IMAGE | Reference image 2 (optional). | |
| image3opt | IMAGE | Reference image 3 (optional). | |
| preset_hintopt | COMBO | auto | 8 options: auto, Klein 9B, Klein 9B True, Qwen Image Edit 2509, Qwen Image Edit 2511, Qwen Image 2512, +2 |
| stepsopt | INT | 00–100 | Override steps (0 = preset). |
| cfgopt | FLOAT | 0.00–100 | — |
| sampler_nameopt | COMBO | auto | 45 options: auto, euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, +39 |
| scheduleropt | COMBO | auto | 10 options: auto, simple, sgm_uniform, karras, exponential, ddim_uniform, +4 |
| widthopt | INT | 102464–16384 | Output width. |
| heightopt | INT | 102464–16384 | Output height. |
| layersopt | INT | 30–16 | Qwen layered latent layers (usually = number of images). |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| latent | LATENT | — |