Instructions to use WaveCut/FLUX.2-klein-4B-OrbitQuant-W3A3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use WaveCut/FLUX.2-klein-4B-OrbitQuant-W3A3 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-4B-OrbitQuant-W3A3", 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
black-forest-labs/FLUX.2-klein-4B OrbitQuant W3A3
This repository contains a compact OrbitQuant transformer-component artifact for the source Diffusers model listed above. It is intended to be loaded into the original pipeline, not used as a standalone Diffusers pipeline repository.
OrbitQuant is a calibration-free post-training quantization method for image and video diffusion transformers. This artifact keeps the text encoders, VAE, embeddings, timestep MLP, and final heads in the source precision by default and replaces the transformer linear projections with OrbitQuant modules.
Usage
Install OrbitQuant and the Hugging Face runtime dependencies:
pip install "orbitquant[hf,kernels]>=0.2.0"
Download this model repository as an OrbitQuant artifact, then load the source Diffusers pipeline with the quantized component patched in:
import torch
from huggingface_hub import snapshot_download
from orbitquant import load_quantized_pipeline_from_artifact
artifact_id = "WaveCut/FLUX.2-klein-4B-OrbitQuant-W3A3"
artifact_dir = snapshot_download(artifact_id, repo_type="model")
pipe = load_quantized_pipeline_from_artifact(
artifact_dir,
torch_dtype=torch.bfloat16,
runtime_mode="auto_fused",
)
pipe.enable_model_cpu_offload(device="cuda")
image = pipe(
prompt="A precise product photo of a red ceramic mug on a wooden desk",
height=1024,
width=1024,
num_inference_steps=4,
guidance_scale=1.0,
).images[0]
image.save("flux2-klein-orbitquant.png")
runtime_mode="auto_fused" is the default optimized runtime. On CUDA, the kernels extra provides the Triton packed fallback; a locally built native CUDA package is preferred automatically when installed. On MPS, build and install the native Metal package from the OrbitQuant source tree. See the OrbitQuant runtime instructions. Use runtime_mode="dequant_bf16" only as an explicit compatibility/debug reference path.
Native Settings
Use these settings when comparing this artifact against the BF16 source model or the visual assets below:
| Setting | Value |
|---|---|
| Pipeline | Flux2KleinPipeline |
| Resolution | 1024x1024 |
| Inference steps | 4 |
| Guidance scale | 1.0 |
| Output | image |
| Scope | extra target; not an OrbitQuant paper reproduction model |
Validation Status
- Native BF16-vs-OrbitQuant comparison: included when the visual matrix below is present.
- Release-grade paper metrics: not applicable to this extra target.
- The model card reports artifact-level validation status only.
Native Validation Evidence
The compact benchmark summary records native BF16-vs-OrbitQuant evidence for the comparison matrix below. Detailed per-sample generation records are retained outside this compact artifact.
| Evidence | Value |
|---|---|
| Comparison matrix | assets/image_generation_comparison_matrix.webp |
| Paired prompt/seed count | 10 |
| BF16 source generated samples | 10 |
| BF16 source generated frames | 0 |
| BF16 source nonempty outputs | 10 |
| OrbitQuant generated samples | 10 |
| OrbitQuant generated frames | 0 |
| OrbitQuant nonempty outputs | 10 |
Comparison Prompt Set
The matrix uses all ten prompts from image_visual_v2 at 1024x1024. BF16 and OrbitQuant use the same seed for each row.
| # | Stress case | Exact required text |
|---|---|---|
| 1 | 01 Fine-detail astrolabe | - |
| 2 | 02 Layered character composition | - |
| 3 | 03 Exact counting and choreography | - |
| 4 | 04 Dense color and object binding | - |
| 5 | 05 Nested spatial relationships | - |
| 6 | 06 Cinematic night-market panorama | - |
| 7 | 07 Editorial Latin typography | ORBIT QUANT; DATA WITHOUT CALIBRATION |
| 8 | 08 Russian Constructivist typography | КВАНТОВАЯ ОРБИТА; МОСКВА 2049; КВАНТОВАНИЕ |
| 9 | 09 Japanese typography and mixed style | 量子の軌道; 東京の未来 |
| 10 | 10 Chinese typography, reflection, occlusion | 量子轨道; 未来之城 |
Exact comparison prompts
- 01 Fine-detail astrolabe: A museum-grade macro photograph of a single ornate brass astronomical clock, covered with interlocking gears, engraved constellations, enamel moon phases, hair-thin hands, tiny screws, worn gilt edges, and dust caught in the mechanisms; dramatic Rembrandt lighting, black velvet background, extreme material detail, large-format photography, every cog mechanically coherent
- 02 Layered character composition: A lacquered white android and an elderly watchmaker facing each other across a crowded Art Nouveau workshop, jointly repairing a mechanical hummingbird; the android is on the left, the watchmaker on the right, the bird centered between them, hundreds of tools and clock parts in the midground, rain and a tram visible through the window, coherent mirror reflections, cinematic tungsten and cyan light, intricate faces and hands, editorial realism
- 03 Exact counting and choreography: Exactly seven masked dancers performing on seven separate illuminated platforms inside a vast flooded opera house, no extra dancers; alternating crimson and ivory costumes from left to right, each dancer in a distinct pose, balconies reflected in the water, floating candles, volumetric stage haze, baroque theatrical photography, sharp foreground and readable background architecture
- 04 Dense color and object binding: An elaborate surreal fashion tableau with three models: the left model wears a cobalt-blue coat and holds a yellow glass sphere, the center model wears a saffron dress and holds a green ceramic pyramid, the right model wears an emerald suit and holds a red velvet cube; rococo greenhouse, rare orchids, patterned tile floor, prismatic sunlight, magazine-cover precision, preserve every color-object pairing
- 05 Nested spatial relationships: A meticulous cutaway diorama of a vertical city: a glass greenhouse sits directly above a silver subway car, a red fox stands inside the greenhouse beneath a hanging moon lamp, a violinist waits below the subway platform, and a yellow airship passes behind the entire structure; isometric perspective, architectural-section drawing mixed with photoreal materials, dozens of tiny rooms, stairs and people, clean depth
- 06 Cinematic night-market panorama: A sweeping cinematic panorama of a rain-soaked floating night market at blue hour: in the foreground a chef plates translucent dumplings under a red silk canopy; in the midground children chase paper lanterns across narrow bridges while merchants unload exotic fruit from wooden boats; in the background a terraced megacity rises through mist beneath a storm, with hundreds of warm windows, wet reflections, steam, umbrellas, ropes and signage; deep focus, anamorphic highlights, realistic faces, coherent perspective, painterly color grading with documentary-level detail
- 07 Editorial Latin typography: A sophisticated Swiss International Style exhibition poster photographed behind slightly reflective museum glass, with the exact large headline "ORBIT QUANT" and the exact smaller subtitle "DATA WITHOUT CALIBRATION"; strict modular grid, red, black and white screenprint, tiny registration marks, embossed paper fibers, sharp letterforms, dramatic gallery shadows, no other text
- 08 Russian Constructivist typography: A richly detailed Russian Constructivist science-fiction poster with the exact Cyrillic headline "КВАНТОВАЯ ОРБИТА", the exact subtitle "МОСКВА 2049", and a small exact stamp "КВАНТОВАНИЕ"; diagonal red and black geometry, cream paper, cosmonaut portrait, orbital diagrams, halftone grain, folded corners, layered ink, museum archival photograph, all letters crisp and correctly ordered
- 09 Japanese typography and mixed style: An elaborate Japanese art magazine cover combining Edo woodblock printing with a futuristic Tokyo skyline, with the exact vertical title "量子の軌道" and the exact subtitle "東京の未来"; giant indigo waves curl around glass towers, red-crowned cranes cross a gold moon, tiny pedestrians and trains fill the lower streets, visible washi fibers, layered spot colors, precise Japanese glyphs, balanced editorial layout
- 10 Chinese typography, reflection, occlusion: A luxurious Chinese retro-futurist department-store window at night with the exact gold title "量子轨道" and the exact red subtitle "未来之城"; a curved chrome robot is partly occluded by peonies and blue-and-white porcelain, the calligraphy and neon street must appear coherently reflected across its body, multiple glass layers, silk textures, passing bicycles, cinematic rain, fine product-photography detail
Quantization
- Method:
orbitquant - Bits:
W3A3 - Runtime mode:
auto_fused - Activation kernel backend:
auto - Activation normalization epsilon:
1e-10 - Quantization device:
cuda - Weight quantization backend:
triton_cuda - Target policy:
flux2 - AdaLN policy:
int4_rtn_group64_bf16_activation - AdaLN group size:
64 - AdaLN group-size note: paper default.
- Rotation:
rpbh - Rotation seed:
0 - Block size:
paper - Block size policy:
largest_power_of_two_dividing_dim - Codebook:
lloyd_max - Codebook version:
2 - Quantized transformer modules:
100 - AdaLN INT4 modules:
3 - Skipped modules:
6 - Calibration data: none
- Text encoders and VAE: left in source precision by default
Visual Comparison
The following assets are stored in this artifact and compare the BF16 base generation against the OrbitQuant generation with the same prompt and seed.
Source
- Model:
black-forest-labs/FLUX.2-klein-4B - Revision:
e7b7dc27f91deacad38e78976d1f2b499d76a294 - Source license:
apache-2.0 - OrbitQuant paper: https://arxiv.org/abs/2607.02461
Artifact Files
model.safetensors: packed OrbitQuant/INT4 module tensors.quantization_config.json: serialized OrbitQuant runtime settings.orbitquant_manifest.json: source provenance, policies, module lists, and checksums.orbitquant_codebooks.safetensors: Lloyd-Max codebooks.orbitquant_rotations.safetensors: deterministic RPBH rotation metadata.
Limitations
- This is a transformer-component artifact; load it into the source pipeline as shown above.
- CUDA and MPS
auto_fusedinference requires a packed matmul kernel and fails loudly when the required kernel is unavailable. The explicitdequant_bf16reference mode materializes dequantized weights before BF16 matmul. - Quality depends on the source model and bit setting. Very low-bit settings can degrade prompt following or visual detail.
- Downloads last month
- 107
Model tree for WaveCut/FLUX.2-klein-4B-OrbitQuant-W3A3
Base model
black-forest-labs/FLUX.2-klein-4B