Nodes/Difforum/Difforum · Anim Setup+ (time + aspect)
ComfyUI Node

Difforum · Anim Setup+ (time + aspect)

Anim Setup+ does the math for your GPU

By chillithebillis·Created 3 months ago·Updated about a month ago· 7
Difforum · Anim Setup+ (time + aspect)
    • params
    • width
    • height
    • max_frames
    • info
    duration_modeseconds
    duration5.0
    fps24
    aspect16:9 landscape
    resolution768 standard
    fit_tomac 24GB
    snap8
    seed0
    custom_long_edge768
    custom_aspect_w16.0
    custom_aspect_h9.0

    The plain Anim Setup node makes you pick width, height, fps, and frame count like it's 1998. Difforum · Anim Setup+ is the version that thinks for you. Instead of raw pixels and frame counts, you tell it how long the clip is, what shape it is, and what machine it's running on - and it hands back a params object plus the resolved width, height, and max_frames as separate outputs, so you can see exactly what it decided.

    Here's the flow that makes it worth using. Three inputs do almost everything:

    • duration_mode + duration - "frames" or "seconds." This is the nicest touch in the node: at 24fps, 5 seconds and 120 frames are the same clip, so you get to plan in whichever unit matches how you're thinking about the piece. Pick seconds for music timing, frames for exact Deforum-style keyframe work. max_frames is derived for you.
    • aspect - nine ratios from 16:9 landscape down to 2.39:1 anamorphic, plus custom. Each entry even carries its own label ("16:9 landscape", "9:16 vertical"), which saves the usual "wait, which dimension was that?" fumble.
    • resolution - a long-edge target from 384 thumbnail to 1280 oversize, then fit_to clamps it to a hardware budget: mac 16GB up to gpu 24GB+ and no limit. That's the part the basic node won't do - it refuses to hand you a resolution your machine can't finish a feedback render at.

    snap is a quiet but important detail: it rounds both dimensions to a multiple of 8 by default, and you should set it to 16 for anything heading into Wan 2.2, or Wan's VAE will throw at decode time. The optional custom_long_edge, custom_aspect_w, and custom_aspect_h inputs are only used when you pick custom in the relevant dropdown - ignore them otherwise.

    Outputs: params (the same DIFFORUM_PARAMS object every Difforum node consumes), then width, height, and max_frames as plain INTs you can read or feed into other nodes, and an info STRING that explains the resolution decision and any clamping it did. The info string is genuinely worth reading once - it tells you why it picked 768 over 896, which is the kind of thing you only learn by burning a render on the wrong size.

    Install

    Same as the rest of the pack - no extra dependencies:

    cd ComfyUI/custom_nodes
    git clone https://github.com/chillithebillis/Difforum.git difforum
    

    Then restart ComfyUI (watch for [Difforum] loaded N nodes in the console), or just search "Difforum" in ComfyUI Manager. The pack's only runtime dep is numpy, which ComfyUI already has.

    Where people get burned

    • The budget isn't magic. fit_to clamps based on sensible heuristics for each hardware tier, not by measuring your actual free VRAM mid-render. It's a safe starting point, not a guarantee - a gpu 8GB with two models loaded can still OOM. Drop resolution a notch if a render dies.
    • Seconds vs frames rounding. In seconds mode it computes duration × fps and rounds, so 5.0s at 24fps is exactly 120, but odd values (e.g. 24.4 fps) can land a frame off what you expected. Keep fps clean.
    • Snap to 16 for Wan. If you ignore this and feed a Guide Builder → Wan graph, the VAE decode failure is your clue, not the Setup node.

    Which Setup should you use? If you know your canvas and clip length cold, the plain node is fine. If you're planning a piece - especially for a different machine or an unfamiliar aspect ratio - Plus is the one that stops you from shipping a 21:9 clip at square resolution because you didn't feel like doing the math.

    CategoryDifforum

    Inputs (11)

    NameTypeDefaultDescription
    duration_modeCOMBOseconds2 options: frames, seconds
    durationFLOAT5.00.1–100000
    fpsFLOAT241–120
    aspectCOMBO16:9 landscape9 options: 16:9 landscape, 9:16 vertical, 4:3 classic, 3:4 portrait, 1:1 square, 21:9 ultrawide, +3
    resolutionCOMBO768 standard8 options: 384 thumbnail, 512 draft, 640 fast, 768 standard, 896 high, 1024 max, +2
    fit_toCOMBOmac 24GB9 options: mac 16GB, mac 24GB, mac 32GB, mac 64GB+, gpu 8GB, gpu 12GB, +3
    snapCOMBO82 options: 8, 16
    seedINT00–18446744073709550000
    custom_long_edgeoptINT76864–8192
    custom_aspect_woptFLOAT16.00.1–100
    custom_aspect_hoptFLOAT9.00.1–100

    Outputs (5)

    NameTypeDescription
    paramsDIFFORUM_PARAMS
    widthINT
    heightINT
    max_framesINT
    infoSTRING