H3 Size Presets - SatoDive
Give it megapixels, get back numbers the model will accept
- width
- height
Nine times out of ten, the wrong resolution is the bug. You ask a model for 1120×630 because that's the aspect you want, and you get a weird crop, a soft image, or an outright error, because diffusion models want latent-friendly numbers and H3 wants multiples of 32.
H3 Size Presets exists so you don't do that arithmetic. Tell it a ratio and an area; it hands back a width and height pair that H3 will actually accept.
What it does
Eight aspect ratios - 16:9, 3:2, 4:3, 1:1, 3:4, 2:3, 9:16, 21:9 - plus Custom. In the ratio modes it derives the short side from your megapixel target (h = sqrt(area / ratio), w = h × ratio) and then rounds each side to the nearest multiple of 32, with a floor of 64. In Custom mode the optional width/height widgets (default 1920×1088) get snapped to the same grid.
Outputs are the two INTs, width and height. That's the whole node. It's a calculator with sockets.
Why it's worth a node rather than a note node
Two reasons, both practical.
First, it's the honest version of "megapixels." Because each side is rounded independently to the 32-grid, the area you get is close to your target but not identical - ask for 3 MP at 16:9 and you land a few pixels either side. That is the best you can do with H3's constraints, and it's better to have a node showing you the real numbers than to have a workflow silently feed 3.00 MP into a model that can't use it.
Second, it's wiring-friendly. The pack's Prompt & Size node computes the same numbers internally, so if you're using those nodes you don't need this one at all. H3 Size Presets earns its place when you're building on ComfyUI's native H3 nodes, or mixing in another pack, and you want one source of truth for width and height feeding several places instead of retyping a pair of numbers into three nodes.
When to use it, concretely
- You're hand-rolling a graph with native H3 nodes and want consistent dimensions across the conditioning and the latent.
- You want to sweep sizes without recomputing by hand each time - 2.5 MP → 3 → 4 → 6 is a dropdown here, and the tooltip notes H3 stills are best from 3 MP up. Start at 3, go up only if you need the detail; the cost is quadratic-ish in time.
- You want a bookmark-sized baseline. 16:9 at 2.5 MP lands at 2112×1184, which is a pleasant iteration size on a mid-range card.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/SatoDive/ComfyUI-H3-IMG-Gen-SatoDive
ComfyUI Manager: search ComfyUI-H3-IMG-Gen-SatoDive or MiniMax H3 Image Gen - SatoDive, install, restart. Zero declared Python dependencies. It's part of the H3 pack, so you need a ComfyUI build with native MiniMax H3 support for the pack to load at all - even though this particular node is pure arithmetic and never touches a model.
Gotchas
megapixels is a string dropdown, not a float. The choices are 2.5, 3, 4, 6, 8. No free-form entry, so if you want 5 MP you'll be picking 4 or 6, or using the pack's Simple node, whose megapixels widget is a proper 0.25–16 float.
Custom ignores megapixels entirely and snaps whatever the width and height widgets say. Both are optional inputs in the schema, so if you leave them unwired you get the 1920×1088 defaults - fine, but check the output before you assume your wiring took.
Multiples of 32 isn't a preference, it's a floor. H3's pipeline patchifies spatially on a 16× latent grid and the grid must stay even, so off-grid numbers get snapped somewhere by something, and when that something is a node you didn't choose, you get soft edges or an exception. Hand the model clean numbers and skip the argument.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect | COMBO | 16:9 | 9 options: 16:9, 3:2, 4:3, 1:1, 3:4, 2:3, +3 |
| megapixels | COMBO | 2.5 | Target area. H3 stills are best from 3 MP up. |
| widthopt | INT | 192064–8192 | — |
| heightopt | INT | 108864–8192 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |