fix(vace): auto-convert 3-channel RGB depth masks to single-channel grayscale (#908)#909
Open
livepeer-tessa wants to merge 2 commits intomainfrom
Open
fix(vace): auto-convert 3-channel RGB depth masks to single-channel grayscale (#908)#909livepeer-tessa wants to merge 2 commits intomainfrom
livepeer-tessa wants to merge 2 commits intomainfrom
Conversation
added 2 commits
April 10, 2026 06:20
…ds-compat (#895) Old Scope clients send edge definitions using the deprecated 'source'/'target' key names instead of the current 'from'/'from_port'/ 'to_node'/'to_port' fields. This caused a pydantic ValidationError in scope.server.frame_processor, resulting in sessions starting but processing 0 frames (silent failure for users). Error was observed 4x in a 12 h window. Changes: - Add a model_validator(mode='before') on GraphEdge that detects legacy 'source'/'target' keys and transparently maps them to the current schema. - When port fields are absent, default from_port to 'video' and to_port to 'video' (matching the existing convention for simple linear graphs). - Log a WARNING with the raw edge data whenever legacy keys are coerced so operators can identify outdated clients in logs. - Add tests/test_graph_schema.py covering legacy-only, mixed, and current-only edge formats plus the deprecation warning emission. Fixes #895 Signed-off-by: Tessa (livepeer-tessa) <tessa@livepeer.org>
When video-depth-anything output is wired to longlive's vace_input_frames port the depth map arrives as a [B, 3, F, H, W] tensor (depth value replicated across RGB channels) instead of the expected [B, 1, F, H, W] single-channel mask. This caused a hard ValueError that fired on every chunk (~160+ times per session), silently breaking the entire pipeline. Fix: detect the 3-channel case in _encode_with_conditioning and automatically collapse it to single-channel via channel-average (mean(dim=1, keepdim=True)) before the rest of the validation runs. A logger.warning is emitted so operators can see the conversion happened and optionally fix the graph to wire a true grayscale source instead. All other unexpected channel counts still raise a clear ValueError. Fixes #908 Signed-off-by: Tessa (livepeer-tessa) <tessa@livepeer.org>
|
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)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
🚀 fal.ai Preview Deployment
Livepeer Runner
Testing Livepeer Mode |
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
When a user wires
video-depth-anything → longlivewith VACE enabled, the depth map arrives atVaceEncodingBlock._encode_with_conditioningas a[B, 3, F, H, W]tensor (depth value replicated across RGB). VACE expects[B, 1, F, H, W], so a hardValueErrorfires on every chunk — ~160+ times in a single session — silently killing all output while the pipeline keeps running.Reported in: #908
Fix
In
_encode_with_conditioning, detect the 3-channel case before the existing channel-count assertion and collapse it to single-channel via channel-average (mean(dim=1, keepdim=True)):A
logger.warningis emitted so operators can see the auto-conversion and optionally wire a true grayscale source. All other unexpected channel counts still raise a clearValueError.Testing
input → video-depth-anything → longlive (vace_input_frames) → rife → outputwithvace_enabled=TrueValueErrorin Loki for the triggering graphRelated