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

Resolution By Side (CRT)

Stop guessing what resolution your model actually wants

By PGCRT·Created 2 years ago·Updated 7 days ago· 129
Resolution By Side (CRT)
    • width
    • height
    • latent
    side_modeLonger Side
    side_pixels1024
    modelFlux 2, ERNIE
    aspect_ratio3:2 (Landscape)
    divisible_by8

    Every model family has an opinion about resolution, and they don't agree. SDXL wants roughly 1024². Flux, Z-Image and Qwen-Image are comfortable around 1 megapixel but tolerate more. ERNIE-Image was trained only up to 1024x1024 and visibly mangles anatomy above it. Flux 2 and its Klein variants handle high resolution noticeably better than most of the field. Getting this wrong isn't a subtle quality loss - running a model well outside its trained resolution range is one of the more common, avoidable ways people tank their own output. This node exists to do that arithmetic for you instead of you memorizing a table of magic numbers per model.

    How it works

    You pick which side of the image you care about (side_mode: Shorter Side or Longer Side), how many pixels that side should be (side_pixels), which model family you're targeting, and an aspect ratio. The node works out width and height from there, rounds both to a multiple of divisible_by (most models want dimensions divisible by 8, some latent-space quirks want more), and hands you back not just the numbers but a ready-to-use empty latent at that size - so it can replace your EmptyLatentImage node entirely, not just calculate values for one.

    The model dropdown is the part that actually matters, and it's a genuine three-way split: SDXL; Flux 1 / Z-Image / Qwen-Image; or Flux 2 / ERNIE. Each of those families has a different sweet spot for what "1024" or "1 megapixel" should actually mean in practice, and picking the right bucket here is what keeps this node from just being a calculator - it's encoding real, model-specific knowledge about where each architecture starts to break down.

    The inputs and outputs that matter

    • side_mode (Shorter Side / Longer Side, default Longer Side) - which dimension side_pixels applies to.
    • side_pixels (default 1024) - the target pixel count for whichever side you picked.
    • model (SDXL / Flux 1, Z-image, Qwen-Image / Flux 2, ERNIE) - which resolution family's conventions to apply.
    • aspect_ratio - 20 presets from square through wide portrait and landscape ratios.
    • divisible_by (default 8) - the rounding constraint, tune it up if a specific model needs stricter alignment.

    Outputs: width, height (both INT, wire into anything that wants raw numbers), and latent - a ready empty latent at the computed size.

    How to install it

    Part of CRT-Nodes. Via ComfyUI Manager, search CRT-Nodes and install. Manually: git clone https://github.com/PGCRT/CRT-Nodes.git into custom_nodes, pip install -r requirements.txt, restart.

    Common issues & troubleshooting

    Output looks noticeably worse than expected at "normal" resolutions. Double-check the model dropdown matches what you're actually generating with - picking SDXL conventions while running ERNIE-Image, or vice versa, will hand you a resolution tuned for the wrong architecture even though the node ran without error.

    Anatomy mangles at higher resolutions on some models. That's not this node malfunctioning - some models genuinely degrade above their training resolution (ERNIE-Image above 1024x1024 is a documented example), and the fix is lowering side_pixels, not adjusting this node's rounding.

    Latent output doesn't match what your sampler expects. If you're chaining into a video sampler or a model with unusual latent channel requirements, this node's latent output may not be a drop-in replacement - check that the latent shape matches what your specific sampler node wants before assuming a mismatch is this node's fault.

    CategoryCRT/Utils/Logic & Values

    Inputs (5)

    NameTypeDefaultDescription
    side_modeCOMBOLonger Side2 options: Shorter Side, Longer Side
    side_pixelsINT102464–16384
    modelCOMBOFlux 2, ERNIE3 options: SDXL, Flux 1, Z-image, Qwen-Image, 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