fix(vace): validate firstlastframe frame count early with actionable error message#686
fix(vace): validate firstlastframe frame count early with actionable error message#686livepeer-tessa wants to merge 1 commit intomainfrom
Conversation
…error When firstlastframe mode is used with num_frame_per_block=1 the existing check deep inside _build_overlay_context fired on every processed chunk, flooding logs with hundreds of identical errors in a single session. Add an early validation in _encode_extension_mode (before any expensive work) that raises a clear ValueError immediately with: - the exact frame count required vs what was configured - the specific config knob to fix (num_frame_per_block >= 2) - an alternative suggestion (use firstframe/lastframe mode) This means the pipeline still fails (correct behaviour — the config is invalid), but it fails once per chunk with a message the user can act on rather than producing a log storm from the same repeated assertion. Observed in prod: ~700 identical ERROR log lines in 22 s from a single fal.ai job (89097129-4a48-4508-b53f-ac8de2f75ea0) on streamdiffusionv2. Fixes #685
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.Add a .trivyignore file to your project to customize which findings Trivy reports. |
🚀 fal.ai Preview Deployment
TestingConnect to this preview deployment by running this on your branch: 🧪 E2E tests will run automatically against this deployment. |
✅ E2E Tests passed
Test ArtifactsCheck the workflow run for screenshots. |
Problem
When a user runs
streamdiffusionv2(or any VACE pipeline) withfirstlastframemode andnum_frame_per_block=1,VaceEncodingBlockraises aValueErroron every single processed chunk, flooding logs with hundreds of identical errors. Observed in prod on 2026-03-14 03:29 UTC — ~700 ERROR lines in 22 seconds from a single job.Root cause: the frame-count check lived deep in
_build_overlay_context, which is called per-chunk. No early exit, no actionable message.Closes #685
Fix
Add a single guard at the top of
_encode_extension_mode— before loading images or touching the GPU — that:ValueErrorwith an actionable message telling the user exactly what to change (num_frame_per_block >= 2)The pipeline still fails (correct — the config is genuinely invalid), but it now fails once per chunk with a clear message rather than producing a silent log storm.
Changes
src/scope/core/pipelines/wan2_1/vace/blocks/vace_encoding.py: 15-line guard added before_build_extension_frames_and_masksTesting
Existing behaviour verified via code review — the downstream assertion in
_build_overlay_contextis now unreachable for this case (the guard fires first). No runtime changes for valid configs (num_frame_per_block >= 2).Related