diff --git a/movie_editor/frontend/engine_settings.js b/movie_editor/frontend/engine_settings.js index d6ae69bc..470dd944 100644 --- a/movie_editor/frontend/engine_settings.js +++ b/movie_editor/frontend/engine_settings.js @@ -208,7 +208,7 @@ { name: "debug_log", label: "Debug log", kind: "bool", default: false, dependsOn: "identity_transfer_enabled", hint: "Print per-scene identity-transfer shape/status logs to the ComfyUI console." }, { name: "plateau_cache", label: "Plateau step-cache (speed)", kind: "bool", default: false, - hint: "EXPERIMENTAL speed: the near-pure-noise early steps carry almost no signal, so the transformer output barely changes across them. Computes it once at the top of the plateau and reuses it for the rest, skipping ~3-4 of 8 transformer passes. Deterministic given seed (safe in Batch Training) but an approximation — A/B it before trusting on finals. Much of wall-clock time is outside the sampler, so total speedup is smaller than the forward count suggests. UNVALIDATED LIVE." }, + hint: "Ignored while Context windows is on — the cache can't tell one window from another within a step, so it's skipped with a note in the scene report. EXPERIMENTAL speed: the near-pure-noise early steps carry almost no signal, so the transformer output barely changes across them. Computes it once at the top of the plateau and reuses it for the rest, skipping ~3-4 of 8 transformer passes. Deterministic given seed (safe in Batch Training) but an approximation — A/B it before trusting on finals. Much of wall-clock time is outside the sampler, so total speedup is smaller than the forward count suggests. UNVALIDATED LIVE." }, { name: "plateau_cache_threshold", label: "Plateau threshold (sigma)", kind: "float", default: 0.975, min: 0.5, max: 0.999, step: 0.005, dependsOn: "plateau_cache", hint: "Steps with sigma at or above this count as the reusable plateau. Higher = fewer steps cached (safer); lower = more cached (faster, more approximation). 0.975 catches the documented noise plateau while leaving structure formation fully computed." }, { name: "segmented_detailing", label: "Segmented detailing (region refine)", kind: "bool", default: false, diff --git a/samplers.py b/samplers.py index 351a1c91..07dd81b1 100644 --- a/samplers.py +++ b/samplers.py @@ -2440,7 +2440,7 @@ class FunPackLTXAVSceneChainSampler: }), "plateau_cache": ("BOOLEAN", { "default": False, - "tooltip": "EXPERIMENTAL speed (MixCache/Chorus-family step-caching, adapted to LTX2.3's distilled schedule): the near-pure-noise plateau steps (sigma above plateau_cache_threshold) carry almost no signal, so the model's output barely changes across them. This computes the full transformer forward once at the top of the plateau, then REUSES that output for the remaining plateau steps instead of recomputing — skipping those transformer passes entirely. On the default 8-step schedule (sigmas 1.0→0.975 are the plateau) that's ~3-4 of 8 forwards skipped. DETERMINISTIC given seed (no diversity/rating impact, safe in Batch Training) but an APPROXIMATION — validate A/B before trusting on final renders. Note: much of wall-clock time is outside the sampler (encode/decode), so sampler speedup ≠ total speedup. Off by default. UNVALIDATED LIVE.", + "tooltip": "EXPERIMENTAL speed (MixCache/Chorus-family step-caching, adapted to LTX2.3's distilled schedule). IGNORED while context_windows is on (the cache can't tell one window from another within a step) — the scene report says so. Mechanism: the near-pure-noise plateau steps (sigma above plateau_cache_threshold) carry almost no signal, so the model's output barely changes across them. This computes the full transformer forward once at the top of the plateau, then REUSES that output for the remaining plateau steps instead of recomputing — skipping those transformer passes entirely. On the default 8-step schedule (sigmas 1.0→0.975 are the plateau) that's ~3-4 of 8 forwards skipped. DETERMINISTIC given seed (no diversity/rating impact, safe in Batch Training) but an APPROXIMATION — validate A/B before trusting on final renders. Note: much of wall-clock time is outside the sampler (encode/decode), so sampler speedup ≠ total speedup. Off by default. UNVALIDATED LIVE.", }), "plateau_cache_threshold": ("FLOAT", { "default": 0.975, "min": 0.5, "max": 0.999, "step": 0.005, @@ -5168,7 +5168,18 @@ class FunPackLTXAVSceneChainSampler: # Innermost wrapper (installed first): caches the raw base-model forward on the # near-noise plateau so later plateau steps reuse it. All guidance wrappers below # layer around it and still post-process each step's (cached-or-fresh) prediction. - if plateau_cache: + # + # MUTUALLY EXCLUSIVE with context windows: the cache is keyed by + # (input.shape, cond_or_uncond), and every window within one step calls the model + # with the SAME shape. Windows 2..N would therefore be handed window 1's cached + # prediction on every plateau step — one window's content bleeding across the whole + # clip. Context windows wins (it's a capability, the cache is a speed experiment); + # say so in the report rather than silently dropping one of two ticked boxes. + if plateau_cache and _ctx_remove is not None: + run_mechanisms.append( + "plateau_cache(SKIPPED: incompatible with context_windows — the per-step " + "cache cannot tell two windows apart)") + elif plateau_cache: _plateau_stats = self._build_plateau_cache_wrapper(model, plateau_cache_threshold) # Loop temporal style (auto director's funpack_temporal_loop): Mobius latent # roll. Installed BELOW the guidance wrappers (embed guidance / slider /