Aspect Ratio Preset (C2C)
Stop doing aspect-ratio math by hand — this node hands you clean width/height that the model won't choke on
- width
- height
The most boring way a ComfyUI workflow dies is the shape-mismatch crash: you typed 1345 × 745 into an EmptyLatentImage, the latent comes back a different shape than the model expects, and the sampler tells you off. AspectPresetMEC exists so you stop doing that math in your head. Pick an aspect ratio, give it a long-edge target, and it returns two clean integers - already snapped to a multiple - that you feed straight into your latent or conditioning nodes.
It comes from the C2C/Helpers section of Code2Collapse/ComfyUI-CustomNodePacks, the same umbrella pack that owns the MaskEditControl (MEC) and VFX suites. It's a pure integer node: no model, no VRAM, no dependencies beyond what ComfyUI already has.
How it works
The node keeps a table of eleven presets. Seven are plain ratios - 1:1, 16:9, 9:16, 4:3, 3:4, 21:9, and 2.39:1 - and the four Wan presets are special. Instead of a ratio, they carry the actual native training resolutions of Wan's video models: Wan 480p is 832×480 and Wan 720p is 1280×720. That's a genuinely useful detail if you've ever watched a Wan run smear because you fed it an off-resolution latent; these are the sizes the model was actually trained at.
For the ratio presets, base is the long-edge target in pixels. The node scales the short edge to match the ratio, then snaps both dimensions down to a multiple of multiple (64 by default). The base input is ignored entirely when a Wan preset is selected - that's in the tooltip, and it's easy to miss.
The inputs that matter
You'll touch all three, but really only two at first:
- preset - the 11-option dropdown. Start with "16:9 landscape" and change as needed.
- base - the long edge you want (default 1024). Ignored for the four Wan presets.
- multiple - the snap grid, default 64. Lower it if you need finer control or if your model wants a smaller divisor.
Outputs are width and height, both INT. Wire them into EmptyLatentImage, EmptySD3LatentImage, or any node that takes a size, and the rest of your graph stays in sync.
Installing it
This is one node inside the big ComfyUI-CustomNodePacks repo - you install the whole pack. Easiest is ComfyUI Manager: search "CustomNodePacks". Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Code2Collapse/ComfyUI-CustomNodePacks.git
Restart ComfyUI and watch the console for the [MEC] Loaded ... line. No extra pip packages needed for this node - the pack's requirements.txt lists opencv-python, scipy, and safetensors for its other nodes, but don't blindly pip install -r requirements.txt: ComfyUI already ships torch and numpy, and a blanket install can overwrite them with incompatible versions. Install only what you're actually missing.
Gotchas
One trap is baked into the defaults. The snap-to-multiple runs on every preset, Wan ones included - so with multiple left at 64, "Wan 480p land" (832×480) snaps to 832×448, because 480 isn't a multiple of 64. You've just silently left the native resolution. If you want true native Wan sizes, set multiple to 16 (or 8) for those presets. It's a two-second fix once you know it's happening, and it's exactly the kind of thing that produces mysteriously soft video.
Otherwise this is the most frictionless node in the pack. If you already have an aspect you use everywhere, keep this in a template workflow and never type a dimension by hand again.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| preset | COMBO | 16:9 landscape | 11 options: 1:1 square, 16:9 landscape, 9:16 portrait, 4:3 landscape, 3:4 portrait, 21:9 ultrawide, +5 |
| base | INT | 102464–8192 | Long edge target (ignored for Wan presets). |
| multiple | INT | 641–256 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |