Views
No views yet
Language: English | 中文
tonera/Qwen3-text-Nunchaku is a quantized Qwen3 text encoder for the FLUX.2 klein family. It can be used as a drop-in replacement for the pipeline text_encoder.Note: As of 2026-04-09, the Nunchaku PR for this functionality has still not been merged into the official main branch. If you want to try it early, you can pull and merge the code from nunchaku-ai/nunchaku#927.
1import torch
2from diffusers import Flux2KleinPipeline
3
4from nunchaku import NunchakuQwenEncoderModel
5
6text_encoder = NunchakuQwenEncoderModel.from_pretrained(
7 "tonera/Qwen3-text-Nunchaku/svdq-int4-Qwen3-text-Nunchaku.safetensors",
8 device="cuda",
9 torch_dtype=torch.bfloat16,
10)
11pipeline = Flux2KleinPipeline.from_pretrained(
12 "black-forest-labs/FLUX.2-klein-9B",
13 text_encoder=text_encoder,
14 torch_dtype=torch.bfloat16,
15).to("cuda")
16
17image = pipeline(
18 "A cat holding a sign that says hello world",
19 num_inference_steps=4,
20 guidance_scale=1.0,
21).images[0]
22image.save("flux2-klein-qwen3-text.png")transformer= argument of Flux2KleinPipeline.hidden_states_last in data.json:| Metric | Value |
|---|---|
| Cosine similarity | 0.995844 |
| Relative L2 | 0.091183 |
| Max absolute error | 6.539062 |