| --- |
| license: other |
| license_name: picsart-flowdis-model-license |
| license_link: LICENSE |
| base_model: PAIR/FlowDIS |
| tags: |
| - image-segmentation |
| - dichotomous-image-segmentation |
| - quantization |
| - int8 |
| - flux |
| --- |
| |
| # FlowDIS transformer — INT8 ConvRot |
|
|
| INT8 quantization of the [FlowDIS](https://huggingface.co/PAIR/FlowDIS) DiT |
| (12B, FLUX.1-schnell architecture) with group-wise Hadamard rotations |
| ([ConvRot, arXiv:2512.03673](https://arxiv.org/abs/2512.03673)), in the |
| ComfyUI-native quantized checkpoint format produced by |
| [convert_to_quant](https://pypi.org/project/convert-to-quant/). |
|
|
| Made for [Any Prompt DIS](https://github.com/Albertchen98/any-prompt-dis), whose |
| low-VRAM mode (`--int8 --t5-int4`) runs the full segmentation pipeline in |
| **~21 GiB peak VRAM at 1024²** (~18.4 GiB at 512²) — it fits a 24 GB card, which the |
| bf16 pipeline (~35 GiB peak) does not. Quantizing this checkpoint yourself requires |
| loading the bf16 transformer, so a 24 GB card also cannot produce it locally — |
| hence this pre-quantized upload. |
|
|
| ## Details |
|
|
| - 228 `double_blocks`/`single_blocks` linear layers quantized to INT8 |
| (row-wise scales, ConvRot group size 256, rotations pre-applied to weights); |
| input/modulation/final layers kept in bf16. |
| - End-to-end relative error vs bf16: ~1.2% on mask latents; visually |
| indistinguishable masks in our tests. |
| - Runtime: `flowdis/quant.py` in the repo above — uses the fused |
| `comfy-kitchen` INT8 kernel when available (quantized linears ~1.5× faster |
| than bf16), otherwise a `torch.compile` fallback. |
|
|
| Reproduce from the bf16 checkpoint: |
|
|
| ```bash |
| pip install convert-to-quant |
| ctq -i flowdis-transformer.safetensors \ |
| -o flowdis-transformer-int8-convrot.safetensors \ |
| --comfy_quant --int8 --convrot --convrot-group-size 256 \ |
| --exclude-layers "img_in|txt_in|time_in|vector_in|mod|final_layer" \ |
| --save-quant-metadata |
| ``` |
|
|
| ## Usage |
|
|
| ```bash |
| # place it next to the other FlowDIS weights: |
| hf download Albertchen96/FlowDIS-int8-convrot flowdis-transformer-int8-convrot.safetensors \ |
| --local-dir <root_model_dir> |
| |
| # then, in the any-prompt-dis repo: |
| python inference_si.py --root-model-dir <root_model_dir> --int8 \ |
| --image-path input.jpg --prompt "dog" --output-path mask.png |
| ``` |
|
|
| ## License |
|
|
| Derivative of the FlowDIS weights by Picsart AI Research; distributed under the |
| same [PicsArt Inc. FlowDIS Model License](LICENSE) (non-commercial). Review it |
| before redistribution or commercial use. |
|
|