Nodes/CRT-Nodes/Resolution (CRT)
ComfyUI Node

Resolution (CRT)

Pick a megapixel target and get the right latent for your model

By PGCRT·Created 2 years ago·Updated a day ago· 132
Resolution (CRT)
    • width
    • height
    • latent
    megapixels1.0
    modelFlux 2, ERNIE
    aspect_ratio3:2 (Landscape)
    divisible_by8

    The hardest thing about a new model is figuring out what resolution to generate at - "1MP" means nothing until you know whether the model's VAE divides by 8 or 16. Resolution (CRT) answers that for you. You pick a megapixel budget and an aspect ratio, tell it which model family you're targeting, and it hands back clean width/height integers and a ready-to-sampler latent with the right channel count and downscale baked in. It's the kind of node that saves you one silent "why is this latent the wrong shape" crash per workflow.

    Why the model dropdown exists

    This is the heart of it. Different architectures use different latent formats, and getting it wrong breaks your sampler:

    • SDXL - 4 channels, 8× downscale
    • Flux 1 / Z-Image / Qwen-Image - 16 channels, 8×
    • Krea 2 - 16 channels, 8×
    • Flux 2 / ERNIE - 128 channels, 16×

    Select the family and the node builds a latent of the exact shape the sampler expects. If you've ever fed a FLUX.2 latent into an SDXL sampler and watched it fail, you know why this dropdown is the point of the node.

    The inputs

    • megapixels - target in megapixels (default 1.0, up to 32).
    • model - the architecture preset above. This is the one to get right.
    • aspect_ratio - twenty options from 1:1 through 21:9, portrait and landscape. The megapixels get split to match.
    • divisible_by - quantization step (default 8). Raises it to 16 or 64 if your model or attention wants stricter multiples; note that a large step can overshoot your megapixel target since it rounds up.

    The three outputs

    • width / height - INTs, divisible as requested. Wire them into any latent-aware node that needs explicit dimensions.
    • latent - a zeroed latent of the correct shape for the selected model. Feed it straight to a KSampler as the empty latent and sample from noise.

    How you'd actually use it

    It's a values node, so it lives mid-graph: pick a target, read the numbers, and drive an EmptyLatentImage or the CRT sampler family with them - or just use the built-in latent output and skip the manual empty-latent node entirely. It's the kind of node that makes model-hopping painless, because each model gets its correct format by changing one dropdown instead of rebuilding your resolution math.

    Gotchas

    • It rounds, and rounding overshoots. Quantizing up to divisible_by means your actual megapixels can exceed the target - fine for VRAM headroom math, annoying if you were being precise.
    • The preset list is opinionated and current. "Krea 2" and "Flux 2, ERNIE" match mid-2026 model families; a hypothetical future architecture won't be here yet.
    • Zeroed latent = blank start. You're meant to sample from it, not decode it directly - decoding a zero latent gives you grey, which confuses beginners.

    Install CRT-Nodes via ComfyUI Manager (CRT-Nodes) or git clone https://github.com/plugcrypt/CRT-Nodes.git into custom_nodes, install requirements.txt, restart.

    CategoryCRT/Utils/Logic & Values

    Inputs (4)

    NameTypeDefaultDescription
    megapixelsFLOAT1.00.1–32
    modelCOMBOFlux 2, ERNIE4 options: SDXL, Flux 1, Z-image, Qwen-Image, Krea 2, Flux 2, ERNIE
    aspect_ratioCOMBO3:2 (Landscape)20 options: 1:1 (Square), 2:3 (Portrait), 3:4 (Portrait), 4:5 (Portrait), 5:7 (Portrait), 5:8 (Portrait), +14
    divisible_byINT81–256

    Outputs (3)

    NameTypeDescription
    widthINT
    heightINT
    latentLATENT