📐 Canvas Preset Studio
Canvas Preset Studio
- width
- height
Every model has a native resolution, and most of them have hard divisibility rules under it. LTX-2 refuses anything that isn't a multiple of 32. Flux is happy as long as your numbers divide by 64. SDXL has a short list of trained aspect ratios and visibly degrades off them. And when you get it wrong, ComfyUI doesn't say "hey, that's 1216x723, try 1216x704" - it hands you a latent size mismatch error or a decoder crash that reads like a tensor multiplication contest. Canvas Preset Studio is a small node that stops you from typing those numbers wrong in the first place.
It's dead simple: a dropdown of ~37 known-good canvas sizes, a landscape/portrait toggle, and a snapping rule. The node spits out two integers - width and height - and you wire those into whatever needs them: EmptyLatentImage, your model's conditioning, a KSampler, a video latent node. That's the whole job. It doesn't encode, decode, or touch your model; it's a glorified (and genuinely useful) preset picker with validation, exactly the kind of plumbing node the ComfyUI ecosystem is built on.
How it works
There are two halves. The Python backend (nodes.py, version 1.0.1) holds a preset dictionary of sizes like 1280×704, 1536×832, and 1920×1088 - note the deliberate tweaks away from consumer-landmark 1080p so everything lands on a multiple of 32. On execution it validates your width and height against divisible_by, and if they're off it silently snaps to the nearest multiple and prints a console message telling you so. The interesting half is the bundled js/canvas_preset_studio.js, which draws the live canvas preview right on the node: a little rectangle scaled to your aspect ratio, plus the aspect ratio string and a red-or-green "Divisible: Yes/No" readout. That preview is the whole point - you see at a glance whether a canvas is valid before anything renders.
The inputs that matter
Four of the five inputs do real work, and preset is the one you'll touch most. Pick a size from the dropdown and it fills width/height; pick Custom to type anything yourself. orientation flips landscape↔portrait - with a preset it re-applies that size swapped, in Custom mode it just swaps your two numbers. divisible_by defaults to 32, which covers SDXL, LTX, and most video models; bump it to 64 when you're on Flux. The width and height INT fields step by 32 to keep you honest while typing. Outputs are exactly two: width and height, both INT.
One quirk worth knowing: the moment you nudge width or height manually, the dropdown switches itself back to Custom. That's intentional, not a bug - it means "you're no longer on a preset."
Install
No dependencies, no model downloads, no requirements.txt at all - it's pure Python stdlib plus the JS extension. Install via ComfyUI Manager (search "Canvas Preset Studio") or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/vitaliyburov/ComfyUI-CanvasPresetStudio
Restart ComfyUI and the node appears under Studio Nodes as "📐 Canvas Preset Studio".
Gotchas
The biggest trap isn't the node, it's trusting the "prevents latent size mismatches" claim too hard. This node only outputs numbers - if your workflow still mismatches (say, a custom node swaps latents on you, or your CLIP setup is wrong), it won't save you. Latent size mismatch errors in the wild are often caused by broken custom nodes or wrong conditioning, not bad canvas math, so treat this as one less thing to check rather than a fix-all.
Second: the backend snapping can quietly change your number on execution. If you type 1000×1000 with divisible_by at 32, you'll get 992×992 out, with only a console print as a hint. It's a safety net, but if you're debugging why your output isn't the resolution you typed, check the terminal.
Also, if you don't see the live preview canvas on the node, the web extension didn't load - usually because ComfyUI wasn't fully restarted after install. A fresh restart fixes it.
The code's docstring credits "Vitaliy Burov & OpenAI," which tells you exactly what kind of project this is: a clean, small, AI-assisted utility that does one job well. For a beginner who keeps fumbling resolutions between image and video workflows, it's a genuinely handy crutch. For anyone else, it's a nice way to stop doing 37 divisible-by-32 calculations in your head.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| preset | COMBO | Custom | 38 options: Custom, 3840 × 2176 (4K), 2560 × 1440 (QHD), 2560 × 1408, 2048 × 1152, 1920 × 1088 (FHD), +32 |
| width | INT | 128032–16384 | — |
| height | INT | 70432–16384 | — |
| orientation | COMBO | Landscape | 2 options: Landscape, Portrait |
| divisible_by | INT | 321–512 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |