Image-to-Image
Diffusers
Diffusion Single File
English
fp8
unsloth
quantized
image-generation
image-editing
flux
Instructions to use unsloth/FLUX.2-dev-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use unsloth/FLUX.2-dev-FP8 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("unsloth/FLUX.2-dev-FP8", dtype=torch.bfloat16, device_map="cuda") prompt = "cute sloth typing on a computer (INT8)" 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] - Diffusion Single File
How to use unsloth/FLUX.2-dev-FP8 with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
Add pre-cast fp8 text encoder checkpoint
Browse files
README.md
CHANGED
|
@@ -202,3 +202,16 @@ Prompt: "cute sloth typing on a computer" (1024x1024, family default steps/guida
|
|
| 202 |
|
| 203 |
<img src="samples/fp8_1.png" width="260"> <img src="samples/fp8_2.png" width="260"> <img src="samples/fp8_3.png" width="260">
|
| 204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
|
| 203 |
<img src="samples/fp8_1.png" width="260"> <img src="samples/fp8_2.png" width="260"> <img src="samples/fp8_3.png" width="260">
|
| 204 |
|
| 205 |
+
---
|
| 206 |
+
|
| 207 |
+
# Pre-cast fp8 text encoder (this repo)
|
| 208 |
+
|
| 209 |
+
FLUX.2-dev-text_encoder-FP8.pt (24.7 GB) is the pipeline's text encoder (Mistral3ForConditionalGeneration, the `text_encoder`
|
| 210 |
+
subfolder of black-forest-labs/FLUX.2-dev) with the layerwise fp8 storage cast Unsloth Studio applies at load
|
| 211 |
+
time, saved pre-cast:
|
| 212 |
+
|
| 213 |
+
- Loading it is bit-identical to downloading the dense encoder and casting on load
|
| 214 |
+
(verified tensor for tensor: 585 tensors, 453 cast to fp8 storage).
|
| 215 |
+
- Cuts the text-encoder download from 48.0 GB to 24.7 GB.
|
| 216 |
+
- Plain-tensor state dict: loads with torch.load(weights_only=True). Metadata records
|
| 217 |
+
scheme fp8, component text_encoder, base black-forest-labs/FLUX.2-dev.
|