Nodes/ComfyUI WanVideo Auto Resize/WanVideo Auto Image Resize
ComfyUI Node

WanVideo Auto Image Resize

The boring node that stops your Wan videos from failing

By karthikg-09·Created about a year ago·Updated 10 months ago· 4
WanVideo Auto Image Resize
  • image
  • image
  • width
  • height
  • orientation
  • aspect_ratio
  • resize_info
preset_resolution720p
resize_modeKeep Proportion
orientation_priorityAuto Detect
pad_colorBlack
interpolationBilinear
dimension_multiple16
custom_width832
custom_height480

Every Wan workflow starts with the same boring problem: your input frame is 1536×1024, and Wan wants 1280×720 (or 832×480, or whatever box you picked). Feed the model the wrong dimensions and you either get an error, a silently squashed image, or a video that doesn't match the reference frame's composition. WanVideoAutoImgResize is a one-node fix for exactly that: it takes any image, figures out its orientation, and resizes it to an industry-standard preset with the resize strategy you choose. It's not flashy - it's the kind of utility you forget is even in your graph until you try to run a workflow without it.

It shows up in the WanVideoWrapper category, right alongside Kijai's wrapper and friends, which tells you who this is aimed at: people assembling image-to-video graphs where the first frame has to slot cleanly into the VAE's latent box. Because Wan's VAE downsamples spatially by 8×, resolutions that aren't multiples of 8 (ideally 16 or 32) round off awkwardly on the latent side. That's why the node's dimension_multiple input exists - set it to 16 (the default) and every output dimension snaps to a multiple of 16, which keeps the latent size exact and the sampling fast.

How it works

The logic is genuinely simple. It reads your image's width and height, computes the aspect ratio, and classifies it: square if the ratio is between 0.85 and 1.18 (so a 410×390 frame counts as square, not "basically landscape"), landscape above that, portrait below. That detected orientation then picks which way a preset is applied - 1080p means 1920×1080 for landscape but 1080×1920 for portrait, and square drops to the smaller side. If you'd rather force it, orientation_priority overrides detection entirely.

The resize_mode is where you decide what "fit" means:

  • Keep Proportion - fits inside the box, keeping aspect, snapping to dimension_multiple. Safest default for video.
  • Pad - fits proportionally, then pads to the exact box with the pad_color of your choice.
  • Crop - scales up so the shorter side fills the box, then center-crops. Good for filling a canvas, but it cuts off edges.
  • Stretch - ignores aspect ratio entirely and squashes to the box. Only for when you're desperate.

All resizing runs through torch.nn.functional.interpolate with CUDA and automatic mixed precision, so it's fast and batch-friendly.

Inputs that matter

You'll set preset_resolution (360p/480p/576p/720p/1080p or Custom), resize_mode, and orientation_priority. The interpolation dropdown - Bilinear default, Bicubic, Lanczos, Nearest - controls quality vs. speed. Two small asterisks from reading the source: "Lanczos" is actually implemented as bicubic (there's no real Lanczos behind it), and the "Blur" pad color is actually reflect padding, not a blurred edge. Neither will ruin your workflow; just don't expect cinema-grade letterbox blur.

It's an output node, so it can display the image directly, and it also emits width, height, orientation, aspect_ratio, and a resize_info string you can use for logging or to drive other nodes. If you pick Custom, the custom_width and custom_height inputs (default 832×480) kick in.

Installing it

Grab it through ComfyUI Manager by searching "ComfyUI WanVideo Auto Resize," or clone it manually:

cd ComfyUI/custom_nodes
git clone https://github.com/karthikg-09/ComfyUI-WanVideoAutoResize

Then restart ComfyUI. There are no extra Python dependencies, no model downloads, no weights - it's pure PyTorch on top of what ComfyUI already ships. The whole pack is one node in a single file.

The honest take

Do you need it? No - you can rebuild this with ComfyUI's stock ImageScale plus Padding and Crop nodes. But that's four or five nodes and a lot of fiddling per workflow, and this collapses it into one with orientation handling built in. It's a small, unglamorous utility from a solo author (one commit, no community footprint), so treat it as a convenience rather than infrastructure: pin the version if it ever breaks your graph, and keep in mind the README's "high-performance" marketing is doing a lot of heavy lifting for what is fundamentally a few interpolate calls. For a beginner, though, it's exactly the kind of node that makes a Wan workflow "just work" instead of turning into a 20-minute fight about canvas sizes.

CategoryWanVideoWrapper

Inputs (9)

NameTypeDefaultDescription
imageIMAGEImage to resize
preset_resolutionCOMBO720pIndustry standard preset resolutions
resize_modeCOMBOKeep ProportionHow to handle aspect ratio differences
orientation_priorityCOMBOAuto DetectSmart orientation handling
pad_colorCOMBOBlackPadding color when using Pad mode
interpolationCOMBOBilinearInterpolation method: Bilinear (fast), Bicubic (quality), Nearest (fastest), Lanczos (high quality)
dimension_multipleINT161–64Ensure output dimensions are multiples of this value (e.g., 8, 16, 32 for optimal performance)
custom_widthoptINT83264–4096Custom width (only used when preset is 'Custom')
custom_heightoptINT48064–4096Custom height (only used when preset is 'Custom')

Outputs (6)

NameTypeDescription
imageIMAGE
widthINT
heightINT
orientationSTRING
aspect_ratioFLOAT
resize_infoSTRING