fix(txt2vid): callback kwargs are nested into get_timesteps_arr instead of make_clip_frames - #1843
Open
Anai-Guo wants to merge 1 commit into
Open
Conversation
…ip_frames callback= and callback_steps= are indented into the get_timesteps_arr(...) sub-expression that computes T, but get_timesteps_arr accepts neither, so any audio-driven walk raises TypeError. They belong to the enclosing make_clip_frames(...) call, which does declare both -- and which currently never receives them, so the progress callback silently never fires even when no audio file is given and the ternary short-circuits the crash. Signed-off-by: Tai An <antai12232931@outlook.com>
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.
Problem
In
StableDiffusionWalkPipeline.walk,callback=andcallback_steps=are indented one level too deep — they land inside theget_timesteps_arr(...)sub-expression that computesT, instead of staying on the enclosingself.make_clip_frames(...)call:get_timesteps_arraccepts neither:while
make_clip_framesdeclares both (callback=None,callback_steps: int = 1).This breaks the progress callback on both paths:
audio_filepathset → theget_timesteps_arr(...)call is evaluated and raisesTypeError: get_timesteps_arr() got an unexpected keyword argument 'callback'. Every audio-drivenwalk()dies before the first frame.audio_filepath→ the ternary short-circuits, so nothing raises, butmake_clip_framesis called withoutcallback/callback_steps. They fall back toNone/1and the caller's progress callback silently never fires.The same block is duplicated verbatim in the streamlit copy, so both are fixed here.
scripts/txt2vid.py:964webui/streamlit/scripts/txt2vid.py:959Fix
Dedent the two kwargs by one level so they close on
make_clip_frames(...)instead ofget_timesteps_arr(...). No other change — 2 lines per file.Verification
No Stable-Diffusion runtime on this box, so I checked it structurally: parse the live file with
ast, build stubs carrying the real signatures ofget_timesteps_arrandmake_clip_frames, and replay every call site throughinspect.Signature.bind, before and after the patch.Both halves of the bug show up and both clear: the
TypeErrorgoes away, andcallback forwardedflipsFalse→True, which is the silent half that the crash was masking.🤖 Generated with Claude Code