Extensions/comfyui-frame-step
ComfyUI Extension

comfyui-frame-step

This package provides teaching nodes for temporal/motion video processing in ComfyUI.

By NobutakaKuroki·Created 11 days ago·Updated 10 days ago· 1
NobutakaKuroki/comfyui-frame-step
Nodes4
On cloudLocal install
CategoryKULab/Video
Stars1
Updated10 days ago
Readme

ComfyUI-Frame-Step

Step through a VIDEO one frame at a time, delay a frame for frame differencing, detect the moving area between two frames, and capture straight from a server-side camera.

Workflow3

This package provides teaching nodes for temporal/motion video processing in ComfyUI: reading a video frame-by-frame without decoding the whole thing into memory, a one-step delay line for frame-to-frame comparisons, a ready-made motion-detection mask, and a lightweight live-camera source.


Features

  • Reads a VIDEO one frame at a time via PyAV's streaming decoder - never loads the whole clip into memory at once
  • frame_index uses the same seed-style control_after_generate pattern as core's RandomNoise/KSampler, so playing forward is just hitting Run repeatedly, and rewinding is just resetting the widget to 0
  • Configurable end-of-video behavior: loop back to the start, or stop with a clear error
  • A one-frame delay line (z^-1), the building block for frame-to-frame differencing and motion detection
  • A ready-made motion-detection mask (luma-weighted difference, threshold, optional dilation) bundling what would otherwise take several separate nodes
  • Camera Capture grabs a frame directly from a camera on the machine running the ComfyUI server (via OpenCV), instead of asking the browser for one like core's Webcam Capture does - no stacked live-preview/captured-image widgets, just a plain IMAGE output, so it drops straight into any workflow built around Video Frame Reader

Included Nodes

Video

  • Video Frame Reader
  • Frame Delay
  • DetectMovingArea
  • Camera Capture

Sample Workflows

Sample input video is included in the examples folder. Copy it to your ComfyUI input folder.

Camera Capture is a drop-in swap for Video Frame Reader in every lesson below (same IMAGE output) - useful if a live camera is more convenient than a sample video, or if core's Webcam Capture isn't working for you.

Lesson 1. Video Frame Reader

Workflow1


Lesson 2. Frame Export

Workflow2


Lesson 3. Frame Delay

Workflow3


Lesson 4. Motion Echo

Workflow4


Lesson 5. Frame Difference

Workflow5


Lesson 6. DetectMovingArea

Workflow6


Installation

Clone this repository into your ComfyUI custom_nodes folder.

ComfyUI/
└── custom_nodes/
    └── comfyui-frame-step/

Then install the Python dependencies:

pip install -r requirements.txt

Restart ComfyUI after installation.


Companion Packages

Lesson 5 (Frame Difference) uses Image Subtract / Preview Signed Image from comfyui-signed-image - install it alongside this package to run that workflow. The other five lessons only need ComfyUI core nodes.


License

See the repository license file for details.