Skip to content

Fix Helios V2V latent prep crash and LTX long scheduler desync on skipped steps - #29

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-management-6700
Draft

Fix Helios V2V latent prep crash and LTX long scheduler desync on skipped steps#29
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-management-6700

Conversation

@cursor

@cursor cursor Bot commented Jul 2, 2026

Copy link
Copy Markdown

Summary

Fixes two critical correctness bugs in video pipelines.

Helios V2V (pipeline_helios.py, pipeline_helios_pyramid.py)

Bug: prepare_video_latents() returned an undefined first_frame_latent when callers passed pre-encoded video_latents alongside video, causing a deterministic NameError. The V2V noise path also crashed with AttributeError when only video_latents was supplied (no image_latents).

Fix: Always encode the first video frame for first_frame_latent. When adding V2V noise without a separate image_latents tensor, derive it from the first latent frame of video_latents.

Trigger: HeliosPipeline(video=..., video_latents=precomputed) or HeliosPipeline(video_latents=..., add_noise_to_video_latents=True) without image_latents.

LTX long multi-prompt (pipeline_ltx_i2v_long_multi_prompt.py)

Bug: When skip_steps_sigma_threshold skips denoising steps, FlowMatchEulerDiscreteScheduler.step_index tracked executed step() calls rather than the current loop timestep. After a skipped step, the next step() used the wrong sigma pair (especially with non-unity scheduler shift), corrupting long-video output.

Fix: Reset scheduler._step_index before each scheduler.step() call so sigma selection matches the current timestep.

Trigger: LTX I2V long pipeline with skip_steps_sigma_threshold low enough to skip non-leading steps (common with shifted FlowMatch schedulers).

Tests

  • test_prepare_video_latents_with_precomputed_latents in tests/pipelines/helios/test_helios.py
  • test_step_index_resync_after_skipped_steps in tests/pipelines/ltx/test_ltx_i2v_long_scheduler.py

Validated locally:

python3 -m pytest tests/pipelines/ltx/test_ltx_i2v_long_scheduler.py tests/pipelines/helios/test_helios.py::HeliosPipelineFastTests::test_prepare_video_latents_with_precomputed_latents
Open in Web View Automation 

cursoragent and others added 2 commits July 2, 2026 22:09
…pped steps

Helios prepare_video_latents returned an undefined first_frame_latent when
pre-encoded video_latents were supplied alongside video. Always encode the
first frame from the input video, and derive image_latents from video_latents
when adding V2V noise without a separate image_latents tensor.

LTX long multi-prompt denoising can skip scheduler steps via
skip_steps_sigma_threshold. Reset FlowMatchEulerDiscreteScheduler step_index
before each step so sigma selection matches the current loop timestep after
earlier skips.

Co-authored-by: Simon Lynch <srlynch1@users.noreply.github.com>
Use shift=3.0 and non-zero model output so step-index resync is
exercised meaningfully. Remove assertFalse that passed coincidentally
at shift=1.0 with zero model output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant