Views
No views yet
1
2
3# PyTorch INT8 quantized model
4from diffusers import FluxPipeline
5import torch
6
7# Load INT8 quantized model
8pipe = FluxPipeline.from_pretrained(
9 "Mitchins/flux1-torch-int8",
10 torch_dtype=torch.qint8,
11 use_safetensors=True
12)
13
14# For CPU inference
15pipe = pipe.to("cpu")
16
17# Generate image
18image = pipe("A beautiful landscape", num_inference_steps=20).images[0]
19image.save("output.png")
20
21| Backend | Quantization | Memory | Speed (CPU) | Speed (GPU) | Quality |
|---|---|---|---|---|---|
| PyTorch | INT8 | ~12.0GB | Good | Fast | Slightly Reduced |
1@misc{flux1-pytorch-int8,
2 title = {FLUX.1 Schnell PyTorch INT8}
3 author = {ImageAI Server Contributors}
4 year = {2024}
5 publisher = {HuggingFace}
6 url = {https://huggingface.co/Mitchins/flux1-torch-int8}
7}