FLUX 3 Image Klein Prompt Upsampler SDNQ INT8

bf16 INT8
bf16 INT8

Left: original bf16 upsampler ยท Right: this INT8 upsampler (same request and seed, both generated with the bf16 FLUX 3 Image Klein).

This is a dynamic 8-bit quantized version of black-forest-labs/flux-3-image-klein-pup, the prompt upsampler of FLUX 3 Image Klein, using SDNQ. The language model, the vision tower and the token embeddings are quantized; lm_head stays in bf16.

Note: You need SDNQ v0.2.8 or superior and a diffusers version with the FLUX 3 prompt upsampler block.

Usage

You can find ready-to-use scripts in the diffusers-recipes repository. For 16 GB GPUs and up, use sdnq_prompt_upsampler_model_cpu_offload.py; for 12 GB GPUs, use sdnq_prompt_upsampler_two_stage.py, which writes the caption first and then generates the image.

The upsampler replaces the prompt_upsampler component of the FLUX 3 Image Klein pipeline. Import sdnq before loading so the quantized weights are registered. Decoding is slower than with the bf16 upsampler (about 22 vs 70 tokens/s on an RTX 5090).

For the system prompts, layout boxes and image editing, see the original model card.

Sample image

The INT8 image above was generated with the following request and settings (seed 7):

import sdnq  # noqa: F401
import torch
from diffusers import ModularPipeline
from transformers import AutoProcessor, Qwen3_5ForConditionalGeneration


upsampler_id = "OzzyGT/Flux_3_Image_Klein_pup_sdnq_dynamic_8bit"

pipe = ModularPipeline.from_pretrained("black-forest-labs/flux-3-image-klein")
pipe.update_components(
    prompt_upsampler=Qwen3_5ForConditionalGeneration.from_pretrained(upsampler_id, dtype=torch.bfloat16),
    prompt_upsampler_processor=AutoProcessor.from_pretrained(upsampler_id),
)
pipe.load_components(dtype=torch.bfloat16)
pipe.to("cuda")

prompt = "A small neighborhood pet shop: a tabby cat on the counter, a golden retriever in a wicker basket and a scarlet macaw perched above an aquarium. The sign over the door reads WHISKERS & WAGS."

output = pipe(
    prompt=prompt,
    height=1152,
    width=2048,
    generator=torch.Generator().manual_seed(7),
    output=["images", "prompt"],
)
print(output["prompt"])  # the caption written by the upsampler
output["images"][0].save("flux3_klein_pup_int8.png")

License

This model is released under the Apache License 2.0, the same as the original. It is derived from Qwen3.5-9B by the Qwen team at Alibaba Cloud.

Downloads last month
69
Safetensors
Model size
9B params
Tensor type
BF16
ยท
I8
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for OzzyGT/Flux_3_Image_Klein_pup_sdnq_dynamic_8bit

Finetuned
Qwen/Qwen3.5-9B
Quantized
(18)
this model