Nodes/Emu35-Comfyui-Nodes/Emu 3.5 X2I (Image Edit)
ComfyUI Node

Emu 3.5 X2I (Image Edit)

Image editing without a diffusion model, up to 3 reference images

By EricRollei·Created 9 months ago·Updated 9 months ago· 5
Emu 3.5 X2I (Image Edit)
  • model
  • tokenizer
  • vq_model
  • reference_image_1
  • reference_image_2
  • reference_image_3
  • image
  • text_response
  • reasoning
promptTransform this image into a watercolor painting style
image_area512x512 (262144) - Recommended
cfg_scale2.0
seed0
image_top_k5120
image_temperature1.0
tiled_decodefalse
tile_size32

Emu 3.5 X2I is the pack's image-editing node, and it's a genuinely different approach to editing than you're used to from diffusion. Where an img2img workflow denoises a latent toward a prompt, X2I works because Emu is a native multimodal model: your reference image is encoded into visual tokens through the vision tokenizer and dropped into the prompt stream itself, then the model autoregressively generates the edited result, token by token. It's a "the model literally reads the image and redraws it" mechanism rather than a "perturb and denoise" one.

That matters for how you prompt it. This isn't a controlnet setup with weights and strength sliders - the model genuinely understands what's in your reference, so you describe the transformation in plain language: "change the background to a beach sunset", "add sunglasses to the person", "transform this into an oil painting". The pack's own tip: keep instructions detailed, and with multiple images, reference them positionally - "replace the dog in the first image with the cat from the second image".

The inputs that matter

  • prompt - the edit instruction. Short prompts get a console warning; be specific.
  • reference_image_1 - required IMAGE. Reference 2 and 3 are optional, and this is the unique trick - multi-image editing lets you move a subject from one photo into another.
  • image_area - token resolution for encoding references: 256x256 (fastest) through 1024x1024 (high VRAM), default 512x512 - Recommended. This is your main OOM lever: each reference image at 1024 consumes ~4,000 tokens of context, and the node warns you when the estimate gets dangerous.
  • cfg_scale - default 2.0, and the README's advice is real: X2I likes lower guidance than T2I. 2–3 works well; pushing toward 5 tends to fight the reference.
  • seed - fixed for reproducibility.

Optional image_top_k / image_temperature control visual-token sampling, and tiled_decode / tile_size decode the output in tiles to save VRAM on big results.

Outputs

  • image (IMAGE) - the edited result.
  • text_response (STRING) - any text the model emitted.
  • reasoning (STRING) - chain-of-thought when present.

Install

cd ComfyUI/custom_nodes
git clone --recursive https://github.com/EricRollei/Emu35-Comfyui-Nodes.git emu35
cd emu35
pip install -r requirements.txt

Models in ComfyUI/models/emu35/ - use the Emu3.5-Image model (34B) for X2I, plus the vision tokenizer; NF4 quantized weights are the 24GB route.

What to know before you commit

Two things. First, there was a notorious early bug where X2I generated a single token and stopped - the stopping criteria fired on reference-image tokens in the input. V2 fixed it by making the stopping criteria ignore input tokens, so if you ever see a one-pixel "output", you're on old code; update the pack. Second, VRAM is the real ceiling: 2+ reference images at 1024x1024 will OOM a 24GB card even with NF4. The working pattern there is smaller image_area, tiled_decode on, and the same ComfyUI --lowvram / --reserved-vram tuning people use for T2I. And pace yourself - a single X2I edit runs about 13 minutes on the hardware the pack was tested on.

CategoryEmu3.5

Inputs (14)

NameTypeDefaultDescription
modelEMU_MODEL
tokenizerEMU_TOKENIZER
vq_modelEMU_VQ
promptSTRINGTransform this image into a watercolor painting style
reference_image_1IMAGE
image_areaCOMBO512x512 (262144) - Recommended6 options: 256x256 (65536) - Fastest, 384x384 (147456), 512x512 (262144) - Recommended, 640x640 (409600), 768x768 (589824), 1024x1024 (1048576) - High VRAM
cfg_scaleFLOAT2.01–20
seedINT00–18446744073709550000
reference_image_2optIMAGE
reference_image_3optIMAGE
image_top_koptINT5120100–131072
image_temperatureoptFLOAT1.00.1–2
tiled_decodeoptBOOLEANfalse
tile_sizeoptINT3216–64

Outputs (3)

NameTypeDescription
imageIMAGE
text_responseSTRING
reasoningSTRING