Nodes/ComfyUI-Qwen-Canvas/πŸ”₯ Qwen Canvas (Plus)
ComfyUI Node

πŸ”₯ Qwen Canvas (Plus)

How to stop Qwen-Image-Edit from offsetting your whole frame

By liewccΒ·Created 7 months agoΒ·Updated 7 months agoΒ· 2
πŸ”₯ Qwen Canvas (Plus)
  • pixels
  • vae
  • LATENT
  • width
  • height
  • PREVIEW_IMAGE
β—„aspect_ratio1:1 (1328 x 1328)β–Ί
β—„vae_encodeDisabledβ–Ί
β—„scaling_strategyCropβ–Ί
β—„batch_size1β–Ί

So you've got Qwen-Image-Edit running, you feed it a photo and a sentence, and the output comes back… shifted. Everything's there, but nothing is where it was. You are not doing it wrong - this is the model's known failure mode. Qwen-Edit re-emits the entire frame on every edit rather than patching a region, and when the source image's resolution and aspect ratio don't match what it was trained on, the geometry drifts. The fix the community converged on: control the input size before it ever reaches the encoder. That's what QwenCanvasPlus exists to do - it's the image-fit pre-processor for Qwen-Edit workflows, and the one node in this pack worth building a workflow around.

What it does: it takes an optional image, fits it into one of Qwen's official training buckets (1:1 at 1328Β², 16:9 at 1664x928, and five more, all multiples of 8 and roughly 1.5–1.8MP), and either encodes that fitted image into a latent for you or hands back an empty latent at the right size. It's the image-aware big sibling of the pack's Basic node.

The inputs that matter:

  • aspect_ratio - the seven buckets plus Original (Follow Input), which keeps your image's own aspect ratio, capped at 1 megapixel (1,048,576 pixels, the author's read on Qwen's vision-encoder constraint) and snapped to multiples of 8 so the VAE is happy.
  • scaling_strategy - Crop, Pad, or Stretch. Crop fills the canvas and cuts the edges (keeps subject scale). Pad fits the whole image inside with black bars (keeps everything). Stretch force-fits and distorts. The README's pro tip: for editing, use Pad so nothing at the image edges gets lost.
  • vae_encode - Enabled or Disabled. This decides which mode you're in.
  • pixels and vae - optional inputs. Only needed when vae_encode is Enabled.

The two modes. With vae_encode Disabled, it's a smart empty-latent: no image processing, just the right-sized blank frame - useful when you want your latent shape to follow a reference image without encoding it yet. With vae_encode Enabled and both pixels and vae connected, it does the real work: scale + crop/pad/stretch to the target bucket, run it through vae.encode, and return both the latent and a PREVIEW_IMAGE so you can see exactly what the model is about to see.

The node is marked an OUTPUT_NODE, which is why the UI behaves differently from a normal node: even with nothing wired to a Save Image, it updates the node body - you get a dashed outline showing the target aspect ratio before you queue, and a low-res thumbnail of the processed result when encoding. That's genuinely useful for eyeballing a crop before burning a 20B inference on it.

Outputs: LATENT β†’ your sampler's latent_image. PREVIEW_IMAGE β†’ a Preview Image node if you want it bigger than the thumbnail. width/height for resolution-aware nodes.

Install - same as its sibling, and just as light. The pack's only requirements are torch, numpy, and Pillow, all already present in any ComfyUI install. No model files, no API key.

cd ComfyUI/custom_nodes
git clone https://github.com/liewcc/ComfyUI-Qwen-Canvas

Restart ComfyUI, or just use ComfyUI Manager and search ComfyUI-Qwen-Canvas.

Where people get burned:

  • vae_encode set to Enabled with no pixels or no vae connected silently falls back to the empty-latent branch. No error, no warning - you get a blank frame and a confusing result. Check your wires first.
  • It calls vae.encode on whatever VAE you hand it. Connect the VAE that matches your Qwen checkpoint, or you'll get garbage out of a "correct" setup. An SDXL VAE is the wrong VAE here.
  • Pad's black bars get encoded into the latent. The sampler sees a letterboxed image, not free real estate. It's usually the right trade for preserving edges; just know what you're getting.
  • Original (Follow Input) with no pixels connected defaults to 1328x1328. Fine as a fallback, surprising if you expected magic.
  • VRAM: encoding a 1664x928 frame into a 20B model is heavy. Run a GGUF quant of Qwen-Edit, or use the Disabled-encode path and let the sampler handle it. batch_size only shapes the empty-latent branch.

Worth the install? If you edit photos with Qwen-Edit, yes. This is the difference between fighting drift on every edit and having the geometry just behave.

CategoryQwen Toolset

Inputs (6)

NameTypeDefaultDescription
aspect_ratioCOMBO1:1 (1328 x 1328)8 options: 1:1 (1328 x 1328), 16:9 (1664 x 928), 9:16 (928 x 1664), 4:3 (1472 x 1104), 3:4 (1104 x 1472), 3:2 (1584 x 1056), +2
vae_encodeCOMBODisabled2 options: Enabled, Disabled
scaling_strategyCOMBOCrop3 options: Crop, Pad, Stretch
batch_sizeINT11–64β€”
pixelsoptIMAGEβ€”
vaeoptVAEβ€”

Outputs (4)

NameTypeDescription
LATENTLATENTβ€”
widthINTβ€”
heightINTβ€”
PREVIEW_IMAGEIMAGEβ€”