Skip to content

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.

Studio: int8 activations on T4 for Qwen-Image-Edit (2.03x per step) (#16813)

Daniel Han7b7ebff5d30b
diff --git a/studio/backend/core/inference/diffusion_small_host.py b/studio/backend/core/inference/diffusion_small_host.py
index d47005e70a0..5cad62161cf 100644
--- a/studio/backend/core/inference/diffusion_small_host.py
+++ b/studio/backend/core/inference/diffusion_small_host.py
@@ -603,8 +603,9 @@ def torch_dtype_map(decision: SmallHostDecision, compute_dtype: Any) -> Any:
INT8_ACT_ENV = "UNSLOTH_DIFFUSION_SMALL_HOST_INT8_ACT"
-# Measured on a T4 (LPIPS inside the fp32-vs-bf16 spread); qwen-image-edit shares the DiT but is unmeasured.
-INT8_ACT_FAMILIES = frozenset({"qwen-image"})
+# Measured on a T4 (LPIPS inside the fp32-vs-bf16 spread). qwen-image-edit shares the DiT: 2.03x per step, same
+# LPIPS distance to the bf16 reference as weight-only int8.
+INT8_ACT_FAMILIES = frozenset({"qwen-image", "qwen-image-edit"})
# torch._int_mm: rows M > 16, K and N multiples of 8.
_INT8_ACT_MIN_ROWS = 17
_INT8_ACT_ALIGN = 8
diff --git a/studio/backend/tests/test_diffusion_small_host_int8_act.py b/studio/backend/tests/test_diffusion_small_host_int8_act.py
index 5fa068718c1..afa3c200ff1 100644
--- a/studio/backend/tests/test_diffusion_small_host_int8_act.py
+++ b/studio/backend/tests/test_diffusion_small_host_int8_act.py
@@ -55,10 +55,13 @@ def test_family_allowlist_and_kill_switch(monkeypatch):
assert sh.int8_act_family(types.SimpleNamespace(name = "qwen-image"))
assert sh.int8_act_family(types.SimpleNamespace(name = "Qwen-Image"))
assert sh.int8_act_family("qwen-image")
- for other in ("qwen-image-edit", "flux.1", "z-image", "hidream-i1", "qwen-image-2.1", None):
+ assert sh.int8_act_family(types.SimpleNamespace(name = "qwen-image-edit"))
+ assert sh.int8_act_family("Qwen-Image-Edit")
+ for other in ("qwen-image-layered", "flux.1", "z-image", "hidream-i1", "qwen-image-2.1", None):
assert not sh.int8_act_family(types.SimpleNamespace(name = other))
monkeypatch.setenv(sh.INT8_ACT_ENV, "0")
assert not sh.int8_act_family(types.SimpleNamespace(name = "qwen-image"))
+ assert not sh.int8_act_family(types.SimpleNamespace(name = "qwen-image-edit"))
def test_quantize_sets_the_flag_only_when_asked():