Update README.md
Browse files
README.md
CHANGED
@@ -23,4 +23,23 @@ save_to = "sayakpaul/flux.1-schell-int8wo-improved"
|
|
23 |
transformer.push_to_hub(save_to, safe_serialization=False)
|
24 |
```
|
25 |
|
26 |
-
Install `diffusers`, `huggingface_hub`, `ao` from the source.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
transformer.push_to_hub(save_to, safe_serialization=False)
|
24 |
```
|
25 |
|
26 |
+
Install `diffusers`, `huggingface_hub`, `ao` from the source.
|
27 |
+
|
28 |
+
Inference:
|
29 |
+
|
30 |
+
```python
|
31 |
+
import torch
|
32 |
+
from diffusers import FluxTransformer2DModel, DiffusionPipeline
|
33 |
+
|
34 |
+
dtype, device = torch.bfloat16, "cuda"
|
35 |
+
ckpt_id = "black-forest-labs/FLUX.1-schnell"
|
36 |
+
|
37 |
+
model = FluxTransformer2DModel.from_pretrained(
|
38 |
+
"sayakpaul/flux.1-schell-int8wo-improved", torch_dtype=dtype, use_safetensors=False
|
39 |
+
)
|
40 |
+
pipeline = DiffusionPipeline.from_pretrained(ckpt_id, transformer=model, torch_dtype=dtype).to("cuda")
|
41 |
+
image = pipeline(
|
42 |
+
"cat", guidance_scale=0.0, num_inference_steps=4, max_sequence_length=256
|
43 |
+
).images[0]
|
44 |
+
image.save("flux_schnell_int8.png")
|
45 |
+
```
|