MFLUX v.0.6.0 Release Notes
Major New Features
π Third-Party HuggingFace Model Support
- Comprehensive ModelConfig refactor to support compatible HuggingFace dev/schnell models
- Added ability to use models like
Freepik/flux.1-lite-8B-alphaandshuttleai/shuttle-3-diffusion - New
--base-modelparameter to specify which base architecture (dev or schnell) a third-party model is derived from - Maintains backward compatibility while opening up the ecosystem to community-created models
π In-Context LoRA
- Added support for In-Context LoRA, a powerful technique that allows you to generate images in a specific style based on a reference image without requiring model fine-tuning
- Introduced a new command-line tool:
mflux-generate-in-context - Includes 10 pre-defined styles from the Hugging Face ali-vilab/In-Context-LoRA repository
- Detailed documentation on how to use this feature effectively with prompting tips and best practices
π Automatic LoRA Downloads
- Added ability to automatically download LoRAs from Hugging Face when specified by repository ID
- Simplifies workflow by eliminating the need to manually download LoRA files before use
π§ Memory Optimizations
- Added
--low-ramoption to reduce GPU memory usage by constraining the MLX cache size and releasing text encoders and transformer components after use - Implemented memory saver for ControlNet to reduce RAM requirements
- General memory usage optimizations throughout the codebase
ποΈ Enhanced Quantization Options
- Added support for 3-bit and 6-bit quantization (requires mlx > v0.21.0)
- Expanded quantization options now include 3, 4, 6, and 8-bit precision
β οΈBreaking changes
Previously saved quantized models will not work for v.0.6.0 and later. See #149 for more details.
Interface Improvements
π§ Modified Parameters
- The previous
--init-image-pathparameter is now--image-path - The previous
--init-image-strengthparameter is now--image-strength
πΌοΈ Image Generation Enhancements
- Added
--auto-seedsoption to generate multiple images with random seeds in a single command - Added option to override previously saved test images
- Added
--controlnet-save-cannyoption to save the Canny edge detection reference image used by ControlNet - Improved handling of edge cases for img2img generation
π Callback System
- Implemented a general callback mechanism for more flexible image generation pipelines
- Added support for before-loop callbacks to accept latents
- Enhanced StepwiseHandler to include initial latent
Architecture Improvements
ποΈ Code Refactoring
- Removed 'init' prefix for a more general interface
- Removed
ConfigControlnet- thecontrolnet_strengthattribute is now onConfig - Simplified quantization by removing unnecessary class predicates
- Refactored model configuration system
- Refactored transformer blocks for better maintainability
- Unified attention mechanism in single and joint attention blocks
- Added support for variable numbers of transformer blocks
- Optimized with fast SDPA (Scaled Dot-Product Attention)
- Added PromptCache for small optimization when generating with repeated prompts
π§° Developer Tools
- Added Batch Image Renamer tool as an isolated uv run script
- Added descriptive comments for attention computations
Compatibility Updates
- Updated to support the latest mlx version
- Fixed compatibility issues with HuggingFace dev/schnell models
Bug Fixes
- Fixed handling of edge cases for img2img generation
- Various small fixes and improvements throughout the codebase