Nodes/ComfyUI_MiraSubPack/Text Encode QwenImage Edit Plus Mira
ComfyUI Node

Text Encode QwenImage Edit Plus Mira

Multi-image QwenImage-Edit encoding, with the reference-latent knobs the pros use

By mirabarukaso·Created 8 months ago·Updated 2 months ago· 0
Text Encode QwenImage Edit Plus Mira
  • clip
  • vae
  • image1
  • image2
  • image3
  • image4
  • target_latent
  • CONDITIONING
system_promptDescribe key details of the input image (including any objects, characters, poses, facial features, clothing, setting, textures and style), then explain how the user's text instruction should alter, modify or recreate the image. Generate a new image that meets the user's requirements, which can vary from a small change to a completely new image using inputs as a guide.
prompt
crop_methoddisabled
vl_image_size512
reference_latents_methodnone
reference_latents_size1024

The plain TextEncodeQwenImageEdit node in this pack handles the basic "one image, one instruction" case. This Plus variant is the version you reach for when QwenImage-Edit's newer multi-image tricks come into play - up to four reference images, a custom system prompt, and - this is the part the pros care about - explicit control over how the reference latents get injected into the sampling.

That last bit is the actual payoff. QwenImage-Edit guides generation through reference_latents, and how those latents are attached to the denoising steps changes the result meaningfully. This node exposes that as the reference_latents_method dropdown:

  • none - stock behavior, just embed the latents.
  • offset - samples the reference latents at (main timestep ± offset), so the reference guidance moves with denoising progress.
  • index - reads reference latents at a fixed absolute timestep, independent of the main steps. Stable, static influence.
  • uxo/uno - injects the reference in feature space rather than by timestep; uxo pushes deeper/stronger, uno stays lighter.
  • index_timestep_zero - always uses the reference at timestep 0, shaping global structure and noise distribution like a prior.

If that reads like a menu of arcane choices, you're not wrong - for most edits none is fine and you can ignore the whole thing. But if you're fighting a specific artifact (edits drifting off-composition, reference influence fading halfway through), this is where the fix lives.

The other inputs

  • clip - required QwenImage CLIP.
  • system_prompt - default gives the model its job description ("Describe key details of the input image... then explain how the user's text instruction should alter it"). Edit it to push the model's behavior.
  • prompt - your edit instruction, multiline.
  • image1–image4 (optional) - up to four reference images, for the person+product, multi-angle, and composition jobs QwenImage-Edit 2509 supports.
  • vae (optional) - needed to build reference latents from the images.
  • crop_method - disabled or center. Whether to center-crop refs to square-ish VL size.
  • vl_image_size - the resolution the vision-language side sees each image at (default 512). Smaller = faster, less accurate.
  • target_latent (optional) - supply your own target latent and the refs are scaled to match it.
  • reference_latents_size - the resolution reference latents are built at (default 1024). This is the one that affects quality; the model's edits respect it more than vl_image_size.

How it works

Same family as the basic node, but it builds a proper Qwen chat template (<|im_start|>system...), attaches a Picture N: token for each supplied image, encodes them all for the VLM, then VAE-encodes each reference into latents and appends them to the conditioning - optionally with one of the injection methods above. Output is a single CONDITIONING.

Install

Same pack, same story:

cd ComfyUI/custom_nodes
git clone https://github.com/mirabarukaso/ComfyUI_MiraSubPack

or Manager → "MiraSubPack", restart. No extra dependencies.

One honest caveat: this is a "test node" from a side pack, so don't expect a maintained UI around it. The feature set is real and the defaults are sane - reference_latents_method=none, vl_image_size=512 - so you can ignore 90% of the knobs and still get correct multi-image QwenImage-Edit encoding. You're here for the reference-latent controls when the simple node isn't enough.

CategoryMira/SubPack/QwenImage

Inputs (13)

NameTypeDefaultDescription
clipCLIP
system_promptSTRINGDescribe key details of the input image (including any objects, characters, poses, facial features, clothing, setting, textures and style), then explain how the user's text instruction should alter, modify or recreate the image. Generate a new image that meets the user's requirements, which can vary from a small change to a completely new image using inputs as a guide.
promptSTRING
crop_methodCOMBOdisabled2 options: disabled, center
vl_image_sizeINT512256–2048
reference_latents_methodCOMBOnone5 options: none, offset, index, uxo/uno, index_timestep_zero
vaeoptVAE
image1optIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
target_latentoptLATENT
reference_latents_sizeoptINT1024256–4096

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING