Nodes/DIGIT Nodes/DIGIT Frame Size
ComfyUI Node

DIGIT Frame Size

Stop doing aspect-ratio math in your head

By thedepartmentofexternalservices·Created 7 months ago·Updated 2 months ago· 0
DIGIT Frame Size
    • width
    • height
    • megapixels
    • size_string
    ◄presetHD 16:9 — 1920×1080►
    ◄width_override0►
    ◄height_override0►

    Every ComfyUI user has a "what resolution is 2.39:1 at 2K anyway?" moment. This node is the answer to that question, pre-solved: pick a preset from a dropdown and it hands you the width, the height, the megapixels, and a ready-to-paste WIDTHxHEIGHT string. It's a pure utility node - no API, no model, no cost - but it quietly kills one of the most annoying little chores in building a workflow.

    The pitch is specifically for people who jump between aspect ratios for a living - video work where 16:9, 9:16, and 21:9 all live in the same project. Instead of typing 2560x1440 from memory or opening a calculator, you pick "HD 16:9" and the numbers come out the other side as clean INTs you can feed anywhere.

    How it works

    There are 46 presets organized by size tier - Large / Medium / Small - and then by aspect ratio. The lineup covers square 1:1, photo 4:5 and 5:4, standard 4:3 and 3:4, classic 3:2 and 2:3, HD 16:9 and 9:16 (up to 4K), ultrawide 21:9, anamorphic 2.39:1, IMAX 1.43:1, and SD 480p. Each preset maps to an exact pixel size.

    The inputs:

    • preset - the dropdown. The default is "HD 16:9 - 1920×1080".
    • width_override / height_override - optional. Set either to a non-zero value and it overrides the preset on that axis. Handy when you want the preset's shape but a specific edge.

    The outputs are four different views of the same answer:

    • width and height - INTs, the actual pixels.
    • megapixels - FLOAT, width × height / 1,000,000. Useful when you're budgeting against a model's resolution limits.
    • size_string - a 1920x1080 string, ready to pipe into nodes that want a resolution as text.

    Where it shines is wiring: feed width and height into an Empty Latent Image or an image-generation node's size inputs and every aspect ratio change is one dropdown click instead of two typed numbers.

    Install

    Part of the comfyui-digit pack (53 nodes, so installing gets you the whole family). ComfyUI Manager → search comfyui-digit → install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/thedepartmentofexternalservices/comfyui-digit.git
    cd comfyui-digit
    pip install -r requirements.txt
    

    Restart ComfyUI, look under the DIGIT category.

    Common issues

    There's very little to break here because there's no mechanism to break - it's a lookup table. The one habit worth forming: when you use width_override or height_override, remember it overrides just that axis, so a preset plus a width override gives you a size the preset didn't promise. That's by design, but it's easy to glance at the preset name later and forget the override is sitting there.

    If a downstream node rejects the resolution, check whether it wants multiples of 8 or 16 - the presets are sized to standard model-friendly values, but if you've overridden, it's on you to keep the math friendly. One more practical note: the pack's other generation nodes (Gemini Image, GPT Image, and friends) pick their own aspect ratios from their own dropdowns, so this node earns its keep mostly with local pipelines and Empty Latent Image setups, not the cloud gen nodes.

    CategoryDIGIT

    Inputs (3)

    NameTypeDefaultDescription
    presetCOMBOHD 16:9 — 1920×108046 options: — Large —, Square 1:1 — 2048×2048, Square 1:1 — 2560×2560, Photo 4:5 — 2048×2560, Photo 5:4 — 2560×2048, Standard 4:3 — 2560×1920, +40
    width_overrideoptINT00–16384If non-zero, overrides the preset width.
    height_overrideoptINT00–16384If non-zero, overrides the preset height.

    Outputs (4)

    NameTypeDescription
    widthINTFrame width in pixels.
    heightINTFrame height in pixels.
    megapixelsFLOATTotal megapixels (width × height / 1,000,000).
    size_stringSTRINGWIDTHxHEIGHT string for display or piping.