Nodes/Lyonir Studio/๐Ÿบ Lyonir Resolution
ComfyUI Node

๐Ÿบ Lyonir Resolution

Ask for 720p, Generate 768, Crop Back โ€” Why Lyonir Resolution Rounds Up

By LyonirยทCreated 24 days agoยทUpdated 8 days agoยท 3
๐Ÿบ Lyonir Resolution
    • width
    • height
    โ—„width1920โ–บ
    โ—„height1080โ–บ
    โ—„model_familyautoโ–บ

    Video models can't generate arbitrary pixel sizes, but that's a detail you shouldn't have to keep in your head while typing a resolution. ๐Ÿบ Lyonir Resolution is the node that lets you ask for the size you want and quietly handles the arithmetic. It has two integer outputs and does no resizing at all. The trick is that they're not quite integers.

    The problem it solves

    Say you want finished 720ร—1280 LTX video. LTX spatial latents are 32x compressed, so the latent dimensions need to be nice numbers, and LTX IC-LoRA workflows that use a downscale factor of 2 need both latent width and height even - which in pixel terms means the native canvas has to be a multiple of 64. 720 is not a multiple of 64. 768 is. So the honest path is: generate 768ร—1280, then crop the extra back off after decode. Doing that by hand means typing 768 into your latent node and 720 into your crop node and keeping the two in sync forever.

    This node collapses that into one place. You type 720ร—1280, it sends 768ร—1280 upstream to whatever creates the latent, and it carries "the final size is actually 720ร—1280" along the wire as metadata so ๐Ÿบ Lyonir Sampler can hard-crop back to exactly what you asked for.

    How the trick works

    The two outputs are INTs - but instances of an int subclass that also carries requested_value, native_value, model_family, and alignment. Upstream nodes that only care about a number see the number (toString/int() behavior is unchanged, so an EmptyLTXVLatentVideo width socket is happy). The Lyonir Sampler knows to look for the extra attributes: it generates on the native canvas and crops the decoded frames to the requested size.

    Rounding is ceil to the grid, per family. ltx gets a 64-pixel alignment because of the IC-LoRA downscale-2 constraint and to match the official LTX resolution guidance. Everything else - auto, minimax, bernini, wan - keeps a 32-pixel alignment, deliberately, so the MiniMax path stays exactly as it was. auto doesn't get a special grid of its own; it falls through to 32.

    The crop is anchored, not automatic. crop_anchor lives on the Sampler, not here, and default center splits the excess evenly. For LTX 720ร—1280 that means 24 pixels off each side. If you care which 24 pixels you lose - a subject near the left edge - pick left or right on the Sampler instead.

    And no, nothing upscales. The README and the node description both repeat it, and the code enforces it: if the decoded frame comes back smaller than your requested size, you get an error telling you to use Resolution upstream, not a sneaky resize.

    Inputs and outputs

    Three required inputs: width and height (INT, 1โ€“16384, defaulting to 1920ร—1080) and model_family (the same five-way combo the rest of the pack uses).

    Two outputs: width and height, both INT. Fan the same two outputs to every node that needs a size - the latent creation node, the conditioning node, and the Sampler's target_width/target_height. For LTX specifically, wiring Resolution into the latent node is not optional; the Sampler validates the decoded latent size against your request and raises an error pointing out that Resolution must be connected to the latent creation node, not just to the Sampler.

    If you skip this node entirely you can still type numbers straight into target_width/target_height - plain ints work, they just skip the rounding and the crop target, meaning requested size equals native size and any off-grid size is your problem.

    Install

    Same pack install as everything else - ComfyUI Manager (search ComfyUI-Lyonir-Studio), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Lyonir/ComfyUI-Lyonir-Studio.git
    python -m pip install -r ComfyUI-Lyonir-Studio/requirements.txt
    

    Then restart. No models, no FFmpeg, no Python deps of its own beyond the pack-level ones.

    Where people trip

    Wiring it to one node and not the others. The most common real failure is Resolution feeding the Sampler but not the latent node, which produces a canvas that doesn't match the expectation. The pack's error message spells this out, which is more than most nodes do.

    Expecting the output to be the size you typed. Watch the Sampler's info string: it reports requested, input_native_hint and decoded_final separately. A 720-wide request printing a 720-wide decoded_final with crop=hard is correct behavior, not a rounding bug.

    Mismatched family between this node and the Sampler. auto here and ltx there (or vice versa) makes the two nodes disagree about which grid applies. Run one ๐Ÿบ Lyonir Model Family node into both.

    Odd sizes that were never going to work. Because the grid is 64 or 32 pixels wide, extreme aspect ratios round up more than you'd expect. Ask for 100ร—100 on the ltx grid and you get a 128ร—128 canvas cropped back. Fine for a test, silly for a real render.

    CategoryLyonir Studio/Utils

    Inputs (3)

    NameTypeDefaultDescription
    widthINT19201โ€“16384โ€”
    heightINT10801โ€“16384โ€”
    model_familyCOMBOauto5 options: auto, minimax, ltx, bernini, wan

    Outputs (2)

    NameTypeDescription
    widthINTโ€”
    heightINTโ€”