Instructions to use nucleuseru/flux-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use nucleuseru/flux-2 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("nucleuseru/flux-2", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Delete README.md
Browse files
README.md
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
language:
|
| 3 |
-
- en
|
| 4 |
-
license: other
|
| 5 |
-
license_name: flux-dev-non-commercial-license
|
| 6 |
-
license_link: https://huggingface.co/black-forest-labs/FLUX.2-dev/blob/main/LICENSE.txt
|
| 7 |
-
base_model: black-forest-labs/FLUX.2-dev
|
| 8 |
-
tags:
|
| 9 |
-
- image-generation
|
| 10 |
-
- flux
|
| 11 |
-
- lora
|
| 12 |
-
- distillation
|
| 13 |
-
- turbo
|
| 14 |
-
pipeline_tag: text-to-image
|
| 15 |
-
library_name: diffusers
|
| 16 |
-
---
|
| 17 |
-
|
| 18 |
-
# FLUX.2 [dev] Turbo LoRA
|
| 19 |
-
|
| 20 |
-
**FLUX.2 [dev] Turbo** is a distilled LoRA adapter for [FLUX.2 [dev]](https://huggingface.co/black-forest-labs/FLUX.2-dev) that enables high-quality image generation in just **8 inference steps**.
|
| 21 |
-
|
| 22 |
-

|
| 23 |
-
---
|
| 24 |
-
|
| 25 |
-
---
|
| 26 |
-
|
| 27 |
-

|
| 28 |
-
|
| 29 |
-
## Key Features
|
| 30 |
-
|
| 31 |
-
- ⚡ **8-step inference** — 6x faster than the base model's typical 50 steps
|
| 32 |
-
- 🎨 **Quality preserved** — Matches or surpasses the original FLUX.2 [dev] quality
|
| 33 |
-
- 🔌 **LoRA adapter** — Lightweight, easy to integrate with existing FLUX.2 workflows
|
| 34 |
-
- 🖼️ **Multiple modes** — Supports both text-to-image and image editing
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
## Hosted API Endpoints
|
| 38 |
-
|
| 39 |
-
FLUX.2 [dev] Turbo is available through fal.ai hosted endpoints:
|
| 40 |
-
- [Text-to-Image](https://fal.ai/models/fal-ai/flux-2/turbo)
|
| 41 |
-
- [Image Editing](https://fal.ai/models/fal-ai/flux-2/turbo/edit)
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
## ComfyUI
|
| 45 |
-
|
| 46 |
-
ComfyUI-compatible weights are available in the `comfy/` directory, converted by [ByteZSzn](https://huggingface.co/ByteZSzn/Flux.2-Turbo-ComfyUI).
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
## Usage
|
| 50 |
-
|
| 51 |
-
```python
|
| 52 |
-
import torch
|
| 53 |
-
from diffusers import Flux2Pipeline
|
| 54 |
-
|
| 55 |
-
# Pre-shifted custom sigmas for 8-step turbo inference
|
| 56 |
-
TURBO_SIGMAS = [1.0, 0.6509, 0.4374, 0.2932, 0.1893, 0.1108, 0.0495, 0.00031]
|
| 57 |
-
|
| 58 |
-
pipe = Flux2Pipeline.from_pretrained(
|
| 59 |
-
"black-forest-labs/FLUX.2-dev",
|
| 60 |
-
torch_dtype=torch.bfloat16
|
| 61 |
-
).to("cuda")
|
| 62 |
-
|
| 63 |
-
pipe.load_lora_weights(
|
| 64 |
-
"fal/FLUX.2-dev-Turbo",
|
| 65 |
-
weight_name="flux.2-turbo-lora.safetensors"
|
| 66 |
-
)
|
| 67 |
-
|
| 68 |
-
prompt = "Industrial product shot of a chrome turbocharger with glowing hot exhaust manifold, engraved text 'FLUX.2 [dev] Turbo by fal' on the compressor housing and 'fal' on the turbine wheel, gradient heat glow from orange to electric blue , studio lighting with dramatic shadows, shallow depth of field, engineering blueprint pattern in background."
|
| 69 |
-
|
| 70 |
-
image = pipe(
|
| 71 |
-
prompt=prompt,
|
| 72 |
-
sigmas=TURBO_SIGMAS,
|
| 73 |
-
guidance_scale=2.5,
|
| 74 |
-
height=1024,
|
| 75 |
-
width=1024,
|
| 76 |
-
num_inference_steps=8,
|
| 77 |
-
).images[0]
|
| 78 |
-
|
| 79 |
-
image.save("output.png")
|
| 80 |
-
```
|
| 81 |
-
|
| 82 |
-
## License
|
| 83 |
-
|
| 84 |
-
This model inherits the [FLUX [dev] Non-Commercial License](https://huggingface.co/black-forest-labs/FLUX.2-dev/blob/main/LICENSE.txt) from the base model.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|