Nodes/ComfyUI-Chibi-Nodes/RandomResolutionLatent
ComfyUI Node

RandomResolutionLatent

An empty latent at a random size each run

By chibiace·Created 3 years ago·Updated 9 months ago· 92
RandomResolutionLatent
    • LATENT
    • width
    • height
    batch_size1

    RandomResolutionLatent replaces ComfyUI's EmptyLatentImage with a version that picks its own resolution each time you queue, instead of you setting one fixed width and height. It's a small but genuinely handy node for anyone doing exploratory batch generation - testing how a checkpoint or LoRA behaves across different aspect ratios without manually cycling through presets yourself.

    How it works

    Here's the honest limit of this node, and it's worth stating plainly: the schema exposes exactly one input, batch_size. There's no min/max range, no aspect-ratio list, no way to constrain which sizes it's allowed to pick from the graph itself. Whatever pool of resolutions it draws from is baked into the node's code rather than something you configure - so if you need it to stay within a specific range (say, only landscape orientations, or nothing above a certain pixel count for VRAM reasons), you can't set that from the node's UI. If that matters to you, check the pack's source on GitHub for the exact list, or fall back to manually cycling EmptyLatentImage presets where you do get full control.

    What you do get back is useful regardless: the resolution it landed on, as plain numbers you can route elsewhere.

    The inputs and outputs that matter

    • batch_size - 1 to 4096, same as ComfyUI's stock EmptyLatentImage. How many latents (all at the same randomly-picked resolution) to generate in this batch.

    Three outputs: LATENT, ready for a sampler same as any empty latent. width and height, the actual dimensions it picked - wire these into Chibi's ImageAddText (to stamp the resolution onto the output) or SaveImages-adjacent filename logic if you want to track which size produced which result later.

    The node is flagged is_output_node, meaning it'll always execute even without anything wired to width/height - so it works fine as a bare latent source with nothing downstream reading the size outputs, if you don't need to track that.

    How to install it

    • ComfyUI Manager: search "ComfyUI-Chibi-Nodes", install, restart.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/chibiace/ComfyUI-Chibi-Nodes/, restart.

    No models, no dependencies beyond ComfyUI itself. It appears under Chibi-Nodes/Numbers once installed. Fitting the pack's own description of itself as "experimental nodes" that shipped version 2 "with more bugs" - a node whose entire visible surface is one integer input has limited room to misbehave, but the lack of configurability here is a real design choice worth knowing about before you build a workflow around it.

    Common issues

    The main frustration people run into isn't a bug so much as the design: if you queue several runs expecting variety and keep landing on the same handful of resolutions, that's the fixed internal pool showing its limits, not randomness failing. There's nothing in the node to expand that pool from the graph.

    The other thing to watch: because width and height change from run to run, anything downstream that assumes a fixed shape (a fixed-size mask, a resize node expecting a particular aspect ratio) can break intermittently in a way that's confusing to debug, since the same graph will work on one queue and fail on the next purely because the latent came out a different shape. If you're chaining this into something size-sensitive, route the width/height outputs into whatever downstream node needs to match rather than hardcoding a size there.

    CategoryChibi-Nodes/Numbers

    Inputs (1)

    NameTypeDefaultDescription
    batch_sizeINT11–4096

    Outputs (3)

    NameTypeDescription
    LATENTLATENT
    widthINT
    heightINT