Nodes/Dream Project Animation Nodes/βŒ— Common Frame Dimensions
ComfyUI Node

βŒ— Common Frame Dimensions

Stop hand-calculating resolutions that divide cleanly β€” Common Frame Dimensions

By alt-key-projectΒ·Created 3 years agoΒ·Updated 2 years agoΒ· 114
βŒ— Common Frame Dimensions
    • width
    • height
    • final_width
    • final_height
    β—„sizeβ–Ύβ–Ί
    β—„aspect_ratioβ–Ύβ–Ί
    β—„orientationβ–Ύβ–Ί
    β—„divisorβ–Ύβ–Ί
    β—„alignment64β–Ί
    β—„alignment_typeβ–Ύβ–Ί

    Every ComfyUI user has been there: you want a 16:9 video at 1920 wide, you punch 1920Γ—1080 into a node, and the sampler coughs because 1080 isn't a multiple of 8 - or you set up a tiled upscale and the tile math comes out ragged. Common Frame Dimensions [Dream] exists so you never have to do that arithmetic by hand again. Pick a size, pick an aspect ratio, and it hands you width and height that are guaranteed to land on the alignment you ask for.

    It's one of the utility nodes in the Dream Project Animation Nodes pack (alt-key-project), the 2023 Deforum-style animation suite. The pack itself is in maintenance limbo - the author moved on to comfyui-dream-video-batches - but this node is timeless and dependency-light.

    How the math works

    You give it:

    • size - the master dimension (3840, 1920, 1440, 1280, 768, 720, 640, or 512)
    • aspect_ratio - 16:9, 16:10, 4:3, 1:1, 5:4, 3:2, 21:9, or 14:9
    • orientation - wide or tall (swaps which axis is the big one)
    • divisor - divide the resolution down by 8/4/2/1 (so you can plan a render + upscale pipeline in one step)
    • alignment (INT, default 64) and alignment_type (ceil, floor, or nearest) - the rounding strategy

    It computes the true aspect-corrected dimensions, divides by the divisor, then rounds each axis up/down/nearest to the alignment multiple. Default alignment is 64, which is the sweet spot for most latent-space work - 8 is the classic minimum, and many video/AnimateDiff-style pipelines are happiest at 64.

    Outputs are width, height (the aligned, divisor-applied values you actually use) and final_width, final_height (the raw, un-aligned numbers for reference).

    Why you'd reach for it

    If you're generating video frames, the resolution has to be consistent across every frame or your encoder will hate you - this node turns "pick a cinematic look" into a single dropdown combo. And for tiled upscaling, a resolution that divides cleanly saves you from edge tiles that are a few pixels wide. The divisor input is the quiet MVP: pick 1920/16:9 with divisor 2 and you get both the 1920 render size and the 960 latent size, no mental math.

    Getting it

    cd ComfyUI/custom_nodes
    git clone https://github.com/alt-key-project/comfyui-dream-project.git
    

    Or grab it via ComfyUI Manager under "Dream Project Animation". No models, no heavy deps - just a calculator dressed as a node. It lives in the Dream β†’ utils menu. If you already have WAS Node Suite installed (which the pack author recommends anyway), this replaces the fiddle-with-a-calculator step entirely.

    Category✨ Dream/πŸ›  utils

    Inputs (6)

    NameTypeDefaultDescription
    sizeCOMBO8 options: 3840, 1920, 1440, 1280, 768, 720, +2
    aspect_ratioCOMBO8 options: 16:9, 16:10, 4:3, 1:1, 5:4, 3:2, +2
    orientationCOMBO2 options: wide, tall
    divisorCOMBO4 options: 8, 4, 2, 1
    alignmentINT641–512β€”
    alignment_typeCOMBO3 options: ceil, floor, nearest

    Outputs (4)

    NameTypeDescription
    widthINTβ€”
    heightINTβ€”
    final_widthINTβ€”
    final_heightINTβ€”