vistralis/FLUX.2-klein-4b-INT8-transformer-quants
1120
FLUX.2-klein-4b-INT8-transformer-quants
INT8 (W8A8) quantization variants for FLUX.2-klein-4B (step-distilled 4B parameters).
This repository contains multiple INT8 quantization variants for experimentation and comparison.
Status: Static/Max variants (int8-per-row,int8-per-tensor) are available now. SmoothQuant variants are pending and will be added when ready.
Quantization Details
All variants use NVIDIA TensorRT Model Optimizer (ModelOpt) INT8 (W8A8) quantization:
Algorithm × Scale Mode
Algorithm:
- Static (Max): Standard INT8 quantization with calibrated min/max ranges
- SmoothQuant (pending): Migrates quantization difficulty from activations to weights for better accuracy
Scale Mode:
- Per-Row: Independent scale per output channel (finer granularity, higher accuracy)
- Per-Tensor: Single scale per tensor (faster, lower memory, slightly reduced accuracy)
Note: In all variants, input activations are always quantized dynamically per-row at inference time (one scale per token). The scale mode above refers to the weight quantization granularity.
Evaluation Results
Compared against BF16 baseline using identical prompts, seeds, and resolution.
Overall Metrics
Text-to-Image
Dramatic chiaroscuro portrait of a cellist mid-performance, single spotlight from above, instrument bow caught in motion blur, concert hall darkness
Stained glass window design depicting the four elements, lead came outlines, rich jewel tones of ruby, sapphire, emerald, and topaz
Editing
Base: A bicycle leaning against a stone wall in a village Edit: Transform the village into an underwater coral reef scene, the bicycle covered in barnacles and sea anemones, fish swimming around
Base: A food truck parked on a city street at noon Edit: Change the street to a Venice canal with the food truck floating on a gondola platform, evening golden hour lighting
Composition
Create a zen garden where the raked sand patterns flow into and around a giant ramen bowl as the central stone
A clockwork mechanical wolf made of brass gears howling at the full moon on the snowy ridge, steam rising from its joints
Usage
🚧 Code release coming soon. A pip-installable loader library is in preparation.
In the meantime, these checkpoints can be tested with ComfyUI using the ComfyUI-Flux2-INT8 custom node. Per-row quantization support is available via PR #24.
Technical Details
License
This model inherits the license from the base model: [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0).
