Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: quantize Qwen-Image-2.1-Turbo NVFP4 with the Qwen-Image-2.1 layer policy (#16757)
Daniel Hane2daf1698621
diff --git a/studio/backend/core/inference/diffusion_nvfp4_policy.py b/studio/backend/core/inference/diffusion_nvfp4_policy.pyindex 4779b648907..c9672c45e64 100644--- a/studio/backend/core/inference/diffusion_nvfp4_policy.py+++ b/studio/backend/core/inference/diffusion_nvfp4_policy.py@@ -147,7 +147,10 @@ QWEN21_R020 = NVFP4Policy(policy_id = "qwen21_r020_v1",version = 1,family = "qwen-image-2.1",- base_repos = ("qwen/qwen-image-2.1",),+ # Turbo is a distill of the same 32-block DiT (identical linear names and shapes) and quantizes its own weights at+ # load (no hosted artifact). Without a policy every linear went nvfp4: LPIPS 0.10 against its bf16 render on a G4,+ # where this assignment (ComfyUI arm, same layers) scored 0.011.+ base_repos = ("qwen/qwen-image-2.1", "qwen/qwen-image-2.1-turbo"),rules = (Rule(suffix = "norm_out.linear", precision = PRECISION_NVFP4, expect = 1),*_per_block("attn.to_k", "transformer_blocks", (5, 7, 13) + tuple(range(15, 28))),diff --git a/studio/backend/tests/test_diffusion_nvfp4_policy.py b/studio/backend/tests/test_diffusion_nvfp4_policy.pyindex 72a28bccda6..fb5c986f954 100644--- a/studio/backend/tests/test_diffusion_nvfp4_policy.py+++ b/studio/backend/tests/test_diffusion_nvfp4_policy.py@@ -220,6 +220,9 @@ def test_a_policy_resolves_for_the_bases_it_was_solved_on_and_no_others():assert resolve_policy("qwen-image", "unsloth/Qwen-Image-2512") is QWEN2512_M120_ATTN8assert resolve_policy("qwen-image-2.1", "Qwen/Qwen-Image-2.1") is QWEN21_R020assert resolve_policy("qwen-image-2.1", "unsloth/Qwen-Image-2.1") is QWEN21_R020+ assert resolve_policy("qwen-image-2.1", "Qwen/Qwen-Image-2.1-Turbo") is QWEN21_R020+ assert resolve_policy("qwen-image-2.1", "unsloth/Qwen-Image-2.1-Turbo-FP8") is QWEN21_R020+ assert resolve_policy("qwen-image", "Qwen/Qwen-Image-2.1-Turbo") is Noneassert resolve_policy("qwen-image", "Qwen/Qwen-Image-2.1") is Noneassert resolve_policy("qwen-image-2.1", "Qwen/Qwen-Image-2512") is Noneassert resolve_policy("z-image", "unsloth/Z-Image-Turbo") is ZIMG_RG76