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.

Fix the diffusion scheduler, parity, formatter and bundle reds on main (#13612)

Daniel Hanb8d76e1696cd
diff --git a/studio/backend/core/inference/diffusion.py b/studio/backend/core/inference/diffusion.py
index 29a58a19d1b..729bb65280a 100644
--- a/studio/backend/core/inference/diffusion.py
+++ b/studio/backend/core/inference/diffusion.py
@@ -10742,7 +10742,11 @@ class DiffusionBackend:
# reconciles.
self._make_vae_encode_dtype_safe(pipe)
- swapped, resolved_schedule = build_scheduler(pipe.scheduler, sampler, schedule_type)
+ # getattr like the status poll: a pipeline without a scheduler offers no samplers, so the default
+ # request keeps it as is and any other sampler is refused by build_scheduler.
+ swapped, resolved_schedule = build_scheduler(
+ getattr(pipe, "scheduler", None), sampler, schedule_type
+ )
if swapped is not None:
restore_scheduler = (pipe, pipe.scheduler)
pipe.scheduler = swapped
@@ -11944,7 +11948,6 @@ def _pipeline_components_from_index(
raise ValueError(f"{repo_id}/model_index.json is not an object")
if explicit_components is None:
from .diffusion_component_sizes import manifest_entry_loaded
-
selected = {
str(name) for name, spec in payload.items() if manifest_entry_loaded(name, spec)
}
diff --git a/studio/backend/tests/test_diffusion_autoopt_parity.py b/studio/backend/tests/test_diffusion_autoopt_parity.py
index a4547f8e599..d26fdf34e5e 100644
--- a/studio/backend/tests/test_diffusion_autoopt_parity.py
+++ b/studio/backend/tests/test_diffusion_autoopt_parity.py
@@ -513,6 +513,9 @@ def test_fixture_covers_every_registered_family(captured):
def test_autoopt_resolves_the_same_optimizations_as_before(captured):
+ # The fixture was captured with diffusers installed; without it nothing compiles and the diffusers patches
+ # self-disable, so every case differs. Backend CI has no diffusers.
+ pytest.importorskip("diffusers")
got = snapshot(autoopt_entry)
want = captured["cases"]
assert set(got) == set(want)
@@ -522,6 +525,7 @@ def test_autoopt_resolves_the_same_optimizations_as_before(captured):
def test_legacy_sequence_still_matches_fixture(captured):
"""The fixture is not stale: the old sequence over today's primitives still produces it."""
+ pytest.importorskip("diffusers") # see test_autoopt_resolves_the_same_optimizations_as_before
got = snapshot(legacy_entry)
want = captured["cases"]
diffs = [case for case in want if got.get(case) != want[case]]
diff --git a/studio/backend/tests/test_diffusion_component_sizes.py b/studio/backend/tests/test_diffusion_component_sizes.py
index 8642c23f733..14f6cedd05c 100644
--- a/studio/backend/tests/test_diffusion_component_sizes.py
+++ b/studio/backend/tests/test_diffusion_component_sizes.py
@@ -948,8 +948,6 @@ def test_transformer_2_counts_only_for_moe(tmp_path):
assert dcs.video_header_terms(_fam("wan2.2-t2v-a14b"), sizes)[0] == pytest.approx(4.0)
-
-
def test_pytorch_model_stem_and_its_index_are_recognised(tmp_path):
t = tmp_path / "transformer"
for i in (1, 2):
@@ -1105,8 +1103,6 @@ def test_sub_byte_floats_count_parameters_by_bit_width(tmp_path):
assert dcs.FLOAT_BITS["F4"] == 4 and dcs.FLOAT_BITS["F6_E2M3"] == dcs.FLOAT_BITS["F6_E3M2"] == 6
-
-
def test_unresolved_ref_probes_the_hub_and_falls_back_to_local(tmp_path, monkeypatch):
fam = _fam("wan2.2-ti2v-5b")
snap = tmp_path / ("a" * 40)
@@ -1175,8 +1171,6 @@ def test_same_stem_order_follows_the_loader(tmp_path):
assert sizes.get("transformer").files == ("diffusion_pytorch_model-00001-of-00001.safetensors",)
-
-
def test_hub_skips_folders_the_manifest_does_not_load(monkeypatch):
files = [
"model_index.json",
@@ -1288,8 +1282,6 @@ def test_local_index_read_is_capped(tmp_path, monkeypatch):
assert sizes is None and "diffusion_pytorch_model.safetensors.index.json" not in reads
-
-
def test_snapshot_missing_a_loaded_role_is_incomplete(tmp_path, monkeypatch):
import shutil
@@ -1346,8 +1338,6 @@ def test_index_fetch_is_bounded_by_the_deadline_while_a_peer_trickles():
release.set()
-
-
def test_ltx_bundled_connector_tensors_leave_the_denoiser_term(tmp_path):
fam = _fam("ltx-2.5")
_stub_for_table(tmp_path, fam)
@@ -1439,8 +1429,6 @@ def test_moe_second_expert_is_optional_unless_shipped(tmp_path):
] == pytest.approx(28.6)
-
-
def test_partial_term_keeps_its_known_sum_as_a_lower_bound(tmp_path, monkeypatch):
import shutil
@@ -1574,8 +1562,6 @@ def test_calibration_key_carries_the_revision():
assert a != vsr.calibration_key("ltx-2", "r", "group", "cuda:0", revision = "b" * 40)
-
-
def test_manifest_predicate_matches_the_loader(tmp_path):
import inspect
@@ -1667,8 +1653,6 @@ def test_retagged_peak_is_recorded_under_the_mode_that_ran(monkeypatch):
assert vsr.measured_extra_mib(predicted, 64) is None
-
-
def test_pre_download_plan_threads_the_dev_flag():
import inspect
diff --git a/studio/backend/tests/test_h3_native_memory_fit.py b/studio/backend/tests/test_h3_native_memory_fit.py
index ee50aa38fc7..b60d73d2d6b 100644
--- a/studio/backend/tests/test_h3_native_memory_fit.py
+++ b/studio/backend/tests/test_h3_native_memory_fit.py
@@ -188,7 +188,9 @@ def test_gtt_used_on_another_amd_card_shrinks_the_selected_cards_pool(tmp_path):
_card(tmp_path, "card1", "0000:c5:00.0", total = 24 * GIB, used = 12 * GIB)
assert amdgpu_gtt_free_bytes("0000:03:00", sysfs_root = str(tmp_path)) == 10 * GIB
# Only the selected card at work: the per-device bound still applies.
- (tmp_path / "class" / "drm" / "card1" / "device" / "mem_info_gtt_used").write_text("0\n", encoding = "utf-8")
+ (tmp_path / "class" / "drm" / "card1" / "device" / "mem_info_gtt_used").write_text(
+ "0\n", encoding = "utf-8"
+ )
assert amdgpu_gtt_free_bytes("0000:03:00", sysfs_root = str(tmp_path)) == 22 * GIB
diff --git a/studio/frontend/scripts/check-bundle-budget.ts b/studio/frontend/scripts/check-bundle-budget.ts
index 23159e3a567..6b29382fa25 100644
--- a/studio/frontend/scripts/check-bundle-budget.ts
+++ b/studio/frontend/scripts/check-bundle-budget.ts
@@ -70,8 +70,13 @@ export const BUDGET = {
// /compact and the in-loop compaction divider add 3.6 KB raw / 1.4 KB transfer to the eager startup
// JS (6,563.4 -> 6,567.0 KB raw, 1,973.0 -> 1,974.4 KB transfer against 280c45695, one machine
// and build), raised by that.
- transferBytes: 2_022_600,
- rawBytes: 6_731_800,
+ // Five merges since then add 2.1 KB raw / 0.8 KB transfer (6,567.3 -> 6,569.4 KB raw, 1,974.5 ->
+ // 1,975.3 KB transfer from a062c04d51 to c35052e42f, one machine and build). The step that crossed
+ // is the token activity Chart view (#13558, +0.7 KB raw / +0.3 KB transfer): its persisted store
+ // pulls zustand/middleware into the startup set as a 99th chunk. Raised by that growth so main's
+ // margin stays where it was.
+ transferBytes: 2_023_500,
+ rawBytes: 6_734_000,
};
// The chunk count is reported but not budgeted. Splitting a page out of the entry raises it while lowering the