Nodes/ComfyUI-QwenImageWanBridge/Qwen VL Image to Latent
ComfyUI Node

Qwen VL Image to Latent

Encode an image into a 16-channel Qwen latent

By fblissjr·Created about a year ago·Updated 4 months ago· 188
Qwen VL Image to Latent
  • images
  • vae
  • LATENT

The companion to QwenVLEmptyLatent: instead of a blank canvas, this takes a real image and encodes it into a latent Qwen can work with. It runs your picture through the VAE and hands back a 16-channel latent - the format the Qwen-Image family expects - so you can seed a generation from an existing image instead of from noise. That's the img2img starting point, the "denoise from this rather than from nothing" move.

The reason it's a dedicated node rather than a generic VAE encode is the same channel story that runs through this whole pack. Qwen-Image, like Flux and SD3 and Wan, uses a 16-channel VAE latent space, richer than the 4-channel space SD 1.5 and SDXL lived in. A latent has to match the model that consumes it, so encoding an image for Qwen means producing 16 channels at the right scale. This node wires that up so an image drops cleanly into a Qwen graph.

How it works

You give it one or more images and a vae, and it encodes them into the latent representation - compressing the pixels into the model's working space. From there the latent can be denoised at partial strength (img2img), used as a reference, or handed to whatever part of your Qwen workflow needs the image as a latent rather than as raw pixels.

The inputs and outputs that matter

There are only two, and both are required, which tells you how focused this node is:

  • images - the image (or batch) to encode.
  • vae - the VAE to encode with. This has to be Qwen-Image's VAE; feeding an SD or SDXL VAE produces a latent in the wrong space and the sampler won't do anything sensible with it.

Output is a single LATENT. Wire it into your sampler's latent_image input, and set the sampler's denoise below 1.0 if you want to preserve structure from the source image.

How to install it

ComfyUI ManagerComfyUI-QwenImageWanBridge → install → restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/fblissjr/ComfyUI-QwenImageWanBridge

then restart. The node is encode logic; you supply the VAE (part of your Qwen-Image model download) and the image.

Common issues & troubleshooting

The output is noise or nonsense. The usual culprit is a mismatched VAE - it must be the Qwen-Image VAE, not one carried over from an SD-era model. Wrong VAE, wrong latent space, wrong everything downstream.

My img2img ignores the source image. That's a denoise setting on the sampler, not this node. At denoise 1.0 the sampler throws away the input structure entirely; drop it to 0.4–0.7 to keep the composition of the encoded image while letting the prompt reshape the details.

Do I need this over a native VAEEncode? Not always - a native VAE encode with Qwen's VAE gets you a compatible latent too. This is the pack's own version, kept so a Qwen workflow stays inside one node set; the repo is explicitly complementary to native nodes rather than a replacement. Use whichever keeps your graph readable.

CategoryQwen/Latent

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
vaeVAE

Outputs (1)

NameTypeDescription
LATENTLATENT