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: FLUX.3 Image Klein on the native sd.cpp engine (#14144)

Daniel Han2429c7a30f72
diff --git a/studio/backend/core/inference/diffusion_families.py b/studio/backend/core/inference/diffusion_families.py
index 22eb86f4f4e..463eb4ff1ef 100644
--- a/studio/backend/core/inference/diffusion_families.py
+++ b/studio/backend/core/inference/diffusion_families.py
@@ -211,6 +211,9 @@ class DiffusionFamily:
sd_cpp_arch_marker: Optional[str] = None
# Literal an sd.cpp build carries once it can EDIT this family; the arch marker proves text-to-image only.
sd_cpp_edit_marker: Optional[str] = None
+ # sd.cpp feeds this family's reference images through the VAE (no vision projector), so any build the arch marker
+ # admits runs the reference workflow natively.
+ sd_cpp_reference: bool = False
# True when Unsloth can TRAIN a LoRA on this family; the training-start path refuses a non-trainable family up
# front.
trainable: bool = False
@@ -299,6 +302,23 @@ _HIDREAM_BF16_WHEN_RESIDENT = (
"INT8 is barely faster than compiled bf16 on a card that holds bf16 and changes image detail"
)
+# FLUX.3 Klein's encoder is Qwen3-VL-4B-Instruct (byte-identical), read by sd.cpp through --llm with hidden states 4..32.
+# References go through the VAE, not the vision tower, so editing needs no projector. Q8_0 rather than Q4_K_M: the
+# encoder quant dominates the error here. Against a BF16 DiT + BF16 encoder render (sd.cpp, 4 prompts, 1024, same
+# seeds, B200), LPIPS-alex mean with the Q8_0 DiT is 0.031 (Q8_0 encoder) vs 0.080 (Q4_K_M) on the distilled model and
+# 0.008 vs 0.082 on the base; with UD-Q4_K_XL 0.068 vs 0.090 and 0.110 vs 0.109. 4.28 GB against 2.50 GB.
+_FLUX3_SD_CPP_TEXT_ENCODERS = (
+ (
+ "unsloth/Qwen3-VL-4B-Instruct-GGUF",
+ "Qwen3-VL-4B-Instruct-Q8_0.gguf",
+ "llm",
+ ),
+)
+# FLUX.3 landed upstream in master-968 (leejet/stable-diffusion.cpp#2143), after builds were in the wild. The model
+# version name is in every sd-cli / sd-server that can run it and in none before.
+_FLUX3_SD_CPP_ARCH_MARKER = "Flux.3 Image Klein"
+
+
# Keyed by architecture, not per variant: the base repo is read from the HF base_model tag at load time, so one entry
# covers Turbo/full, schnell/dev.
_FAMILIES: tuple[DiffusionFamily, ...] = (
@@ -474,6 +494,15 @@ _FAMILIES: tuple[DiffusionFamily, ...] = (
# fp8 denoiser, measured on B200, against the estimator's 8192 MiB per megapixel: 0.11 covers the quantised
# figure.
condition_pixel_weight = 0.11,
+ # Native (sd.cpp) assets, the same set as the distilled entry: see there.
+ sd_cpp_vae = (
+ "unsloth/flux-3-image-klein-base-FP8",
+ "vae/diffusion_pytorch_model.safetensors",
+ ),
+ sd_cpp_text_encoders = _FLUX3_SD_CPP_TEXT_ENCODERS,
+ sd_cpp_sampling_method = "euler",
+ sd_cpp_arch_marker = _FLUX3_SD_CPP_ARCH_MARKER,
+ sd_cpp_reference = True,
),
DiffusionFamily(
name = "flux.3-klein",
@@ -509,6 +538,16 @@ _FAMILIES: tuple[DiffusionFamily, ...] = (
max_condition_images = 10,
dimension_multiple = 16,
condition_pixel_weight = 0.11,
+ # Native (sd.cpp) assets. sd.cpp reads the unsloth/flux-3-image-klein[-base]-GGUF denoisers as published
+ # (BFL tensor names, detected from emb_in.image + txt_mode_blocks). The VAE is the FLUX.2 VAE, byte-identical
+ # in both FP8 repos and in unsloth/FLUX.2-VAE (sha256 d64f3a68...), taken from this family's own FP8 repo,
+ # which prequant_repos keeps loadable. sd.cpp detects its layout itself, so no --vae-format.
+ sd_cpp_vae = ("unsloth/flux-3-image-klein-FP8", "vae/diffusion_pytorch_model.safetensors"),
+ sd_cpp_text_encoders = _FLUX3_SD_CPP_TEXT_ENCODERS,
+ # sd.cpp's documented invocation (docs/flux3.md). No flow shift: its scheduler already applies FLUX.3's 6.93.
+ sd_cpp_sampling_method = "euler",
+ sd_cpp_arch_marker = _FLUX3_SD_CPP_ARCH_MARKER,
+ sd_cpp_reference = True,
),
# FLUX.2-dev: full (non-distilled) FLUX.2 on the Mistral Flux2Pipeline, so its own entry. Gated base,
# text-to-image only; sd-cli takes the Mistral encoder from unsloth/FLUX.2-dev-ComfyUI and the VAE from
diff --git a/studio/backend/core/inference/sd_cpp_args.py b/studio/backend/core/inference/sd_cpp_args.py
index a744b9d072b..e55f9d65562 100644
--- a/studio/backend/core/inference/sd_cpp_args.py
+++ b/studio/backend/core/inference/sd_cpp_args.py
@@ -38,6 +38,9 @@ _TE_FLAGS_BY_FAMILY: dict[str, tuple[str, ...]] = {
# that also turns on Qwen2-VL's vision path, so it is the wrong door even though both names
# reach the same field.
"qwen-image-2.1": ("--llm",),
+ # Qwen3-VL-4B through --llm, as qwen-image-2.1.
+ "flux.3-klein": ("--llm",),
+ "flux.3-klein-base": ("--llm",),
"flux.1": ("--clip_l", "--t5xxl"),
"flux.1-kontext": ("--clip_l", "--t5xxl"),
}
diff --git a/studio/backend/core/inference/sd_cpp_backend.py b/studio/backend/core/inference/sd_cpp_backend.py
index 08432a0e9c6..efa7b48aa11 100644
--- a/studio/backend/core/inference/sd_cpp_backend.py
+++ b/studio/backend/core/inference/sd_cpp_backend.py
@@ -3168,6 +3168,11 @@ class SdCppDiffusionBackend:
local_files_only = local_files_only,
vision_optional = not getattr(fam, "edit", False),
)
+ # A renamed or local FLUX.3 GGUF loaded under the other variant would run the wrong defaults (steps, CFG,
+ # negative prompt); the same refusal as the diffusers loader, before any native state is committed.
+ from core.inference.diffusion_families import assert_flux3_checkpoint_matches_family
+
+ assert_flux3_checkpoint_matches_family(fam, paths["diffusion_model"])
sample_sigmas, grid_base = _base_sample_sigmas(
repo_id,
base,
@@ -3990,6 +3995,15 @@ class SdCppDiffusionBackend:
return False
return binary_carries_marker(binary, marker, unreadable = False)
+ def _native_reference_ready(self, state: Optional[_SdState], workflow: Optional[str]) -> bool:
+ """Projector-free references (FLUX.3): sd.cpp feeds them through the VAE, so the arch gate that admitted the
+ load is all a reference call needs. Not an instruction edit."""
+ return (
+ state is not None
+ and bool(getattr(state.family, "sd_cpp_reference", False))
+ and workflow in (None, "reference")
+ )
+
def generate(
self,
*,
@@ -4132,7 +4146,10 @@ class SdCppDiffusionBackend:
controlnet = controlnet,
localized_edit = localized_edit,
)
- if not self._native_edit_ready(state):
+ if not (
+ self._native_edit_ready(state)
+ or self._native_reference_ready(state, workflow)
+ ):
raise ValueError(
f"Image editing is not available for '{state.family.name}' on the native "
"sd.cpp engine with this build and its assets."
@@ -4764,6 +4781,8 @@ class SdCppDiffusionBackend:
workflows = ["txt2img"]
if self._native_edit_ready(state):
workflows += ["reference", "edit"]
+ elif self._native_reference_ready(state, "reference"):
+ workflows.append("reference")
conditioning = conditioning_capabilities(state.family, workflows)
# No reference detail natively: sd.cpp sizes inputs to the output area.
conditioning["reference_resolutions"] = []
diff --git a/studio/backend/tests/test_diffusion_more_families.py b/studio/backend/tests/test_diffusion_more_families.py
index ad22294d41b..77023434ae1 100644
--- a/studio/backend/tests/test_diffusion_more_families.py
+++ b/studio/backend/tests/test_diffusion_more_families.py
@@ -853,10 +853,12 @@ def test_the_pinned_prebuilt_is_one_that_can_load_qwen_image_21():
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
- assert module.DEFAULT_TAG == "master-951-f89d9b1-uafac7a7", (
- "the pinned prebuilt must be one built from a tree carrying Qwen-Image-2.1; "
+ assert module.DEFAULT_TAG == "master-968-8cd731e-ubdb47d1", (
+ "the pinned prebuilt must be one built from a tree carrying Qwen-Image-2.1 and FLUX.3; "
f"{module.DEFAULT_TAG} is not"
)
+ # FLUX.3 Image Klein landed upstream in master-968; the upstream fallback installs the pin's base.
+ assert int(module.DEFAULT_TAG.split("-")[1]) >= 968
def test_a_minimum_that_has_not_shipped_does_not_prescribe_an_impossible_upgrade(
diff --git a/studio/backend/tests/test_sd_cpp_args.py b/studio/backend/tests/test_sd_cpp_args.py
index 92877cff1b9..5f567314cfc 100644
--- a/studio/backend/tests/test_sd_cpp_args.py
+++ b/studio/backend/tests/test_sd_cpp_args.py
@@ -1124,7 +1124,8 @@ def _all_builders(binary, extra_args = None):
@pytest.mark.parametrize(
"tag, expected",
[
- ("master-951-f89d9b1-uafac7a7", True), # the pinned bundle
+ ("master-968-8cd731e-ubdb47d1", True), # the pinned bundle
+ ("master-951-f89d9b1-uafac7a7", True), # the previous pin
("master-907-500ef5f", True), # the build that merged #2037
("master-906-abcdef0", False), # --mmap there hands Metal an unaddressable CPU buffer
("master-813-bfbef5b-u6321a69", False),
diff --git a/studio/backend/tests/test_sd_cpp_flux3.py b/studio/backend/tests/test_sd_cpp_flux3.py
new file mode 100644
index 00000000000..99a38d571b7
--- /dev/null
+++ b/studio/backend/tests/test_sd_cpp_flux3.py
@@ -0,0 +1,223 @@
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+"""Native (sd.cpp) FLUX.3 Klein and Klein Base: the single-file assets sd-cli is handed, the text-encoder flag,
+the companion-repo classification, and the architecture gate that keeps a pre-FLUX.3 build off the native route."""
+
+from __future__ import annotations
+
+from types import SimpleNamespace
+
+import pytest
+
+from core.inference import diffusion_engine_router as r
+from core.inference.diffusion_families import (
+ detect_family,
+ family_sd_cpp_supported,
+ sd_cpp_companion_only_repo_ids,
+ sd_cpp_text_encoders_for,
+)
+from core.inference.sd_cpp_args import text_encoder_flags_for_family
+from core.inference.sd_cpp_backend import SdCppDiffusionBackend, sd_cpp_binary_runs_family
+from core.inference.sd_cpp_engine import ENGINE_DIFFUSERS, ENGINE_SD_CPP
+
+from .test_sd_cpp_backend import _FakeEngine
+
+_TE = ("unsloth/Qwen3-VL-4B-Instruct-GGUF", "Qwen3-VL-4B-Instruct-Q8_0.gguf", "llm")
+_VAE_FILE = "vae/diffusion_pytorch_model.safetensors"
+# (GGUF repo, GGUF file, family name, the FP8 repo its VAE comes from)
+_CASES = (
+ (
+ "unsloth/flux-3-image-klein-GGUF",
+ "flux-3-image-klein-UD-Q4_K_XL.gguf",
+ "flux.3-klein",
+ "unsloth/flux-3-image-klein-FP8",
+ ),
+ (
+ "unsloth/flux-3-image-klein-base-GGUF",
+ "flux-3-image-klein-base-UD-Q4_K_XL.gguf",
+ "flux.3-klein-base",
+ "unsloth/flux-3-image-klein-base-FP8",
+ ),
+)
+
+
[email protected]("repo, gguf, name, fp8_repo", _CASES)
+def test_the_gguf_repo_maps_to_its_native_assets(repo, gguf, name, fp8_repo):
+ fam = detect_family(repo)
+ assert fam is not None and fam.name == name
+ assert family_sd_cpp_supported(fam)
+ assert fam.sd_cpp_vae == (fp8_repo, _VAE_FILE)
+ # sd.cpp detects the FLUX.2 VAE layout for FLUX.3 itself, and applies FLUX.3's own 6.93 shift.
+ assert fam.sd_cpp_vae_format is None
+ assert fam.sd_cpp_flow_shift is None
+ assert fam.sd_cpp_sampling_method == "euler"
+ assert sd_cpp_text_encoders_for(fam, repo, gguf) == (_TE,)
+ # References go through the VAE: no projector is planned, so text-to-image and editing fetch the same files.
+ assert not any(kind == "llm_vision" for _r, _f, kind in fam.sd_cpp_text_encoders)
+ assert text_encoder_flags_for_family(name) == ("--llm",)
+
+
[email protected]("repo, gguf, name, fp8_repo", _CASES)
+def test_the_load_plans_the_vae_and_the_encoder(repo, gguf, name, fp8_repo):
+ specs = SdCppDiffusionBackend(engine = _FakeEngine())._asset_specs(
+ repo, gguf, detect_family(repo)
+ )
+ assert (fp8_repo, _VAE_FILE, "vae") in specs
+ assert _TE in specs
+
+
+def test_the_encoder_repo_is_a_companion_and_the_fp8_repos_stay_loadable():
+ companions = sd_cpp_companion_only_repo_ids()
+ assert "unsloth/qwen3-vl-4b-instruct-gguf" in companions
+ # The VAE lives in the prequant repos, which carry real denoisers and must stay in the catalog.
+ assert "unsloth/flux-3-image-klein-fp8" not in companions
+ assert "unsloth/flux-3-image-klein-base-fp8" not in companions
+
+
+def _binary(tmp_path, name, *, marker):
+ path = tmp_path / name
+ body = (
+ b"ELF-ish padding " * 64 + (b"Flux.3 Image Klein" if marker else b"Flux.2 Klein") + b" tail"
+ )
+ path.write_bytes(body)
+ return str(path)
+
+
[email protected]("name", ["flux.3-klein", "flux.3-klein-base"])
+def test_a_build_without_flux3_cannot_run_the_family(tmp_path, name):
+ fam = detect_family(name)
+ assert fam.sd_cpp_arch_marker == "Flux.3 Image Klein"
+ assert not sd_cpp_binary_runs_family(_binary(tmp_path, "old", marker = False), fam)
+ assert sd_cpp_binary_runs_family(_binary(tmp_path, "new", marker = True), fam)
+
+
+def _router(monkeypatch):
+ r._supported_family_capabilities.cache_clear()
+ for e in (
+ "UNSLOTH_DIFFUSION_ENGINE",
+ "UNSLOTH_DIFFUSION_SD_CPP",
+ "UNSLOTH_DIFFUSION_SD_CPP_MPS",
+ "UNSLOTH_DIFFUSION_SD_CPP_INSTALL",
+ ):
+ monkeypatch.delenv(e, raising = False)
+ monkeypatch.setattr(
+ r,
+ "get_active_diffusion_engine",
+ lambda: SimpleNamespace(
+ status = lambda: {"loaded": False, "repo_id": None}, unload = lambda: None
+ ),
+ )
+ monkeypatch.setattr(r, "ensure_sd_server_binary", lambda **_: None)
+ monkeypatch.setattr(r, "_server_binary_runnable", lambda *_a, **_k: True)
+ monkeypatch.setattr(
+ r,
+ "resolve_diffusion_device_target",
+ lambda: SimpleNamespace(backend = "cpu", device = "cpu"),
+ )
+ monkeypatch.setattr(r, "SdCppEngine", lambda **_: SimpleNamespace(version = lambda: "sd-cli v0"))
+ saved = (r._active_engine_name, r._fallback_reason)
+ try:
+ yield
+ finally:
+ r._active_engine_name, r._fallback_reason = saved
+ r._supported_family_capabilities.cache_clear()
+
+
[email protected]("name", ["flux.3-klein", "flux.3-klein-base"])
+def test_no_gpu_host_routes_flux3_gguf_to_sd_cpp_only_on_a_capable_build(
+ _router, monkeypatch, tmp_path, name
+):
+ fam = detect_family(name)
+ monkeypatch.setattr(
+ r, "ensure_sd_cpp_binary", lambda **_: _binary(tmp_path, "sd-cli-old", marker = False)
+ )
+ r.select_and_activate_engine(fam)
+ assert r.active_engine_name() == ENGINE_DIFFUSERS
+ assert "predates" in (r._fallback_reason or "")
+
+ monkeypatch.setattr(
+ r, "ensure_sd_cpp_binary", lambda **_: _binary(tmp_path, "sd-cli-new", marker = True)
+ )
+ r.select_and_activate_engine(fam)
+ assert r.active_engine_name() == ENGINE_SD_CPP
+
+
+def _flux3_native_state(name):
+ import core.inference.sd_cpp_backend as bk
+ from core.inference.sd_cpp_engine import SdCppModelFiles
+
+ fam = detect_family("", override = name)
+ files = SdCppModelFiles(
+ diffusion_model = "/m/flux3.gguf", vae = "/m/vae.safetensors", llm = "/m/te.gguf"
+ )
+ return bk._SdState(
+ repo_id = "unsloth/flux-3-image-klein-GGUF",
+ base_repo = fam.base_repo,
+ family = fam,
+ device = "cpu",
+ files = files,
+ sampling_method = fam.sd_cpp_sampling_method,
+ mode = "oneshot",
+ server = None,
+ )
+
+
+def _ref_png(color):
+ import base64
+ import io
+
+ from PIL import Image
+
+ buf = io.BytesIO()
+ Image.new("RGB", (64, 64), color).save(buf, format = "PNG")
+ return "data:image/png;base64," + base64.b64encode(buf.getvalue()).decode()
+
+
[email protected]("name", ["flux.3-klein", "flux.3-klein-base"])
+def test_flux3_references_run_natively_without_a_projector(monkeypatch, name):
+ # sd.cpp feeds FLUX.3 references through the VAE: no vision projector, no edit marker.
+ from PIL import Image
+
+ engine = _FakeEngine()
+ b = SdCppDiffusionBackend(engine = engine)
+ b._state = _flux3_native_state(name)
+ status = b.status()
+ assert "reference" in status["workflows"] and "edit" not in status["workflows"]
+ seen = {}
+
+ def _capture(files, params, output_path, **kw):
+ seen["refs"] = len(params.ref_images)
+ Image.new("RGB", (1, 1)).save(output_path)
+
+ monkeypatch.setattr(engine, "generate", _capture)
+ out = b.generate(
+ prompt = "p",
+ steps = 2,
+ workflow = "reference",
+ width = 512,
+ height = 512,
+ init_image = _ref_png((10, 0, 0)),
+ reference_images = [_ref_png((20, 0, 0))],
+ )
+ assert seen["refs"] == 2 and out["workflow"] == "reference"
+ # An instruction edit is still not something these families do natively.
+ with pytest.raises(ValueError, match = "Image editing is not available"):
+ b.generate(
+ prompt = "p", workflow = "edit", init_image = _ref_png((1, 1, 1)), width = 512, height = 512
+ )
+
+
+def test_the_native_load_refuses_the_other_flux3_variant():
+ # The diffusers loader's variant refusal runs on the native path too, right after the assets resolve and before
+ # the sigmas and the native state are built.
+ import inspect
+
+ import core.inference.sd_cpp_backend as bk
+
+ src = inspect.getsource(bk.SdCppDiffusionBackend._run_load)
+ fetch = src.index("paths = self._fetch_assets(")
+ check = src.index('assert_flux3_checkpoint_matches_family(fam, paths["diffusion_model"])')
+ sigmas = src.index("sample_sigmas, grid_base = _base_sample_sigmas(")
+ assert fetch < check < sigmas
diff --git a/studio/backend/tests/test_sd_cpp_install.py b/studio/backend/tests/test_sd_cpp_install.py
index 415067676e1..169b5a646b0 100644
--- a/studio/backend/tests/test_sd_cpp_install.py
+++ b/studio/backend/tests/test_sd_cpp_install.py
@@ -1474,8 +1474,8 @@ def test_the_shipped_pin_falls_back_to_an_upstream_release_that_runs_qwen_image_
assert repo == sdmod.UPSTREAM_FALLBACK_REPO
assert chosen.endswith("-win-cuda12-x64.zip")
assert release["tag_name"] == upstream_tag_for(DEFAULT_TAG)
- # Qwen-Image-2.1 landed upstream in master-883, its reference-alpha fix in master-896.
- assert int(release["tag_name"].split("-")[1]) >= 896
+ # Qwen-Image-2.1 landed upstream in master-883, its reference-alpha fix in master-896, FLUX.3 in master-968.
+ assert int(release["tag_name"].split("-")[1]) >= 968
# ── mirror -> upstream fallback in install() ─────────────────────────────────
diff --git a/studio/backend/tests/test_sd_cpp_vulkan_cpu_torch.py b/studio/backend/tests/test_sd_cpp_vulkan_cpu_torch.py
index 4087e1462d9..9a4ce7c458c 100644
--- a/studio/backend/tests/test_sd_cpp_vulkan_cpu_torch.py
+++ b/studio/backend/tests/test_sd_cpp_vulkan_cpu_torch.py
@@ -310,13 +310,13 @@ def test_selection_installs_the_vulkan_build(monkeypatch):
_PINNED_RELEASE_ASSETS = [
- "sd-master-951-f89d9b1-uafac7a7-bin-Linux-Ubuntu-22.04-x86_64-cuda12.zip",
- "sd-master-951-f89d9b1-uafac7a7-bin-Linux-Ubuntu-22.04-x86_64-vulkan.zip",
- "sd-master-951-f89d9b1-uafac7a7-bin-Linux-Ubuntu-22.04-x86_64.zip",
- "sd-master-951-f89d9b1-uafac7a7-bin-Linux-Ubuntu-24.04-aarch64.zip",
- "sd-master-951-f89d9b1-uafac7a7-bin-win-cpu-x64.zip",
- "sd-master-951-f89d9b1-uafac7a7-bin-win-cuda12-x64.zip",
- "sd-master-951-f89d9b1-uafac7a7-bin-win-vulkan-x64.zip",
+ "sd-master-968-8cd731e-ubdb47d1-bin-Linux-Ubuntu-22.04-x86_64-cuda12.zip",
+ "sd-master-968-8cd731e-ubdb47d1-bin-Linux-Ubuntu-22.04-x86_64-vulkan.zip",
+ "sd-master-968-8cd731e-ubdb47d1-bin-Linux-Ubuntu-22.04-x86_64.zip",
+ "sd-master-968-8cd731e-ubdb47d1-bin-Linux-Ubuntu-24.04-aarch64.zip",
+ "sd-master-968-8cd731e-ubdb47d1-bin-win-cpu-x64.zip",
+ "sd-master-968-8cd731e-ubdb47d1-bin-win-cuda12-x64.zip",
+ "sd-master-968-8cd731e-ubdb47d1-bin-win-vulkan-x64.zip",
]
@@ -326,9 +326,9 @@ _PINNED_RELEASE_ASSETS = [
(
"Linux",
"x86_64",
- "sd-master-951-f89d9b1-uafac7a7-bin-Linux-Ubuntu-22.04-x86_64-vulkan.zip",
+ "sd-master-968-8cd731e-ubdb47d1-bin-Linux-Ubuntu-22.04-x86_64-vulkan.zip",
),
- ("Windows", "AMD64", "sd-master-951-f89d9b1-uafac7a7-bin-win-vulkan-x64.zip"),
+ ("Windows", "AMD64", "sd-master-968-8cd731e-ubdb47d1-bin-win-vulkan-x64.zip"),
("Linux", "aarch64", None),
],
)
diff --git a/studio/install_sd_cpp_prebuilt.py b/studio/install_sd_cpp_prebuilt.py
index e0e6478da19..94ea1852b54 100644
--- a/studio/install_sd_cpp_prebuilt.py
+++ b/studio/install_sd_cpp_prebuilt.py
@@ -40,9 +40,10 @@ DEFAULT_REPO = "unslothai/stable-diffusion.cpp"
UPSTREAM_FALLBACK_REPO = "leejet/stable-diffusion.cpp"
# Pinned for reproducibility; UNSLOTH_SD_CPP_TAG overrides (empty tracks latest) and a missing tag falls back to latest. The -u<id> suffix is the mirror's patch set: an unpatched build aborts on the default --cfg-scale and on --vae-on-cpu, and quantizes MiniMax-H3's 1-D norms into an output uncorrelated with its own bf16 reference (leejet/stable-diffusion.cpp#1861, #1862, #1863).
# The base must carry every family's sd_cpp_arch_marker / sd_cpp_edit_marker: hosts the mirror does
-# not build (ROCm) install it from upstream. master-813, the previous base, predates Qwen-Image-2.1
-# (master-883) and its reference-alpha fix (master-896). CUDA bundles carry no CUDA runtime.
-DEFAULT_TAG = "master-951-f89d9b1-uafac7a7"
+# not build (ROCm) install it from upstream. master-951, the previous base, predates FLUX.3 Image Klein
+# (master-968); master-813 before it predated Qwen-Image-2.1 (master-883) and its reference-alpha fix
+# (master-896). CUDA bundles carry no CUDA runtime.
+DEFAULT_TAG = "master-968-8cd731e-ubdb47d1"
REPO = DEFAULT_REPO