Fast, Lightweight, Unified Engine for Text2Image Diffusion Models
C++
19
33 commits
updated Apr 13, 2025
Flue is a high-performance API server designed for efficiently loading and running Text-to-Image diffusion models. Built in Rust, Flue leverages the HuggingFace Candle, Transformers, and Hub libraries, delivering fast, scalable, and optimized model inference.
Prerequisites
Clone and build Flue:
git clone https://github.com/Apsu/flue.git
cd flue
cargo build --release --features cuda
Note:
cudnnfeature can be added if you have it installed for potential improved performance
./target/release/flue-server
Flue accepts command-line arguments to configure the engine.
--model "path or HF repo" # Default: black-forest-labs/FLUX.1-schnell
--host 0.0.0.0 # Default 127.0.0.1
--port 1234 # Default: 8080
--cpu # Force CPU offloading
Note: CPU offloading is currently all-or-nothing, and takes a lot of RAM and CPU for even a small request!
Send an HTTP POST request to generate images:
curl -X POST http://localhost:8080/v1/images/generations \
-H "Content-Type: application/json" \
-d '{
"prompt": "A futuristic city skyline at sunset",
"width": 512,
"height": 512,
"steps": 4,
"guidance_scale": 7.5
}'
Note: FLUX.1-schnell ignores guidance_scale and requires less steps than FLUX.1-dev
Contributions are welcome! Please open issues and pull requests directly on this repository.
Flue is licensed under MIT.
C++
69.2%
Rust
24.8%
Cuda
6.0%
Fast, Lightweight, Unified Engine for Text2Image Diffusion Models
C++
19
33 commits
updated Apr 13, 2025
Flue is a high-performance API server designed for efficiently loading and running Text-to-Image diffusion models. Built in Rust, Flue leverages the HuggingFace Candle, Transformers, and Hub libraries, delivering fast, scalable, and optimized model inference.
Prerequisites
Clone and build Flue:
git clone https://github.com/Apsu/flue.git
cd flue
cargo build --release --features cuda
Note:
cudnnfeature can be added if you have it installed for potential improved performance
./target/release/flue-server
Flue accepts command-line arguments to configure the engine.
--model "path or HF repo" # Default: black-forest-labs/FLUX.1-schnell
--host 0.0.0.0 # Default 127.0.0.1
--port 1234 # Default: 8080
--cpu # Force CPU offloading
Note: CPU offloading is currently all-or-nothing, and takes a lot of RAM and CPU for even a small request!
Send an HTTP POST request to generate images:
curl -X POST http://localhost:8080/v1/images/generations \
-H "Content-Type: application/json" \
-d '{
"prompt": "A futuristic city skyline at sunset",
"width": 512,
"height": 512,
"steps": 4,
"guidance_scale": 7.5
}'
Note: FLUX.1-schnell ignores guidance_scale and requires less steps than FLUX.1-dev
Contributions are welcome! Please open issues and pull requests directly on this repository.
Flue is licensed under MIT.
C++
69.2%
Rust
24.8%
Cuda
6.0%