Nodes/ComfyUI-AI2Go-Utils/AI2Go Resolution Selector
ComfyUI Node

AI2Go Resolution Selector

Stop hand-typing width and height — this node does the math

By Little-God1983·Created 2 months ago·Updated 15 days ago· 2
AI2Go Resolution Selector
    • width
    • height
    profiledefault
    resolution_modemegapixel
    aspect_ratio1:1 (Square)
    megapixels1.0
    width1024
    height1024
    snap_multiple8
    orientationlandscape

    The most boring part of any ComfyUI workflow is remembering that your model wants multiples of 8 - and that Ideogram 4 wants multiples of 16, capped at 2048px per side - and that a "2:1" image should be 2048×1024, not 2000×1000. This node is that arithmetic in widget form. It picks a model-valid width/height from an aspect ratio and a mode, snaps both sides to the right multiple, and hands you two clean INTs. Nothing glamorous, but it quietly removes a whole class of "why is my image the wrong size" oopses.

    How it works

    The three settings that matter:

    • profile - the ruleset. default does no clamping; it just snaps each side to the snap_multiple field (default 8, which is what most diffusion samplers require). The Ideogram 4 profile enforces the model's real constraints - multiples of 16, 256–2048px per side - and shows a "clamped to keep aspect" warning when you ask for more than it can give.
    • resolution_mode - raw (type width/height directly), auto (pick a ratio, edit one side, the other follows), or megapixel (target megapixels + ratio, both sides computed).
    • aspect_ratio - named presets from 1:1 (Square) up to 3:1 (Wide Panorama), including 21:9 (Cinemascope). The list is square + landscape only; the flip button transposes to portrait (16:9 → 9:16) via the orientation field, so there's no duplicated 1:1 entry.

    The readout shows you the resulting W×H, megapixels, and the effective ratio and orientation, so you can sanity-check before queueing.

    The outputs

    Just two: width and height, both INTs. Wire them into the AI2Go Ideogram 4 Prompt Builder's width/height inputs and edits push into the builder's canvas live - they also apply on execution, which is the reliable path. Because the two nodes are from the same pack, the wiring is intentional: this is the "dimensions" half of the pack's Ideogram 4 starter kit.

    Megapixel mode is the sleeper feature. Tell it "about 1MP, landscape" and it computes something sane like 1344×768 instead of you doing ratio math in your head at 2am. And with the Ideogram 4 profile active, it won't let you queue a run that's outside the model's range - 2048×2048 is about 4.19MP, and it'll clamp there rather than silently overshoot.

    Install

    Same as every node in this pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Little-God1983/ComfyUI-AI2Go-Utils
    

    Restart ComfyUI and it's in your node list. No extra dependencies beyond Pillow, which ComfyUI already has. ComfyUI Manager users can just search "ComfyUI-AI2Go-Utils" instead.

    Gotchas

    • snap_multiple is ignored when a model profile defines its own multiple (Ideogram 4 = 16). The node heals bad values back to 8, so a stray emptied spinner never blocks your queue.
    • If a resolution comes out looking odd, check which profile is active. The default profile will happily hand you a non-16 multiple that Ideogram 4 won't like - switch to the Ideogram 4 profile when that model is in play.
    • Remember the pack's one quirk: this repo is published "for reference" with issues disabled, so don't expect support - but it's GPL-3.0 and forkable.

    Is it a must-have? No - you can do all of this with the stock Empty Latent Image and a calculator. But if you already run the Ideogram 4 builder from this pack, the live push into the canvas makes it the difference between fiddling with two widgets and one.

    CategoryAI2Go/image

    Inputs (8)

    NameTypeDefaultDescription
    profileCOMBOdefaultModel ruleset. 'default' = no clamp, snaps to 'snap_multiple'. 'Ideogram 4' = multiples of 16, 256-2048 px.
    resolution_modeCOMBOmegapixel'raw' = type width/height; 'auto' = pick a ratio and edit either side; 'megapixel' = pick a target megapixels + ratio. All snap to the profile.
    aspect_ratioCOMBO1:1 (Square)Target aspect ratio for 'auto' and 'megapixel'. Square + landscape only; use the flip button (orientation) for portrait.
    megapixelsFLOAT1.00.1–16Target size in megapixels for 'megapixel' mode. (Ideogram 4 still clamps to ~4.19 MP at 2048x2048.)
    widthINT102464–16384Width. Editable in 'raw' and 'auto'; computed in 'megapixel'. Snapped to the multiple.
    heightINT102464–16384Height. Editable in 'raw' and 'auto'; computed in 'megapixel'. Snapped to the multiple.
    snap_multipleINT81–1024Round each side to a multiple of this. Most diffusion models require multiples of 8, so keep it at 8 unless your model needs otherwise. Ignored by model profiles that define their own multiple (Ideogram 4 = 16).
    orientationCOMBOlandscapeLandscape or portrait. Toggled by the '⟷' flip button in the editor; portrait transposes the selected ratio (16:9 -> 9:16).

    Outputs (2)

    NameTypeDescription
    widthINT
    heightINT