Difforum · Keyframe Assets (folder)
Point it at a folder of pictures and they become your keyframes, in order, at the right seconds
- direction
- params
- images
- keyframes
- indices
- first
- last
- masks
- info
What it is, and why you'd bother
Every guided video render has the same boring chore in the middle: you have five great pictures and you need them to land on frames 0, 96, 240, 336 and 480, at the right aspect, in the right order. Doing that by hand in a Batch Images node means you own the arithmetic forever.
Difforum · Keyframe Assets (folder) does it from naming. Drop your stills into a folder under ComfyUI/input, point the node at it, and each picture lands on a moment - either on the Director's Keys track, on the time written in the filename, or spread evenly across the clip. The pictures can come from anywhere: an image model in a previous run, Photoshop, a photo shoot, a client. That's the point. You don't need Difforum to render a look pass first; styled stills made in any tool drive MiniMax H3 directly (that's template 16).
How it works
The folder is read in natural sort order, so 0s_wide.png, 2s_close.png, 10s_far.png come out in the order a human would sort them rather than the order a string comparison would. EXIF rotation is applied, everything is converted to RGB, and each picture is resized to the canvas from your Setup/Director parameters according to fit.
The three timing modes are handled differently, and the fallback is the part worth knowing:
- filename - the name carries the time:
4.5s_close.png(seconds × fps),f096.png(frame number), or a bare leading number like0096_rise.png. If any name in the folder has no readable time, the whole set falls back to even spacing, andinfosays so. - Director keys - pictures are dropped on the Keys markers in order.
- spread evenly - first at frame 0, last at the end.
When the number of times and the number of pictures disagree, it uses the smaller count and notes it.
The few inputs that matter
- folder - a folder inside
ComfyUI/input(defaultdifforum_keys). Paths are resolved against the input directory, so no absolute paths. - timing -
filename(default),Director keys, orspread evenly. Start with filename; it's the one you can read six months later. - fit -
cover (crop)crops to the canvas,contain (pad gray)letterboxes and hands you a mask of the padded area,stretchdistorts. If you're going into H3 Guides withcontain, wire masks into Fill Reveal (AI) and the gray bars get painted into real scenery instead of sitting there.
Optional: direction (gives it the Keys track and canvas size), params (canvas and fps when there's no Director), images (a batch from another node replaces the folder entirely), times (a manual override like 0, 4s, 9.5s).
Outputs, and where each one goes
- keyframes + indices → H3 Guides, LTX Guides or Animatic. The indices string is the frame numbers that go with the batch, which is how the video-model bridges know when each picture belongs.
- first / last → a first-last-frame model (H3 fl2va).
- masks → Fill Reveal (AI).
- info → a per-picture listing of seconds, frame, filename and any notes. Read it: it tells you when your naming didn't parse.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/chillithebillis/Difforum.git difforum
…then restart, or install via ComfyUI Manager by searching Difforum. Dependencies are honest: numpy only, everything else optional and lazily imported. Then make your folder:
mkdir -p ComfyUI/input/difforum_keys
# 0s_wide.png, 4s_close.png, 12s_reveal.png ...
Common problems
- "folder not found in ComfyUI/input". It's relative to the input directory and it must be a directory, not a glob. Nested is fine:
difforum_keys/shot07. - "no images in input/difforum_keys". Empty, or the extensions aren't png/jpg/webp.
- Everything landed evenly spaced. One filename didn't parse (
first-shot.pnghas no time in it), so filename mode gave up. Rename it or settimesby hand. - "Keyframe Assets needs a direction or params". It can't guess your canvas and fps. Wire Setup →
params, or the Director'sdirection. - Pictures arrive cropped tighter than you expected. That's
cover. Switch tocontainif edges matter more than filling the frame.
One habit worth forming: keep the folder small and named. This node is fast and stateless, so re-queueing after renaming a file is normal - it re-reads file mtimes, which means a renamed still takes effect on the next run without you touching the graph.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| folder | STRING | difforum_keys | A folder inside ComfyUI/input holding the stills (png / jpg / webp), sorted by name. |
| timing | COMBO | filename | Director keys: the pictures land on the Keys markers in order. filename: '0s_x.png', '4.5s_x.png', 'f096.png' or '0096_x.png'. spread evenly: first to last over the clip. |
| fit | COMBO | cover (crop) | cover crops to the canvas, contain pads with gray (the masks output lets Fill Reveal paint the bars), stretch distorts. |
| directionopt | DIFFORUM_DIRECTION | Gives the Keys track and the canvas size. | |
| paramsopt | DIFFORUM_PARAMS | Canvas size and fps when no direction is connected. | |
| imagesopt | IMAGE | A batch from other nodes instead of the folder (one per key, in order). | |
| timesopt | STRING | Override: '0, 4s, 9.5s' or frame numbers. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| keyframes | IMAGE | — |
| indices | STRING | — |
| first | IMAGE | — |
| last | IMAGE | — |
| masks | MASK | — |
| info | STRING | — |