ComfyUI Extension: ComfyUI S4Motion
A set of ComfyUI nodes for animating a foreground layer over a background, with unified timing and high-quality composition. It includes effectors for rotation, position, path-following position, scale, opacity, distortion, and masking, plus a core node that composes frames and exports APNG/WEBP and a frame sequence.
Custom Nodes (0)
README
ComfyUI-S4Motion
Version: 1.4.0
A comprehensive motion animation toolkit for ComfyUI, providing 13 professional-grade motion control nodes for creating dynamic animations with production-ready quality and reliability.
π Features
Core Motion Controls
- πMotion Config - Central configuration hub for motion animations
- πMotion Position - Precise position animation with smooth curves
- πMotion Position On Path - Path-based motion control for complex trajectories
- πMotion Rotation - Smooth rotation animations with customizable pivot points
- πMotion Scale - Dynamic scaling effects with proportional controls
- πMotion Opacity - Alpha channel animation for fade effects
Advanced Effects
- πMotion Distortion - Professional distortion effects (Wave, Vortex, Radial)
- πMotion Shake - Realistic shake and vibration effects
- πMotion Mask - Animated mask controls for selective effects
Video Processing
- πVideo Crop - Precise video cropping with animation support
- πVideo Frames - Advanced frame extraction and processing
- πVideo Combine - Concatenate two videos or image sequences in time sequence
- πVideo Info - Analyze video or image sequence properties (dimensions, frame count, duration, FPS)
π¦ Installation
Method 1: ComfyUI Manager (Recommended)
- Open ComfyUI Manager
- Search for "S4Motion"
- Click Install
- Restart ComfyUI
Method 2: Manual Installation
- Navigate to your ComfyUI custom_nodes directory:
cd ComfyUI/custom_nodes/
- Clone this repository:
git clone https://github.com/S4MUEL-404/ComfyUI-S4Motion.git
- Install dependencies:
pip install -r ComfyUI-S4Motion/requirements.txt
- Restart ComfyUI
π§ Dependencies
The plugin features intelligent dependency management with graceful fallbacks:
Core Dependencies (Required)
- PyTorch - Core tensor operations and ComfyUI compatibility
- Pillow - Professional image processing and animation frames
- NumPy - High-performance numerical computing for motion curves
Optional Dependencies (Enhanced Features)
- OpenCV - Video processing and advanced distortion effects
- Scikit-image - High-quality image transformations
- SciPy - Scientific computing for advanced motion curves
- Bezier - Professional motion curve calculations
All dependencies are automatically validated at startup with production-quality logging and fallback mechanisms.
π Usage
- Find Nodes: All S4Motion nodes are prefixed with π in the ComfyUI node browser
- Categories: Look under "πS4Motion" category
- Production Ready: All nodes include comprehensive error handling and logging
- Examples: Check the
examples/
folder for workflow documentation
Quick Start Example
- Add Motion Config node to establish animation timeline
- Connect motion effector nodes (Position, Rotation, Scale, etc.)
- Configure motion parameters and curves
- Connect to your image/video processing workflow
- Execute animation
π― Key Features
- β Production Quality - Enterprise-grade error handling and validation
- β Smart Dependencies - Automatic dependency management with fallbacks
- β Motion Curves - Professional easing with Bezier curve support
- β Timeline Control - Precise timing with delay, duration, and loop options
- β Advanced Effects - Wave, vortex, and radial distortion capabilities
- β Video Support - Comprehensive video processing and frame control
- β Path Animation - Complex trajectory support for sophisticated motion
π Project Structure
ComfyUI-S4Motion/
βββ py/ # Core node implementations
β βββ motionConfig.py # Central motion configuration
β βββ motionPosition.py # Position animation control
β βββ motionRotation.py # Rotation effects
β βββ motionScale.py # Scaling animations
β βββ motionOpacity.py # Opacity/alpha control
β βββ motionPositionOnPath.py # Path-based motion
β βββ motionDistortion.py # Distortion effects
β βββ motionShake.py # Shake/vibration effects
β βββ motionMask.py # Animated masking
β βββ videoCrop.py # Video cropping
β βββ videoFrames.py # Frame processing
β βββ videoCombine.py # Video combination
β βββ videoInfo.py # Video analysis
βββ examples/ # Usage examples and workflows
βββ summary_md/ # Development summaries and notes
βββ __init__.py # Plugin initialization
βββ dependency_manager.py # Dependency management
βββ requirements.txt # Python dependencies
π¨ Motion Curves
S4Motion supports professional easing functions:
- Linear - Constant speed motion
- Ease In - Gradual acceleration
- Ease Out - Gradual deceleration
- Ease In Out - Smooth acceleration and deceleration
With optional Bezier curve support for ultra-smooth professional animations.
π Animation Controls
Each motion node supports:
- Duration - Animation length in seconds
- Delay - Start delay for sequenced animations
- Inverse - Reverse motion for return-to-origin effects
- Loop - Continuous repetition for endless animations
π€ Contributing
Contributions are welcome! Please feel free to submit pull requests or report issues.
π License
This project is open source. Please respect the licensing terms.
Author: S4MUEL
Website: s4muel.com
Version: 1.4.0