Nodes/ComfyUI-SA-Nodes-QQ/Wan Scale AB (QQ)
ComfyUI Node

Wan Scale AB (QQ)

Wan won't run your 1283×513 image — get two images on the same grid

By siraxe·Created 11 months ago·Updated 2 days ago· 72
Wan Scale AB (QQ)
  • image_A
  • image_B
  • image_A1
  • image_A2
  • image_B1
  • image_B2
A2size512
A1scale0.5
scaling_methodarea
match_toA_crop
divisible_by16
direct_scalefalse

Wan's VAE is picky about dimensions in a way that bites you the first time you drop a reference image into a workflow and the sampler quietly refuses. It wants sizes that divide cleanly - 16 is the safe unit, and the whole Wan video stack builds on that. WanScaleAB exists to take that chore off your hands: feed it one image or two, and it hands back four properly sized versions with matching aspect ratios, so a start frame and a reference frame actually line up instead of fighting each other.

It ships in siraxe's experimental ComfyUI-WanVideoWrapper_QQ pack (now renamed ComfyUI-SA-Nodes-QQ), a grab-bag of video-manipulation nodes built on top of Kijai's ComfyUI-WanVideoWrapper. WanScaleAB lives in its image category, and it's the kind of node that looks boring until you've spent an hour manually resizing two frames to the same resolution in an external editor.

How it works

You give it one required image (image_A) and optionally a second (image_B). Internally it computes two sizes: s1, where the image's largest side lands at roughly A2size (rounded up to divisible_by), and s2, the other side scaled proportionally and also rounded up. That pair - s1, s2 - is your A2 output, the main working size. Then it scales that down by A1scale (default 0.5) to make A1, a preview-sized copy.

The clever bit is match_to. With A_crop or A_stretch (the defaults), image A is the master and B is stretched or center-cropped to match A's computed sizes - crop preserves B's aspect ratio, stretch doesn't. Flip it to B_crop/B_stretch and the roles reverse: B's geometry drives and A gets matched to it. That's the "AB" in the name: two images normalized onto one grid so they can be blended, swapped, or fed as a start/mid pair without a dimension mismatch anywhere downstream.

The inputs that matter

  • A2size - the target for the larger side of your main output. Default 512.
  • A1scale - how much smaller the preview copy is. 0.5 = half of A2.
  • match_to - which image's geometry wins. The one you'll actually touch.
  • divisible_by - default 16, the VAE-friendly multiple everything rounds up to.
  • direct_scale - off by default; turn it on to skip the divisibility rounding on the A1 dimensions.

The four outputs are image_A1, image_A2, image_B1, image_B2. Wire image_A2 (and image_B2 if you're using two) into wherever your Wan workflow consumes its conditioning images.

Installing it

ComfyUI Manager is easiest - search for "ComfyUI-SA-Nodes-QQ" (the pack's current name) or clone it directly:

cd ComfyUI/custom_nodes
git clone https://github.com/siraxe/ComfyUI-WanVideoWrapper_QQ.git

Then restart ComfyUI. No extra pip dependencies - the pack's requirements.txt is empty and pyproject declares nothing. You still need Kijai's ComfyUI-WanVideoWrapper plus actual Wan weights for anything to sample; this pack is an add-on, not a replacement.

Where people get burned

The outputs round up to multiples of divisible_by, so don't expect exact sizes. Ask for 512 on a wide image and you might get 512×384 rather than 512×320. If you set divisible_by to 0, _round_up_to_multiple divides by zero and the node dies - leave it at 16 unless you know why you're changing it. And if you don't connect image_B, the B outputs come back as 64×64 black placeholders, which will happily destroy your workflow if you wire them in by mistake. Check that you're using image_A2, not a black square.

CategoryWanVideoWrapper_QQ/image

Inputs (8)

NameTypeDefaultDescription
image_AIMAGE
A2sizeINT51264–2048
A1scaleFLOAT0.50.1–2
scaling_methodCOMBOarea5 options: area, lanczos, bilinear, bicubic, nearest
match_toCOMBOA_crop4 options: A_crop, A_stretch, B_crop, B_stretch
divisible_byINT160–128
direct_scaleBOOLEANfalse
image_BoptIMAGE

Outputs (4)

NameTypeDescription
image_A1IMAGE
image_A2IMAGE
image_B1IMAGE
image_B2IMAGE