29915698e524a2f8cedd33e5abec69081fcfe68b
This resolves aggressive caching bugs in newer ComfyUI versions.
Replaced float("NaN") with time.time() in image.py and loop.py
to ensure stateful memory/trigger nodes consistently fire.
ComfyUI Sequential Batcher (v1.0.0)
A highly specialized suite of custom nodes for ComfyUI designed for Recursive Self-Queuing and autonomous sequential processing. This architecture minimizes VRAM usage by processing heavy tasks (like video generation) sequentially, batch-by-batch, orchestrated entirely from within the graph.
Read in Spanish: README_ES.md
The "Formula 1" Engine Architecture
Starting with v1.0.0, this repository has pivoted exclusively to the autonomous sequential loops and global memory architecture. All legacy technical debt (deprecated batch/sequence/debug nodes) has been pruned, leaving a clean, highly maintainable codebase focused on 6 core nodes.
The 6 Core Nodes
The system is built around three major categories:
🔁 Loop (Autonomous Orchestration)
- 🏁 Loop Start (Index) (
SequentialLoopStart): Initiates the loop, manages the global loop index, and provides the current iteration index to downstream nodes. - 🚀 Loop Trigger (Auto-Queue) (
SequentialLoopTrigger): Placed at the very end of your workflow. It increments the loop counter and autonomously triggers an HTTP POST request to the ComfyUI API (/prompt) to queue the next batch cycle.
🖼️ Image (Session Memory)
- 📥 Session Image Receiver (
SessionImageReceiver): Retrieves the initial image or the last generated frame from the previous cycle, intelligently detecting the start of a session. - 📤 Session Image Sender (
SessionImageSender): Extracts, saves to global memory, and displays the last frame of a video batch for the next cycle to use.
🎞️ Video (Assembly and Validation)
- 🛡️ Wan Frame Validator (
WanFrameValidator): Validates and corrects the target number of frames to ensure they fit the4k+1formula required by specific models (e.g., Wan). - 🎞️ Incremental Auto-Stitcher (
IncrementalVideoStitcher): Assembles the generated video chunks of the current session sequentially using FFmpeg, parsing outputs natively from theVHS_FILENAMESformat.
Setup & Usage
Prerequisites
- FFmpeg: Must be installed and available in your system's PATH for the
Incremental Auto-Stitcherto function correctly.
Installation
- Navigate to your ComfyUI
custom_nodesfolder. - Clone this repository:
git clone https://github.com/your-repo/ComfyUI-Sequential-Batcher.git - Restart ComfyUI.
How to use the Autonomous Machine
- The Start: Add the
🏁 Loop Start (Index)node. Connect itscurrent_loop_indexto the index inputs of your receiver and stitcher nodes. Ensurereset_loopis set toFalse. - The End: Add the
🚀 Loop Trigger (Auto-Queue)node. Crucially, connect the text output (final_video_path) from yourIncremental Auto-Stitcherto thetrigger_dependencyinput. This forces the trigger to wait until the video is physically saved. Set your desiredtarget_loops. - Execution: You no longer need to check "Auto Queue". Just press "Queue Prompt" once. The workflow will run the first batch, and upon finishing, the trigger will invisibly signal the server to queue the next batch until the target is reached, at which point it stitches everything together and finishes.
Created to push the boundaries of ComfyUI automation.
Languages
Python
99.2%
JavaScript
0.8%