Difforum · Anim Setup+ (time + aspect)
Anim Setup+ does the math for your GPU
- params
- width
- height
- max_frames
- info
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 secondsand120 framesare 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_framesis derived for you.aspect- nine ratios from16:9 landscapedown to2.39:1 anamorphic, pluscustom. 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 from384 thumbnailto1280 oversize, thenfit_toclamps it to a hardware budget:mac 16GBup togpu 24GB+andno 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_toclamps 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 - agpu 8GBwith two models loaded can still OOM. Dropresolutiona notch if a render dies. - Seconds vs frames rounding. In
secondsmode it computesduration × fpsand 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.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| duration_mode | COMBO | seconds | 2 options: frames, seconds |
| duration | FLOAT | 5.00.1–100000 | — |
| fps | FLOAT | 241–120 | — |
| aspect | COMBO | 16:9 landscape | 9 options: 16:9 landscape, 9:16 vertical, 4:3 classic, 3:4 portrait, 1:1 square, 21:9 ultrawide, +3 |
| resolution | COMBO | 768 standard | 8 options: 384 thumbnail, 512 draft, 640 fast, 768 standard, 896 high, 1024 max, +2 |
| fit_to | COMBO | mac 24GB | 9 options: mac 16GB, mac 24GB, mac 32GB, mac 64GB+, gpu 8GB, gpu 12GB, +3 |
| snap | COMBO | 8 | 2 options: 8, 16 |
| seed | INT | 00–18446744073709550000 | — |
| custom_long_edgeopt | INT | 76864–8192 | — |
| custom_aspect_wopt | FLOAT | 16.00.1–100 | — |
| custom_aspect_hopt | FLOAT | 9.00.1–100 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| params | DIFFORUM_PARAMS | — |
| width | INT | — |
| height | INT | — |
| max_frames | INT | — |
| info | STRING | — |