flux  by black-forest-labs

Inference code for FLUX image generation & editing models

created 1 year ago
23,764 stars

Top 1.7% 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

2 days ago

Responsiveness

1 day

Pull Requests (30d)
1
Issues (30d)
15
Star History
2,403 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), and
2 more.

hummingbird by microsoft

0.0%
3k
Compiler for trained ML models into tensor computation
created 5 years ago
updated 2 weeks ago
Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Omar Sanseviero Omar Sanseviero(DevRel at Google DeepMind), and
5 more.

TensorRT-LLM by NVIDIA

0.6%
11k
LLM inference optimization SDK for NVIDIA GPUs
created 1 year ago
updated 18 hours ago
Feedback? Help us improve.