Diffusers
Safetensors
OrbitQuantComponentArtifact
orbitquant
quantized
diffusion-transformer
8-bit precision
Instructions to use WaveCut/FLUX.1-schnell-OrbitQuant-W2A3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use WaveCut/FLUX.1-schnell-OrbitQuant-W2A3 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("WaveCut/FLUX.1-schnell-OrbitQuant-W2A3", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Add model-specific OrbitQuant usage examples
Browse files- README.md +11 -8
- SHA256SUMS +1 -1
README.md
CHANGED
|
@@ -20,7 +20,7 @@ Install the package from this repository, then load the base pipeline and patch
|
|
| 20 |
|
| 21 |
```python
|
| 22 |
import torch
|
| 23 |
-
from diffusers import
|
| 24 |
from huggingface_hub import snapshot_download
|
| 25 |
from orbitquant import load_quantized_pipeline_component
|
| 26 |
|
|
@@ -28,7 +28,7 @@ base_model = "black-forest-labs/FLUX.1-schnell"
|
|
| 28 |
artifact_id = "WaveCut/FLUX.1-schnell-OrbitQuant-W2A3"
|
| 29 |
|
| 30 |
artifact_dir = snapshot_download(artifact_id, repo_type="model")
|
| 31 |
-
pipe =
|
| 32 |
base_model,
|
| 33 |
torch_dtype=torch.bfloat16,
|
| 34 |
)
|
|
@@ -40,13 +40,16 @@ load_quantized_pipeline_component(
|
|
| 40 |
)
|
| 41 |
pipe.to("cuda")
|
| 42 |
|
| 43 |
-
|
| 44 |
prompt="A precise product photo of a red ceramic mug on a wooden desk",
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
```
|
| 47 |
|
| 48 |
-
For model-specific pipelines, you may replace `DiffusionPipeline` with the matching Diffusers class, such as `FluxPipeline`, `Flux2KleinPipeline`, `ZImagePipeline`, or `WanPipeline` when your Diffusers version provides it.
|
| 49 |
-
|
| 50 |
## Quantization
|
| 51 |
|
| 52 |
- Method: `orbitquant`
|
|
@@ -73,14 +76,14 @@ For model-specific pipelines, you may replace `DiffusionPipeline` with the match
|
|
| 73 |
|
| 74 |
The following assets are stored in this artifact and compare the BF16 base generation against the OrbitQuant generation with the same prompt and seed.
|
| 75 |
|
|
|
|
|
|
|
| 76 |

|
| 77 |
|
| 78 |

|
| 79 |
|
| 80 |

|
| 81 |
|
| 82 |
-

|
| 83 |
-
|
| 84 |
## Source
|
| 85 |
|
| 86 |
- Model: `black-forest-labs/FLUX.1-schnell`
|
|
|
|
| 20 |
|
| 21 |
```python
|
| 22 |
import torch
|
| 23 |
+
from diffusers import FluxPipeline
|
| 24 |
from huggingface_hub import snapshot_download
|
| 25 |
from orbitquant import load_quantized_pipeline_component
|
| 26 |
|
|
|
|
| 28 |
artifact_id = "WaveCut/FLUX.1-schnell-OrbitQuant-W2A3"
|
| 29 |
|
| 30 |
artifact_dir = snapshot_download(artifact_id, repo_type="model")
|
| 31 |
+
pipe = FluxPipeline.from_pretrained(
|
| 32 |
base_model,
|
| 33 |
torch_dtype=torch.bfloat16,
|
| 34 |
)
|
|
|
|
| 40 |
)
|
| 41 |
pipe.to("cuda")
|
| 42 |
|
| 43 |
+
image = pipe(
|
| 44 |
prompt="A precise product photo of a red ceramic mug on a wooden desk",
|
| 45 |
+
height=1024,
|
| 46 |
+
width=1024,
|
| 47 |
+
num_inference_steps=4,
|
| 48 |
+
guidance_scale=0.0,
|
| 49 |
+
).images[0]
|
| 50 |
+
image.save("flux1-schnell-orbitquant.png")
|
| 51 |
```
|
| 52 |
|
|
|
|
|
|
|
| 53 |
## Quantization
|
| 54 |
|
| 55 |
- Method: `orbitquant`
|
|
|
|
| 76 |
|
| 77 |
The following assets are stored in this artifact and compare the BF16 base generation against the OrbitQuant generation with the same prompt and seed.
|
| 78 |
|
| 79 |
+

|
| 80 |
+
|
| 81 |

|
| 82 |
|
| 83 |

|
| 84 |
|
| 85 |

|
| 86 |
|
|
|
|
|
|
|
| 87 |
## Source
|
| 88 |
|
| 89 |
- Model: `black-forest-labs/FLUX.1-schnell`
|
SHA256SUMS
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
|
| 2 |
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 assets/.gitkeep
|
| 3 |
ef315b50cd3602b3cf3305045b079aee61df216cd361c68351278f3d06802534 assets/flux1-schnell-native_seed0_W2A3_color-binding.png
|
| 4 |
9839b8e414d7fec36b35d382aa6e1e8e7048f226310a15c7d88a7b2b2c35c704 assets/flux1-schnell-native_seed0_W2A3_color-binding.png.json
|
|
|
|
| 1 |
+
6c8610746eb28281d7516bf08674950e1ffd13108ce8cb839072043fff5b57d5 README.md
|
| 2 |
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 assets/.gitkeep
|
| 3 |
ef315b50cd3602b3cf3305045b079aee61df216cd361c68351278f3d06802534 assets/flux1-schnell-native_seed0_W2A3_color-binding.png
|
| 4 |
9839b8e414d7fec36b35d382aa6e1e8e7048f226310a15c7d88a7b2b2c35c704 assets/flux1-schnell-native_seed0_W2A3_color-binding.png.json
|