Nodes/ComfyUI-HunyuanVideoSamplerSave/Resize Image For Hunyuan
ComfyUI Node

Resize Image For Hunyuan

Get your source image to a size Hunyuan (and your latent) actually agree on

By ShmuelRonen·Created 2 years ago·Updated about a year ago· 20
Resize Image For Hunyuan
  • image
  • IMAGE
size_preset
upscale_method
crop

This is the prep step nobody wants to do by hand: getting a source image to the exact pixel dimensions a video model's VAE expects. Hunyuan's causal VAE wants width and height aligned to a 16×16 grid, and if you're doing image-to-video you also want that image's size to match whatever you set on EmptyVideoLatentForHunyuan - otherwise your image conditioning and your empty latent disagree about the canvas they're supposed to share. This node exists so you pick a label off a list instead of doing that math yourself.

How it works

It's a preset-driven version of ComfyUI's native resize/scale combo, purpose-built to use the exact same 36-entry size list as this pack's EmptyVideoLatentForHunyuan node - same aspect-ratio buckets (1:1, 16:9, 4:3, 3:2, 9:16, 3:4, 2:3), same 768-class ceiling, same 16×16 alignment. Pick a preset, pick an upscale method, pick a crop mode, and it hands back an image sized and cropped to match.

The inputs and outputs that matter

  • image - your source.
  • size_preset - one of 36 choices, labeled aspect-ratio-first like "16:9 (384x216)". The important discipline here: pick the same preset you used for resolution on EmptyVideoLatentForHunyuan. The two dropdowns aren't linked automatically - you have to keep them in sync yourself, or your image and your latent won't agree on shape.
  • upscale_method - nearest-exact, bilinear, area, or bicubic. For photoreal source images, bicubic or area gives you the smoothest result; nearest-exact preserves hard pixel edges, which you basically never want for a photo - that one's for pixel art or masks.
  • crop - disabled or center. If your source image's aspect ratio doesn't match the preset you picked, disabled squashes or stretches it to fit, which distorts faces and objects into the wrong proportions. center crops instead, keeping proportions intact and losing the edges. Default to center unless you deliberately want the whole source visible with no cropping.

Output is a single IMAGE, ready for your I2V conditioning path or a VAE encode. It also pairs naturally with ImageMotionInfluance if you want to fake a pan/zoom before generation - resize first, then apply motion, so the motion node isn't working with an oddly-shaped source.

How to install it

Via ComfyUI Manager: search ComfyUI-HunyuanVideoSamplerSave, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ShmuelRonen/ComfyUI-HunyuanVideoSamplerSave.git

then restart. Like ImageMotionInfluance, this node is pure image processing - no Hunyuan model download needed to use it, even though "Hunyuan" is in the name.

Common issues & troubleshooting

Shape mismatch further down the graph. By far the most likely issue: you picked a size_preset here that doesn't match the resolution you set on EmptyVideoLatentForHunyuan. Treat those two dropdowns as one setting split across two nodes, and double-check them together whenever you change one.

Faces or objects look stretched. You left crop on disabled with a source image whose aspect ratio doesn't match your chosen preset. Switch to center unless stretching is genuinely what you want.

Output still looks too small or too soft for what you expected. None of the 36 presets go much past the 768px class - this pack was built for the original, VRAM-hungry HunyuanVideo running on consumer cards, not for the higher resolutions the later, lighter HunyuanVideo 1.5 can comfortably handle. If you need real resolution and you're running the newer model, you're better served by ComfyUI's native Hunyuan Video workflow (official support shipped alongside 1.5) than by fighting this node's preset ceiling.

Categoryimage/hunyuan

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
size_presetCOMBO36 options: 1:1 (256x256), 1:1 (384x384), 1:1 (512x512), 1:1 (768x768), 16:9 (384x216), 16:9 (512x288), +30
upscale_methodCOMBO4 options: nearest-exact, bilinear, area, bicubic
cropCOMBO2 options: disabled, center

Outputs (1)

NameTypeDescription
IMAGEIMAGE