πΎ Image Sequence Loader
Load frame N back into the graph β the loop that keeps Deforum-style renders coherent
- frame_counter
- default_image
- image
- frame_name
The core loop of Deforum-style animation is "render frame N, feed it back in as the starting image for frame N+1." Image Sequence Loader [Dream] is the half of that loop that reaches back into the folder of already-rendered frames and pulls the right one out. If you've ever built a frame-by-frame animation in ComfyUI you've hand-rolled this node's job with a dozen Load Image nodes and a file-name hack; this does it in one.
It's part of the Dream Project Animation Nodes pack - a frame-by-frame animation toolkit from 2023 by qaozmojo, the "Alt Key Project" music channel. The pack is no longer actively updated (the author moved to comfyui-dream-video-batches), but the loader is still one of the cleanest ways to do the frame feedback loop.
How it works
You feed it a frame_counter plus a directory_path and a pattern (default *). It scans the directory, builds a map of frame number β image file(s), and returns whatever image matches the counter's current frame. Two details are worth knowing:
indexing:numericreads the trailing digits from each filename (frame_0042.pngβ 42);alphabetic orderjust sorts filenames and numbers them in sequence. If your renderer writes zero-padded numbered files,numericis what you want.- Sub-batches: if it finds
batch_0001,batch_0002β¦ subdirectories it scans those in order, so it handles the way this pack's Image Sequence Saver lays things out.
The output is an image plus a frame_name STRING (the basename of the file it loaded), which is handy for logging or filename-based conditionals.
The one input people miss is default_image (optional). When there's no file for the current frame - frame 0, or a gap - the node returns this instead of nothing. Wire a static image here and your very first frame still has something to process instead of blowing up the graph.
Wiring it in
The classic pattern: Frame Counter (Simple or Directory) β Image Sequence Loader β VAE encode β sampler β save. The loader gives you the previous rendered frame as the img2img base, so the animation stays anchored to what actually came before it. IS_CHANGED is a constant NaN in the source, which means ComfyUI always re-runs the node - you don't get stale-cache surprises mid-render.
Installing and notes
cd ComfyUI/custom_nodes
git clone https://github.com/alt-key-project/comfyui-dream-project.git
Or install via ComfyUI Manager under "Dream Project Animation". It's pure Python - imageio, scipy, torchvision, and friends - no model downloads. Watch out for the pack's numpy<2.0 pin if another node pack wants NumPy 2. Find it under Dream β image β animation.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| frame_counter | FRAME_COUNTER | β | |
| directory_path | STRING | β | |
| pattern | STRING | * | β |
| indexing | COMBO | 2 options: numeric, alphabetic order | |
| default_imageopt | IMAGE | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| frame_name | STRING | β |