Fix Helios V2V latent prep crash and LTX long scheduler desync on skipped steps - #29
Draft
cursor[bot] wants to merge 2 commits into
Draft
Fix Helios V2V latent prep crash and LTX long scheduler desync on skipped steps#29cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two critical correctness bugs in video pipelines.
Helios V2V (
pipeline_helios.py,pipeline_helios_pyramid.py)Bug:
prepare_video_latents()returned an undefinedfirst_frame_latentwhen callers passed pre-encodedvideo_latentsalongsidevideo, causing a deterministicNameError. The V2V noise path also crashed withAttributeErrorwhen onlyvideo_latentswas supplied (noimage_latents).Fix: Always encode the first video frame for
first_frame_latent. When adding V2V noise without a separateimage_latentstensor, derive it from the first latent frame ofvideo_latents.Trigger:
HeliosPipeline(video=..., video_latents=precomputed)orHeliosPipeline(video_latents=..., add_noise_to_video_latents=True)withoutimage_latents.LTX long multi-prompt (
pipeline_ltx_i2v_long_multi_prompt.py)Bug: When
skip_steps_sigma_thresholdskips denoising steps,FlowMatchEulerDiscreteScheduler.step_indextracked executedstep()calls rather than the current loop timestep. After a skipped step, the nextstep()used the wrong sigma pair (especially with non-unity scheduler shift), corrupting long-video output.Fix: Reset
scheduler._step_indexbefore eachscheduler.step()call so sigma selection matches the current timestep.Trigger: LTX I2V long pipeline with
skip_steps_sigma_thresholdlow enough to skip non-leading steps (common with shifted FlowMatch schedulers).Tests
test_prepare_video_latents_with_precomputed_latentsintests/pipelines/helios/test_helios.pytest_step_index_resync_after_skipped_stepsintests/pipelines/ltx/test_ltx_i2v_long_scheduler.pyValidated locally: