Nodes/ComfyUI-Ichis-Pack/ICHIS Aspect Ratio Plus
ComfyUI Node

ICHIS Aspect Ratio Plus

SDXL's aspect-ratio cheat sheet, wrapped in a node

By ichabodcole·Created about a year ago·Updated 12 months ago· 2
ICHIS Aspect Ratio Plus
    • WIDTH
    • HEIGHT
    • LATENT
    • SELECTED_RATIO
    • NEXT_STEP
    aspect_ratio1:1 square 1024x1024
    upscale1.0
    batch_size1
    modenormal
    size_modeall
    seed0
    include_1_1true
    include_3_4true
    include_5_8true
    include_9_16true
    include_9_21true
    include_3_2true
    include_16_9true
    include_21_9true
    reset_stepfalse

    Every SDXL workflow starts the same way: an Empty Latent node, and you frantically trying to remember which pixel dimensions are actually 3:4. The ICHIS Aspect Ratio Plus node from the Ichis pack is that node with the cheat sheet welded on. Pick a ratio and it hands you the correct width, height, and a ready-to-sample latent - and if you want, it will roll through ratios for you across batches instead of you editing the widget by hand every time.

    What it actually does

    It's a drop-in replacement for core EmptyLatentImage, except the aspect_ratio dropdown carries the eight SDXL-recommended presets (1:1 square 1024x1024, 3:4 portrait 896x1152, 9:16 portrait 768x1344, 16:9 landscape 1344x768, 21:9 landscape 1536x640, and the rest). Pick one and it outputs:

    • WIDTH and HEIGHT - the pixel dimensions, handy if you're doing size math downstream.
    • LATENT - a blank 4-channel tensor at 1/8 resolution. SDXL's VAE downsamples 8x per side into 4 latent channels, so the node builds it the exact same way core ComfyUI does, then KSampler adds the noise. Feed it straight into the sampler.
    • SELECTED_RATIO - the human-readable name of what won.
    • NEXT_STEP - which step index is coming up next, if you care to display it.

    The inputs that matter

    • aspect_ratio - the preset picker. This is the one you'll set 95% of the time.
    • upscale - a plain multiplier on both dimensions (0.1–10). One catch: the result gets integer-truncated and the latent is width // 8 on each side. Upscale to something not divisible by 8 and your reported WIDTH won't quite match what decodes. Keep multiples of 8 unless you like off-by-one geometry.
    • mode - normal (use the picker), step (cycle through the enabled ratios one per queue, wrapping around), or random (seeded choice).
    • size_mode and the include_* toggles - filter which ratios are eligible when cycling or rolling randomly. You can, for example, restrict to landscape only and step through them.
    • seed (random mode), reset_step (jump the step counter back to zero), batch_size (how many identical latents).

    One behavior worth knowing: in normal mode the node caches like any ordinary node, but step and random force themselves to re-run on every queue because their IS_CHANGED returns a fresh timestamp. That's deliberate - a stepped or random ratio has to execute even if nothing else changed. If everything seems to re-run every time, check you haven't left it in random.

    How to install it

    Install the whole pack - all the ICHIS nodes ship together:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ichabodcole/ComfyUI-Ichis-Pack
    

    Then restart ComfyUI. You can also just search for ComfyUI-Ichis-Pack (or "Ichis") in ComfyUI Manager and click install. There are no model downloads and no heavy dependencies - the pack's only real dependency is torch, which you already have.

    Troubleshooting

    The latent is zeros, not noise - that's correct and matches core EmptyLatentImage; KSampler adds the noise. If your images come out a different size than the picker promised, you upscaled to a non-multiple-of-8 dimension. And if random mode ignores your picks, remember the include_* toggles and size_mode filter the pool; with everything toggled off it silently falls back to the manually selected ratio.

    CategoryICHIS

    Inputs (15)

    NameTypeDefaultDescription
    aspect_ratioCOMBO1:1 square 1024x10248 options: 1:1 square 1024x1024, 3:4 portrait 896x1152, 5:8 portrait 832x1216, 9:16 portrait 768x1344, 9:21 portrait 640x1536, 3:2 landscape 1216x832, +2
    upscaleFLOAT1.00.1–10
    batch_sizeINT11–64
    modeCOMBOnormal3 options: normal, step, random
    size_modeoptCOMBOall3 options: all, portrait only, landscape only
    seedoptINT00–18446744073709550000
    include_1_1optBOOLEANtrue
    include_3_4optBOOLEANtrue
    include_5_8optBOOLEANtrue
    include_9_16optBOOLEANtrue
    include_9_21optBOOLEANtrue
    include_3_2optBOOLEANtrue
    include_16_9optBOOLEANtrue
    include_21_9optBOOLEANtrue
    reset_stepoptBOOLEANfalse

    Outputs (5)

    NameTypeDescription
    WIDTHINT
    HEIGHTINT
    LATENTLATENT
    SELECTED_RATIOSTRING
    NEXT_STEPINT