flux  by black-forest-labs

Inference code for FLUX image generation & editing models

Created 1 year ago
24,284 stars

Top 1.6% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides the official inference code for FLUX.1 image generation and editing models, targeting researchers and developers looking to integrate advanced AI image capabilities into their applications. It offers a Python API and command-line interface for local inference, with options for TensorRT acceleration.

How It Works

The project leverages pre-trained diffusion models for text-to-image generation and image editing tasks like inpainting and structural conditioning. It provides a Python interface that interacts with these models, allowing users to generate images based on text prompts or modify existing ones. The inclusion of TensorRT support aims to optimize inference speed and efficiency on NVIDIA hardware.

Quick Start & Requirements

  • Install: pip install -e ".[all]" (or .[tensorrt] for TensorRT support).
  • Prerequisites: Python 3.10+, enroot and NVIDIA container runtime for TensorRT.
  • TensorRT Setup: Requires importing a specific PyTorch image from NVIDIA (nvidia/pytorch:25.01-py3) and creating an enroot container.
  • API Key: Required for using the API features, obtainable from api.bfl.ml.
  • Documentation: docs.bfl.ml

Highlighted Details

  • Supports various FLUX.1 models including text-to-image, in/out-painting, and structural conditioning (Canny, Depth).
  • Offers command-line and Python API for inference.
  • TensorRT support for accelerated inference on NVIDIA GPUs.
  • Models are available on HuggingFace, with weights also released under Apache-2.0.

Maintenance & Community

  • Developed by Black Forest Labs.
  • API documentation available at docs.bfl.ml.

Licensing & Compatibility

  • FLUX.1 [schnell] and autoencoder weights are Apache-2.0.
  • Other FLUX.1 [dev] models are under a "FLUX.1-dev Non-Commercial License".
  • Commercial use is primarily available via their API.

Limitations & Caveats

The "dev" models are explicitly licensed for non-commercial use, requiring users to consult the API for commercial applications. TensorRT installation involves a more complex setup using enroot.

Health Check
Last Commit

1 month ago

Responsiveness

1 day

Pull Requests (30d)
1
Issues (30d)
4
Star History
314 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.