Merge branch 'video-wan' into video-hunyuan-gate

This commit is contained in:
Daniel Han 2026-07-05 06:36:29 +00:00
commit 5d5160f9d1
2 changed files with 23 additions and 4 deletions

View file

@ -1074,10 +1074,10 @@ class VideoBackend:
vae_tiling = vae_tiling,
memory_mode = plan.requested_mode,
speed_mode = effective_speed,
# Only the optimisations that actually engaged: apply_speed_optims
# returns every flag with True/False, and iterating the dict raw
# would report disabled ones as active in /video/status.
speed_optims = tuple(k for k, v in (speed_optims or {}).items() if v),
# Already filtered above to only the optimisations that engaged;
# apply_speed_optims returns every flag True/False and the view
# loop keeps just the True names.
speed_optims = speed_optims,
backend_flags = backend_flags,
attention_backend = attention_engaged,
transformer_cache = cache_engaged,

View file

@ -486,6 +486,25 @@ def test_load_generate_unload_gguf(fake_runtime, tmp_path):
assert status["loaded"] is False
def test_load_records_engaged_speed_optims(fake_runtime, tmp_path, monkeypatch):
# Regression: the load tail once re-ran the already-filtered speed_optims
# tuple through ``.items()`` as if it were still the raw applied dict, so
# every real-GPU load (where at least channels_last engages) crashed with
# 'tuple' object has no attribute 'items'. Fake runtime forces every optim
# False, so this only reproduces when one is made to engage.
from core.inference import video as video_mod
monkeypatch.setattr(
video_mod,
"apply_speed_optims",
lambda *a, **k: {"channels_last": True, "cudnn_benchmark": False},
)
backend = VideoBackend()
status = _load_gguf(backend, tmp_path)
assert status["loaded"] is True
assert status["speed_optims"] == ["channels_last"]
def test_generate_defaults_from_variant(fake_runtime, tmp_path):
# A distilled GGUF pick defaults to the few-step no-CFG schedule.
(tmp_path / "ltx-2.3-22b-distilled-1.1-Q4_K_M.gguf").write_bytes(b"w")