From 88cc1e3256f5ed4167c12bbb7c3a696de20647ea Mon Sep 17 00:00:00 2001 From: digital-garbage <133010426+digital-garbage@users.noreply.github.com> Date: Tue, 26 May 2026 02:05:10 +0300 Subject: [PATCH] Fix yellow cast at consecutive transitions and maps stacking Transition center was placed at cumulative_latent_frames - overlap//2, inside scene 1's territory. Since overlap frames are pinned (mask=0) the latent blend is a no-op, so the actual content seam is at cumulative_latent_frames exactly. Centering there puts the seam at peak black, hiding any decode artifacts and giving a clean post-processed fade-to-black feel on each side. Maps stacking: _capture_finalizer merged new captures with the existing temp file, including leftovers from previous ComfyUI runs. Each "loved it" cycle blessed maps that had been tainted by the previous round's injection, compounding color bias indefinitely. Clear the temp file at build_enhancements start so each generation captures clean. Co-Authored-By: Claude Sonnet 4.6 --- ltx_enhancements.py | 12 ++++++++++++ samplers.py | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ltx_enhancements.py b/ltx_enhancements.py index 9adcab83..b7ad7770 100644 --- a/ltx_enhancements.py +++ b/ltx_enhancements.py @@ -566,6 +566,18 @@ def build_enhancements(model, rating_profile, temporal_style, refinement_key, re } # --- Technique 5: injection data --- + # Clear the temp maps file so this generation's capture starts fresh. + # Without this, maps from previous runs merge in and compound across + # sessions — each "loved it" cycle injects tainted states from the + # previous round, producing progressively worse color bias. + if refinement_key: + temp_path = _temp_maps_path(refinement_key) + try: + if os.path.exists(temp_path): + os.remove(temp_path) + except Exception: + pass + has_i2v = reference_latent is not None and _has_i2v_reference(reference_latent) if has_i2v: # i2v latent: extract reference maps on first generation step (real conditioning available). diff --git a/samplers.py b/samplers.py index d52ce8c5..59ffe4c4 100644 --- a/samplers.py +++ b/samplers.py @@ -1467,7 +1467,10 @@ class FunPackLTXAVSceneChainSampler: # Record boundary (center of the overlap region) before blending effect = self._scene_transition_effect(scene_cond) if effect and transition_duration > 0: - boundary_latent = max(0, cumulative_latent_frames - video_overlap // 2) + # Seam is at cumulative_latent_frames: overlap frames are pinned + # (mask=0) so the latent blend is a no-op — the actual content + # boundary is exactly here, not offset by overlap//2. + boundary_latent = cumulative_latent_frames boundary_pixel = int((boundary_latent - 1) * time_scale + 1) if time_scale > 1 else boundary_latent blend_half_latent = max(1, video_overlap // 2) blend_half_pixels = blend_half_latent * time_scale