comfyui-myloadvideo
A custom node for ComfyUI that provides video loading and image batch splitting functionality.
ComfyUI-MyLoadVideo
A custom node for ComfyUI that provides video loading and image batch splitting functionality.
Features
MyLoadVideo
Load video files and extract frames as IMAGE batch for ComfyUI workflows.
Parameters:
video: Select video file from input directoryskip_first_frames: Number of frames to skip at the beginning (default: 0)frame_load_cap: Maximum number of frames to load (default: 171)
Output:
IMAGES: Image batch tensorframe_count: Number of frames loaded
Supported formats:
- MP4, AVI, MOV, MKV, GIF
MySplitImageBatch
Split or slice an IMAGE batch to extract specific frame ranges.
Parameters:
images: Input IMAGE batchstart_index: Starting frame index (0 = first frame)length: Number of frames to extractselect_every_nth: Sample every Nth frame (optional, default: 1)
Output:
IMAGES: Sliced image batchframe_count: Number of frames extracted
MyDropLastFrames
Drop the last N frames from an IMAGE batch.
Parameters:
images: Input IMAGE batchdrop_last_n: Number of frames to drop from the end (default: 5)
Output:
IMAGES: Image batch with last N frames removedframe_count: Number of frames remaining
Installation
Method 1: Clone to custom_nodes (Recommended)
cd ComfyUI/custom_nodes
git clone https://github.com/1123156819/comfyui-myloadvideo.git
Note: The main file is already named __init__.py, so no renaming is needed!
Method 2: Download ZIP
- Download from GitHub: Download ZIP
- Extract to
ComfyUI/custom_nodes/comfyui-myloadvideo - No renaming needed! The file is already
__init__.py
Requirements
- ComfyUI
- OpenCV (opencv-python)
- NumPy
- PIL (Pillow)
These are typically pre-installed with ComfyUI.
Usage Examples
Example 1: Load Video and Extract First 100 Frames
Load Video → VAE Decode → MySplitImageBatch (start=0, length=100) → Video Combine
Example 2: Extract Middle Frames (50-150)
Load Video → VAE Decode → MySplitImageBatch (start=50, length=100) → Video Combine
Example 3: Drop Last 5 Frames
VAE Decode (200 frames) → MyDropLastFrames (drop_last_n=5) → Video Combine (195 frames)
Example 4: Frame Sampling (Every 2nd Frame)
Load Video → VAE Decode → MySplitImageBatch (start=0, length=50, select_every_nth=2) → Video Combine
Example 5: Combined Usage
VAE Decode (200 frames)
↓
MySplitImageBatch (start=10, length=150)
↓
MyDropLastFrames (drop_last_n=5)
↓
Video Combine (145 frames)
Parameter Details
MyLoadVideo
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| video | File | Required | Video file from input directory |
| skip_first_frames | Int | 0 | Frames to skip at start |
| frame_load_cap | Int | 171 | Maximum frames to load |
MySplitImageBatch
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| images | IMAGE | Required | Input image batch |
| start_index | Int | 0 | Starting frame index (0-based) |
| length | Int | 100 | Number of frames to extract |
| select_every_nth | Int | 1 | Sample interval (1=all, 2=every 2nd, etc.) |
MyDropLastFrames
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| images | IMAGE | Required | Input image batch |
| drop_last_n | Int | 5 | Number of frames to drop from end |
Use Cases
- Video Trimming: Load a video and trim to specific frame range
- Frame Sampling: Extract every Nth frame for analysis or processing
- Batch Processing: Process only specific portions of video sequences
- Memory Optimization: Load only needed frames to reduce memory usage
- Remove Unwanted Frames: Drop last N frames to remove artifacts at video end
Troubleshooting
Video not showing in dropdown?
- Ensure video file is in ComfyUI's
inputdirectory - Supported formats: MP4, AVI, MOV, MKV, GIF
Out of memory errors?
- Reduce
frame_load_caporlengthparameter - Process video in chunks
Node not appearing?
- Restart ComfyUI after installation
- Check console for import errors
License
MIT License
Author
GitHub: @1123156819
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.