MiniMax H3 Resolution Selector (best-effort)
Pick an H3 canvas by name, not by typing numbers
- reference_image
- width
- height
- size
- length
MiniMax H3 has its own ideas about canvas math: a 768px short edge, a 768×1344 pixel-area cap, 32-multiple rounding, and a frame grid you have to land on or the generation fails. You could hand-type width and height into a latent node every time, or you could use this node and pick a canvas by name.
It outputs the four numbers an H3 generation actually needs - width, height, size (as a "W×H" string), and length (frame count) - from a resolution preset, with two overrides.
The controls:
resolution- a combo of ~46"W×H"presets spanning nine named aspect ratios (1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21) across five size tiers, from 384px up to 1152px. This is the widget that's actually parsed. It's the source of truth for width/height.aspect_ratio- exists as a human-readable label next to the resolution string. The original private node probably kept the two in sync with JavaScript; a plain Python node can't, so here the ratio is just a label and the resolution string wins. Set the resolution and ignore it.duration(seconds, default 5) andfps(default 24) - converted to a frame count and snapped to H3's frame grid (17k + 5frames) using the samealign_frame_countmath as ComfyUI's real native nodes, solengthcomes out valid.custom_width/custom_height- set both above 0 (they're step-32 integers) and they override the preset entirely.reference_image- if wired, its exact width:height ratio overrides the aspect_ratio/resolution preset (but not the custom override). The node steps through 32-aligned sizes at that exact ratio and picks the largest that still fits the selected preset's pixel budget. Handy when you're generating from a reference and want the canvas to match it.
Outputs: width, height, size (STRING), length (INT). Wire width/height into your latent node and length into anything that wants a frame count.
Honest provenance, because it matters with this pack: this is a best-effort reimplementation of a node type from a privately-distributed H3 workflow with no public source. The preset math is copied verbatim from ComfyUI's own native MiniMax H3 node code (so length stays byte-for-byte compatible), and two pieces - the duration→frame-count snapping and the exact-ratio reference sizing - are adapted with credit from the separate, real ComfyUI-ResolutionSelector pack's ImageRatioSelectorZerohackz node. Two legacy "384×576"/"736×1120" values are kept in the list so older saved workflows still load.
Install, plus the H3 ecosystem you need around it:
cd ComfyUI/custom_nodes
git clone https://github.com/jjmaden/comfyui-jjmaden-random-nodes
Restart ComfyUI, or search "JJMaden Random Nodes" in ComfyUI Manager. You need a ComfyUI build with native H3 support (it's in current ComfyUI - H3 got day-zero support). The pack itself is MIT with zero Python dependencies; the H3 weights are a separate, large download.
The thing to internalize: aspect_ratio looks like a control but isn't one - if you change the ratio label and the resolution doesn't change, that's expected, not broken. And the reference_image override is a nice-to-have that turns "match this image's proportions" into a one-wire operation. For the everyday "I want 1344×768 at 24fps" job, it's a clean shortcut that keeps your canvas numbers valid without you doing the mental arithmetic.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect_ratio | COMBO | 16:9 (Landscape Widescreen) | 10 options: 1:1 (Square), 16:9 (Landscape Widescreen), 9:16 (Vertical Video), 4:3 (Standard Photo), 3:4 (Portrait Standard), 3:2 (Landscape Photo), +4 |
| resolution | COMBO | 1344×768 | 46 options: 320×768, 384×384, 384×512, 384×576, 384×672, 512×384, +40 |
| duration | FLOAT | 5.00.2–150 | Seconds; snapped to MiniMax H3's frame grid for the `length` output. |
| fps | INT | 241–60 | — |
| custom_widthopt | INT | 00–16384 | 0 = use the resolution preset above (or reference_image, if wired). |
| custom_heightopt | INT | 00–16384 | — |
| reference_imageopt | IMAGE | If wired, output the largest exact-ratio size that preserves this image's own W:H and fits the `resolution` preset's pixel budget -- overrides aspect_ratio/resolution (not custom_width/height). |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |
| size | STRING | — |
| length | INT | — |