Advanced CLI for Easy-Diffusion with Hybrid GPU+CPU Processing & Temporal Smoothing
Transform videos using AI diffusion with intelligent GPU+CPU load balancing, automatic hardware optimization, and professional-grade temporal smoothing for flicker-free results.
# Basic video transformation with auto-optimization
./video-diffusion.sh --video "input.mp4" --prompt "watercolor painting"
# Professional quality with temporal smoothing
./video-diffusion.sh --video "input.mp4" --prompt "Van Gogh starry night style" \
--smoothing init --smoothing-strength 0.4# Automatically balance load between GPU and CPU servers
./video-diffusion.sh --video "input.mp4" --prompt "digital art masterpiece" \
--hybrid-processing --gpu-ports "9000" --cpu-ports "9010"
# Multiple server configuration
./video-diffusion.sh --video "input.mp4" --prompt "photorealistic rendering" \
--hybrid-processing --gpu-ports "9000,9001" --cpu-ports "9010,9011"# GPU with automatic CPU fallback when overloaded
./video-diffusion.sh --video "input.mp4" --prompt "oil painting style" \
--cpu-fallback --gpu-ports "9000" --cpu-ports "9010"# Use previous frame as init image for consistency
./video-diffusion.sh --video "input.mp4" --prompt "dreamy landscape" \
--smoothing init --smoothing-strength 0.4# Optical flow-based frame blending for smooth motion
./video-diffusion.sh --video "input.mp4" --prompt "flowing water scene" \
--smoothing optical --smoothing-strength 0.3# Multi-frame temporal filtering for film-like quality
./video-diffusion.sh --video "input.mp4" --prompt "cinematic sequence" \
--smoothing temporal --smoothing-strength 0.5- GPU+CPU Load Balancing: Automatically distributes work between GPU and CPU servers
- Intelligent Server Selection: Real-time load monitoring and optimal server routing
- Automatic Failover: Seamless CPU fallback when GPU servers are overloaded
- Multi-Instance Support: Configure multiple GPU and CPU server ports
- Hardware Auto-Detection: Optimizes settings based on available CPU cores and RAM
- Auto Frame Rate Detection: Matches source video FPS automatically or customize
- Smart Video Naming: Uses first 3 prompt words + options + timestamp
- Parallel Frame Extraction: Multi-threaded ffmpeg processing
- Batch Processing: Intelligent batching for optimal throughput
- Hardware-Accelerated Encoding: NVENC, VAAPI, or optimized software encoding
- Init Smoothing: Uses previous generated frame as initialization (best balance)
- Optical Flow: FFmpeg-based frame blending for motion consistency
- Temporal Filtering: Multi-frame weighted averaging for maximum smoothness
- Configurable Strength: Adjustable smoothing intensity (0.0-1.0)
- Automatic Hardware Tuning: Detects CPU cores and RAM for optimal settings
- Concurrent Request Management: Semaphore-based parallel processing
- Minimal Request Delays: Optimized timing (0.005-0.05s) based on hardware
- Server Health Monitoring: Real-time availability and load checking
๐ฏ Recommended for Most Use Cases:
--smoothing init: Use previous generated frame as init image (reduces flicker, forces sequential processing)
๐ For Motion-Heavy Content with Parallel Processing:
--smoothing optical: Optical flow-based frame blending--smoothing temporal: Temporal filtering using neighboring frames
โ๏ธ Advanced Options:
--smoothing none: No smoothing (fastest, but may flicker)--smoothing-strength 0.0-1.0: Adjust smoothing intensity (default: 0.3)
optical or temporal smoothing methods.
Usage: video-diffusion.sh --video "/path/to/video.mp4" --prompt "Your prompt"
Required arguments:
--video "/path/to/video.mp4" # Input video file
--prompt "Your prompt here" # AI transformation prompt
๐ Performance & Processing:
[--hybrid-processing] # Enable GPU+CPU hybrid processing
[--cpu-fallback] # Enable CPU fallback when GPU overloaded
[--gpu-ports "9000,9001"] # GPU server ports (comma-separated)
[--cpu-ports "9010,9011"] # CPU server ports (comma-separated)
[--max-concurrent NUM] # Max concurrent API requests (auto-detected)
[--parallel-jobs NUM] # Parallel frame extraction jobs (auto-detected)
[--batch-size NUM] # Frames per batch (auto-detected)
[--sequential] # Disable parallel processing
[--delay SECONDS] # Delay between requests (0.005-0.05)
๐ฏ Temporal Smoothing:
[--smoothing METHOD] # Smoothing: init|optical|temporal|none
[--smoothing-strength FLOAT] # Smoothing intensity 0.0-1.0 (default: 0.3)
๐ฌ Video & Frame Control:
[--fps FPS] # Frames per second (auto-detected from source)
[--start-frame NUM] # Start processing from frame number
[--end-frame NUM] # Stop at frame number
[--keep-frames] # Preserve extracted frames
[--no-video] # Generate images only, skip video creation
๐จ AI Generation Parameters:
[--model MODEL] # AI model (default: sd-v1-5.safetensors)
[--seed SEED] # Random seed for reproducible results
[--negative-prompt "TEXT"] # What to avoid in generation
[--num-inference-steps STEPS] # Quality vs speed (default: 46)
[--guidance-scale SCALE] # Prompt adherence (default: 7.5)
[--prompt-strength STRENGTH] # Init image influence (default: 0.5)
[--width WIDTH] # Output width (default: 512)
[--height HEIGHT] # Output height (default: 512)
๐ Output & Debug:
[--save-to-disk-path PATH] # Output directory (default: ./output/)
[--session_id ID] # Session identifier
[--temp-dir PATH] # Temporary frames directory
[--debug] # Enable comprehensive debug output| Method | Description | Best For | Performance | Processing |
|---|---|---|---|---|
| init | Uses previous generated frame as init image | General use, best balance | โญโญโญโญโญ | Sequential* |
| optical | Optical flow-based frame blending | Motion-heavy content | โญโญโญโญ | Parallel |
| temporal | Multi-frame temporal filtering | Maximum consistency | โญโญโญ | Parallel |
| none | No smoothing (fastest) | Testing, speed priority | โญโญโญโญโญ | Parallel |
*Init smoothing automatically switches to sequential processing to ensure each frame uses the previously generated frame as initialization. This provides the best quality and consistency but processes one frame at a time.
# Simple transformation with auto-optimization
./video-diffusion.sh --video "input.mp4" --prompt "watercolor painting"
# Test with limited frames (recommended for first run)
./video-diffusion.sh --video "input.mp4" --prompt "Van Gogh style" --end-frame 10# GPU+CPU hybrid for maximum performance
./video-diffusion.sh --video "input.mp4" --prompt "cyberpunk city" \
--hybrid-processing
# With temporal smoothing for professional quality
./video-diffusion.sh --video "input.mp4" --prompt "anime artwork" \
--hybrid-processing --smoothing init --smoothing-strength 0.4# Maximum quality with temporal filtering
./video-diffusion.sh --video "input.mp4" --prompt "cinematic masterpiece" \
--smoothing temporal --smoothing-strength 0.5 --num-inference-steps 50
# Professional workflow with custom settings
./video-diffusion.sh --video "input.mp4" --prompt "oil painting portrait" \
--hybrid-processing --smoothing init --fps 24 --guidance-scale 8.0# Speed priority (testing/previews)
./video-diffusion.sh --video "input.mp4" --prompt "sketch style" \
--fps 1 --num-inference-steps 25 --end-frame 20
# Multi-server configuration for maximum throughput
./video-diffusion.sh --video "input.mp4" --prompt "digital art" \
--hybrid-processing --gpu-ports "9000,9001" --cpu-ports "9010,9011"See requirements.txt for complete system dependency list.
- Easy Diffusion server running on localhost:9000
ffmpegfor video processing and encodingjqfor JSON parsing and API responsescurlfor HTTP requests to Easy Diffusion APIbash4.0+ shell
- CPU Server: Easy Diffusion instance on port 9010 for hybrid processing
- Multiple GPUs: Additional GPU servers on ports 9001, 9002, etc.
- System Tools:
bcfor smoothing calculations,nvidia-smifor GPU monitoring - High-end Hardware: 16+ cores, 32+ GB RAM for maximum concurrent processing
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install ffmpeg jq curl bc
# Make scripts executable
chmod +x video-diffusion.sh easy-diffusion-cli-enhanced.sh
# Verify Easy Diffusion server is running
curl http://localhost:9000/ping# GPU server (default): localhost:9000
# CPU server (recommended): localhost:9010
# Additional servers: localhost:9001, 9011, etc.
# Test server connectivity
./video-diffusion.sh --video "test.mp4" --prompt "test" --end-frame 1 --debug- Use hybrid processing:
--hybrid-processingwith GPU+CPU servers - Start with low FPS:
--fps 1for testing, then increase - Limit frames for testing:
--end-frame 20before full processing - Enable debug mode:
--debugto monitor performance bottlenecks - Use init smoothing:
--smoothing initfor best speed/quality balance
- Use temporal smoothing:
--smoothing temporal --smoothing-strength 0.4 - Increase inference steps:
--num-inference-steps 50-75 - Higher guidance scale:
--guidance-scale 8.0for better prompt adherence - Match source frame rate: Let auto-detection set FPS or use
--fps 24/30 - Process at full resolution: Use source video resolution or higher
- Monitor with debug:
--debugflag shows real-time processing status - Start small: Use
--end-frame 10for initial tests - Check server health: Verify all servers respond before large jobs
- Use CPU fallback:
--cpu-fallbackfor automatic error recovery - Reserve CPU overhead: Don't max out concurrent requests on lower-end systems
| System Type | Recommended Settings | Example Command |
|---|---|---|
| Entry Level (4-8 cores) | Single GPU, conservative settings | --max-concurrent 4 --batch-size 8 |
| Mid Range (8-16 cores) | GPU + CPU fallback | --cpu-fallback --max-concurrent 8 |
| High End (16+ cores) | Full hybrid processing | --hybrid-processing --max-concurrent 20 |
| Workstation (32+ cores) | Multi-server setup | --hybrid-processing --gpu-ports "9000,9001" --cpu-ports "9010,9011" |
See VIDEO_WORKFLOW.md for detailed workflow documentation.
v2.0 - Hybrid Processing & Temporal Smoothing
- โจ Added GPU+CPU hybrid processing with intelligent load balancing
- ๐ฏ Implemented temporal smoothing (init, optical, temporal methods)
- ๐ Enhanced server management with automatic failover
- โก Optimized performance with hardware auto-detection
- ๐ Added comprehensive debugging and monitoring
- ๐ฌ Improved video encoding with hardware acceleration
Features Added:
--hybrid-processingand--cpu-fallbackmodes--smoothingwith configurable strength- Real-time server health monitoring
- Multi-server port configuration
- Enhanced error handling and recovery
- Professional-grade temporal consistency
For legacy documentation, see previous commits or the main branch.