Instructions to use WaveCut/FLUX.2-klein-9B-OrbitQuant-W4A4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use WaveCut/FLUX.2-klein-9B-OrbitQuant-W4A4 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.2-klein-9B-OrbitQuant-W4A4", 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
- Local Apps Settings
- Draw Things
- DiffusionBee
Update comparison matrix and Metal results
Browse files- README.md +64 -31
- assets/image_generation_comparison_matrix.webp +2 -2
README.md
CHANGED
|
@@ -32,7 +32,7 @@ OrbitQuant paper itself leaves text encoders in BF16.
|
|
| 32 |
## Install
|
| 33 |
|
| 34 |
```bash
|
| 35 |
-
pip install "orbitquant[kernels]>=0.3.
|
| 36 |
```
|
| 37 |
|
| 38 |
OrbitQuant uses packed low-bit inference by default. CUDA first uses an importable
|
|
@@ -127,39 +127,72 @@ results are in `benchmark/summary.json`.
|
|
| 127 |
|
| 128 |
## Metal Kernel Reference
|
| 129 |
|
| 130 |
-
The packed Metal operator was
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
`F.linear`
|
| 134 |
-
|
| 135 |
-
|
|
| 136 |
-
|
|
| 137 |
-
|
|
| 138 |
-
|
|
| 139 |
-
|
|
| 140 |
-
|
|
| 141 |
-
|
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
|
| 148 |
## Visual Comparison
|
| 149 |
|
| 150 |
-
The matrix
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
![BF16, SDNQ and OrbitQuant
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
|
| 164 |
## Limitations
|
| 165 |
|
|
|
|
| 32 |
## Install
|
| 33 |
|
| 34 |
```bash
|
| 35 |
+
pip install "orbitquant[kernels]>=0.3.1" "diffusers>=0.39" "transformers>=5.13" accelerate
|
| 36 |
```
|
| 37 |
|
| 38 |
OrbitQuant uses packed low-bit inference by default. CUDA first uses an importable
|
|
|
|
| 127 |
|
| 128 |
## Metal Kernel Reference
|
| 129 |
|
| 130 |
+
The packed Metal operator was measured on an Apple M2 Max with Torch 2.12.1,
|
| 131 |
+
FP16 activations, W4 weights, `in_features=768`, and `out_features=2304`.
|
| 132 |
+
|
| 133 |
+
| Activation rows | Packed Metal | Resident FP16 `F.linear` | Materialize + `F.linear` | Packed vs materialize |
|
| 134 |
+
| ---: | ---: | ---: | ---: | ---: |
|
| 135 |
+
| 1 | 0.0470 ms | 0.0411 ms | 0.2310 ms | 4.92x |
|
| 136 |
+
| 2 | 0.0439 ms | 0.0422 ms | 0.2371 ms | 5.40x |
|
| 137 |
+
| 3 | 0.0451 ms | 0.0404 ms | 0.2348 ms | 5.20x |
|
| 138 |
+
| 8 | 0.0420 ms | 0.0503 ms | 0.2512 ms | 5.97x |
|
| 139 |
+
| 9 | 0.0446 ms | 0.0501 ms | 0.2422 ms | 5.43x |
|
| 140 |
+
| 16 | 0.0459 ms | 0.0581 ms | 0.2512 ms | 5.47x |
|
| 141 |
+
| 31 | 0.0428 ms | 0.0659 ms | 0.2623 ms | 6.12x |
|
| 142 |
+
|
| 143 |
+
One-row projections use the SIMD-group packed matvec. Aligned FP16/BF16
|
| 144 |
+
projections with two or more rows use the padded matrix path. The packed
|
| 145 |
+
weight payload, row norms and centroids occupy 25.26% of the materialized FP16
|
| 146 |
+
weight size for this shape.
|
| 147 |
+
|
| 148 |
+
For a complete 4096-coordinate RPBH block with constants resident on MPS, the
|
| 149 |
+
512-thread fused activation path measured 1.17-1.45x faster than the 256-thread
|
| 150 |
+
path across 1-4096 activation rows. Smaller or multi-block RPBH dimensions
|
| 151 |
+
retain 256 threads.
|
| 152 |
+
|
| 153 |
+
These are operator-level references, not a full FLUX.2 pipeline benchmark.
|
| 154 |
+
Packed execution consumes low-bit indices directly and does not allocate a
|
| 155 |
+
complete floating-point weight matrix.
|
| 156 |
|
| 157 |
## Visual Comparison
|
| 158 |
|
| 159 |
+
The matrix uses the complete ten-prompt stress pack with full 1024x1024 tiles
|
| 160 |
+
and WebP quality 95. BF16 is the full-precision reference from the controlled
|
| 161 |
+
visual run; the SDNQ and OrbitQuant columns use the corresponding L40S
|
| 162 |
+
benchmark outputs. Every row uses the same prompt, seed, resolution, step count
|
| 163 |
+
and guidance.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
|
| 167 |
+
### Visual Assessment
|
| 168 |
+
|
| 169 |
+
- **No collapse:** all thirty outputs are finite, coherent and detailed. OrbitQuant did not
|
| 170 |
+
produce blank, noisy or structurally broken images.
|
| 171 |
+
- **Micro-detail and materials:** all three variants preserve gears, filigree, architectural
|
| 172 |
+
interiors, paper grain, metal, resin and reflected surfaces. OrbitQuant remains competitive
|
| 173 |
+
with BF16 and SDNQ in these cases.
|
| 174 |
+
- **Dense composition:** all variants retain foreground/background separation and the main
|
| 175 |
+
hierarchy in the architectural cutaway and orbital-banquet prompts. Individual requested
|
| 176 |
+
objects move or disappear because quantization changes the denoising trajectory.
|
| 177 |
+
- **Counting:** none of the variants reliably renders exactly nine performers or every exact
|
| 178 |
+
repeated motif. This is a base-model limitation in the tested setting rather than an
|
| 179 |
+
OrbitQuant-only collapse.
|
| 180 |
+
- **English typography:** OrbitQuant is strongest on this row: it preserves the headline,
|
| 181 |
+
subtitle and all four specification lines. SDNQ preserves the headline and three table
|
| 182 |
+
lines but omits or corrupts some requested text.
|
| 183 |
+
- **Russian typography:** all variants render the large headline, subtitle and archive stamp
|
| 184 |
+
well; small contents text contains errors in every column.
|
| 185 |
+
- **Japanese and Chinese typography:** visual glyph quality is plausible, but exact requested
|
| 186 |
+
strings are not reliably reproduced by any variant.
|
| 187 |
+
- **Trajectory fidelity:** both quantizers change the denoising trajectory at the same seed;
|
| 188 |
+
neither remains consistently closer to BF16 across all ten prompts.
|
| 189 |
+
|
| 190 |
+
This subjective paired inspection demonstrates non-collapse and exposes
|
| 191 |
+
concrete failure modes; it is not a substitute for GenEval or another
|
| 192 |
+
task-specific objective metric. In this controlled FLUX.2 Klein 9B comparison,
|
| 193 |
+
OrbitQuant produces the smaller complete 4-bit pipeline, reaches SDNQ
|
| 194 |
+
hot-generation parity with lower runtime memory, and produces the strongest
|
| 195 |
+
English fine-print result in the prompt pack.
|
| 196 |
|
| 197 |
## Limitations
|
| 198 |
|
assets/image_generation_comparison_matrix.webp
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|