flux2  by black-forest-labs

Image generation and editing models for advanced visual AI

Created 6 days ago

New!

925 stars

Top 39.4% on SourcePulse

GitHubView on GitHub
Project Summary

FLUX.2 is an open-weight, 32B parameter flow matching transformer designed for advanced image generation and editing. It targets researchers and power users seeking state-of-the-art visual AI capabilities, offering significant improvements in image quality and editing flexibility.

How It Works

This repository provides the official inference code for FLUX.2, a flow matching transformer model. It leverages a sophisticated autoencoder and supports prompt upsampling for enhanced detail and fidelity. The architecture is engineered for high-quality image synthesis and complex editing tasks.

Quick Start & Requirements

  • Install: pip install -e . (requires specific PyTorch CUDA index URL based on CUDA version).
  • Prerequisites: Python 3.10+ or 3.12+, CUDA 12.6+ or 12.9+. The base FLUX.2 [dev] model requires an H100-equivalent GPU with substantial VRAM. Quantized versions are available for consumer hardware (e.g., RTX 4090) using a remote text encoder via diffusers.
  • Configuration: Set FLUX2_MODEL_PATH and AE_MODEL_PATH environment variables, or weights will be downloaded automatically.
  • Run CLI: export PYTHONPATH=src && python scripts/cli.py. For H100, use the --cpu_offloading True flag.
  • Docs: API documentation is available at docs.bfl.ai. The main project page is at https://bfl.ai.

Highlighted Details

  • Supports both text-to-image generation and multi-image editing functionalities.
  • Features prompt upsampling, allowing integration with local models or OpenRouter API for enhanced detail.
  • Includes optional invisible watermarking and recommends metadata marking (e.g., C2PA) for generated outputs.
  • Provides a diffusers example for RTX 4090 utilizing quantization and a remote text encoder.

Maintenance & Community

No specific details regarding community channels (e.g., Discord, Slack), active contributors, sponsorships, or a public roadmap were found in the provided README.

Licensing & Compatibility

The FLUX.2 [dev] model is released under the "FLUX.2-dev Non-Commercial License," restricting its use for commercial purposes. The associated autoencoder is licensed under Apache 2.0.

Limitations & Caveats

The base FLUX.2 [dev] model has high VRAM requirements, necessitating H100-class hardware. The non-commercial license significantly limits its applicability for business or production use cases. Specific CUDA and Python versions are tied to particular hardware configurations.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
6
Issues (30d)
10
Star History
935 stars in the last 6 days

Explore Similar Projects

Feedback? Help us improve.