Improved CFG for flow matching models
Top 52.7% on sourcepulse
CFG-Zero* enhances classifier-free guidance for flow matching models, offering improved sample quality and diversity. It is designed for researchers and practitioners working with generative AI, particularly in text-to-image and text-to-video synthesis. The method aims to provide more stable and higher-fidelity generations.
How It Works
CFG-Zero* introduces two key improvements to classifier-free guidance: optimized scaling and zero-initialization. Optimized scaling dynamically adjusts the guidance scale based on the similarity between conditional and unconditional predictions, aiming to prevent over-saturation. Zero-initialization, by contrast, sets the initial prediction to zero for a specified number of steps, which can help models that haven't fully converged.
Quick Start & Requirements
pip install -r requirements.txt
.ffmpeg
.python demo.py
.Highlighted Details
Maintenance & Community
The project is actively updated with new model support and integrations. Community works are highlighted, and links to demos and the project page are available.
Licensing & Compatibility
Licensed under Apache-2.0, allowing for academic research and commercial usage. The project disclaims responsibility for user-generated content and prohibits certain types of content generation.
Limitations & Caveats
The project's disclaimer notes that models are not trained for realistic representation of people or events, and users are solely liable for their actions and content generation. Certain use cases, such as pornographic or violent content, are prohibited.
3 months ago
1 day