Video Size (Local Models)
Preset video resolutions without the guessing game
- aspect_ratio
- video_width
- video_height
- video_latent
- batch_size
Video models are pickier about resolution than image models, and way more punishing when you guess wrong - one wrong dimension and you're either OOM'ing your GPU or generating something that looks like it was upscaled from a flip-phone. Video Size (Local Models) is a dropdown of the resolutions that actually work with the big local video families - WanVideo 2.1, Hunyuan Video, and CogVideoX 1.5 - so you stop Googling "1280x720 vs 1360x768" every time you switch models.
It's part of APW_Nodes, the utility pack Alessandro Perilli extracted from his "AP Workflows for ComfyUI" suite. It's the video twin of the pack's local image size node, with one important difference you should know about before you wire it up.
How it works
Same pattern as its image sibling: the Aspect Ratio dropdown maps to a hardcoded dictionary, and the node returns aspect_ratio (a "WxH" string), video_width, video_height, a video_latent, and batch_size. The presets are chosen per model:
1360x768and720x480for CogVideoX 1.51280x720and854x480for WanVideo 2.11280x720and960x544for Hunyuan Video
That's a decent snapshot of the open video landscape: Wan 2.1 is the consolidated base most local video work sits on, Hunyuan was the first mover that got overtaken by it, and CogVideoX was the earlier standard that Z.ai (the Tsinghua spin-off) shipped before Wan existed. All three families, one dropdown.
The inputs that matter
- Aspect Ratio - five real presets plus
custom. - Custom Width / Custom Height - 64 to 8192, for when none of the presets fit.
- Batch Size - 1 to 64, default 1.
Here's the catch
That video_latent output is a 4-channel, image-shaped blank ([batch, 4, H//8, W//8]). Real video samplers in ComfyUI want a 5D video latent with a frame axis and the model's channel count - Wan, Hunyuan, and CogVideoX all do. So don't wire video_latent into a video sampler and expect frames to come out; you'll get a one-frame-ish blank at best. Use the video_width, video_height, and batch_size outputs to feed your model's own empty-video-latent node (the Wan/Hunyuan/CogVideoX empty-latent nodes are separate anyway). In other words: this node is great at dimensions, and its latent output is a vestigial convenience, not the main event. Same multiples-of-8 rule as the image node applies to custom dims - the latent uses floor division, so 100x100 silently becomes 96x96.
Wiring it up
For a text-to-video workflow: pick your model's preset, wire video_width / video_height / batch_size into the model's empty-latent node and the batch-aware bits, and keep aspect_ratio for metadata or prompt templates. It won't replace the model-specific latent node, but it replaces the mental arithmetic.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/alessandroperilli/apw_nodes
Restart ComfyUI, or search "APW Nodes" in ComfyUI Manager. No extra dependencies, no model downloads - just torch, which you already have. The repo is archived with the author pointing to OCS_Nodes as its successor, but it installs and works fine.
Where people get burned
Besides the latent-shaped-like-an-image trap above: selecting a preset for a model you're not running. 1360x768 is a CogVideoX resolution, not a Wan one - every video architecture has its own sweet spot, and this node's whole job is keeping you on it. Pick the preset matching the model in your graph, not the one that sounds biggest.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| Aspect Ratio | COMBO | 6 options: custom, 1360x768 [CogVideoX 1.5], 1280x720 [WanVideo 2.1, Hunyuan Video], 960x544 [Hunyuan Video], 854x480 [WanVideo 2.1], 720x480 [CogVideoX 1.5] | |
| Custom Width | INT | 6464–8192 | — |
| Custom Height | INT | 6464–8192 | — |
| Batch Size | INT | 11–64 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| aspect_ratio | * | — |
| video_width | INT | — |
| video_height | INT | — |
| video_latent | LATENT | — |
| batch_size | INT | — |