0d13b953efeccf8a2c03d200f89ef29797c75ee6
ComfyUI Coherent Video Sampler Node (V0.2)
A custom node for ComfyUI that enables coherent video generation while maintaining efficient memory usage, specifically optimized for heavy models like Flux.
Features
- 🎥 Frame-by-frame video processing with motion preservation
- 🧠 Efficient memory management for heavy models
- 🔄 Progressive denoising with coherence maintenance
- 💫 Dynamic quality control and motion guidance
- 🎨 Style preservation across frames
Installation
- Navigate to your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes
- Clone this repository:
git clone https://github.com/ShmuelRonen/ComfyUI-CohernetVideoSampler.git
- Restart ComfyUI
Usage
The node appears in the node menu as "Cohernet Video Sampler".
Inputs
model: Your diffusion model (tested extensively with Flux)positive: Positive prompt conditioningnegative: Negative prompt conditioningvideo_latents: Input video in latent space (from VAE Encode)seed: Generation seedsteps: Number of sampling stepscfg: Classifier free guidance scalesampler_name: Choice of samplerscheduler: Choice of schedulerdenoise: Denoising strengthmotion_strength: Strength of motion preservation
Memory Management
The node implements several memory optimization techniques:
- Progressive batch processing
- Automatic VRAM cleanup
- Dynamic batch size adjustment
- Efficient latent space operations
This allows it to work smoothly even with memory-intensive models like Flux without OOM errors.
Example Workflow
- Load your video
- Encode it to latent space using VAE Encode
- Connect to Coherent Video Sampler
- Set your sampling parameters
- Generate coherent video output
Parameters Guide
denoise: Lower values (0.4-0.6) preserve more of the original motionmotion_strength: Higher values (0.7-0.9) maintain stronger frame-to-frame coherencesteps: Even with heavy models, 20-30 steps usually sufficientcfg: Standard values (7-9) work well for most cases
Memory Usage Examples
When using with Flux model:
- 20 frame video @ 512x512: ~8GB VRAM
- 40 frame video @ 512x512: ~10GB VRAM
- Processing happens in windows of frames to maintain stable memory usage
Known Limitations
- Very long videos might need to be processed in segments
- Extreme motion can affect coherence
- High denoise values might reduce motion preservation
Future Plans
- Additional motion control parameters
- Custom denoising patterns
- Advanced style preservation options
- Multi-model support optimization
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
Acknowledgments
- ComfyUI team for the amazing framework
- Flux model team for the inspiration in handling heavy models
Languages
Python
100%