feat: real-time denoising step progress during video generation#100
Open
Sergio Gil Jiménez (jimeneztion) wants to merge 2 commits intoLightricks:mainfrom
Open
Conversation
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
Previously the progress bar used time-based interpolation — it estimated how
long inference would take and animated accordingly. Progress was a guess and
could be wildly off.
This PR wires actual denoising step counts from the model to the frontend so
the bar reflects real work done.
Backend: tqdm interceptor (
ltx_fast_video_pipeline.py)The denoising loop in
ltx_pipelinesusestqdminternally with no callbackhook. We patch
tqdminltx_pipelines.utils.samplersat call time using acontext manager (
_tqdm_progress_interceptor) that wraps each iteration andfires a
StepCallback(current_step, total_steps). The patch is scoped to thegenerate call and restores the original
tqdmin afinallyblock.The distilled fast pipeline runs 11 total denoising steps (8 stage 1 + 3 stage 2),
exposed as constants.
Backend: progress reporting (
video_generation_handler.py)A
_on_denoising_stepcallback maps each step to a progress percentage:15 + 75 * (step / total), covering inference from 15% to 90%. It callsupdate_progress("inference", pct, current_step, total_steps)so the frontendreceives both the percentage and the raw step counts.
Frontend (
frontend/hooks/use-generation.ts)currentStep/totalStepsfrom the backend SSE stream"Generating... (5/11)"during inferencestatus === 'idle'"Loading model..."How to test
pnpm dev"Generating... (1/11)"→"Generating... (11/11)"as denoising steps complete — not a smooth timer animation
pnpm typecheck && pnpm backend:test