Skip to content

Fix vace_context_scale not sent in initial params without ref images#630

Merged
ryanontheinside merged 2 commits intomainfrom
fix/vace-context-scale-initial-params
Mar 9, 2026
Merged

Fix vace_context_scale not sent in initial params without ref images#630
ryanontheinside merged 2 commits intomainfrom
fix/vace-context-scale-initial-params

Conversation

@ryanontheinside
Copy link
Copy Markdown
Collaborator

@ryanontheinside ryanontheinside commented Mar 9, 2026

Summary

  • vace_context_scale was only included in initial stream parameters and load params when reference images were present, because it was gated inside getVaceParams() which returns {} without ref images
  • When using VACE with input video (no ref images), the scale was never sent at stream start, so the backend always defaulted to 1.0 regardless of the UI slider value
  • Decoupled vace_context_scale from the ref-images check in both the frontend (initial params + load params) and backend (_configure_vace) so it is always sent when the pipeline supports VACE

Test plan

  • Set VACE context scale to a non-default value (e.g. 0.5) in the UI
  • Start a stream with VACE enabled using input video (no ref images) and verify the scale takes effect immediately
  • Start a stream with VACE enabled using ref images and verify the scale still works as before
  • Verify changing the slider mid-stream still sends updates correctly

Summary by CodeRabbit

  • Bug Fixes
    • Ensure VACE context scale is always applied for pipelines that support VACE (defaults to 1.0) across all input modes, improving consistency and stability.
  • Tests
    • Added focused tests validating VACE configuration propagation, defaulting behavior, and handling of reference images and checkpoints.

vace_context_scale was only included in initial stream parameters and
load params when reference images were present, because it was gated
inside getVaceParams() which returns {} without ref images. When using
VACE with input video (no ref images), the scale was never sent at
stream start, so the backend always defaulted to 1.0 regardless of
the UI slider value.

Decouple vace_context_scale from the ref-images check so it is always
sent when the pipeline supports VACE.

Signed-off-by: RyanOnTheInside <[email protected]>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 9, 2026

📝 Walkthrough

Walkthrough

Always send VACE context scale when a pipeline supports VACE (defaulting to 1.0) across frontend and backend; backend loading/configuration and tests updated to extract/apply vace_context_scale from load_params, while vace_ref_images remain optional.

Changes

Cohort / File(s) Summary
Frontend VACE Parameter Handling
frontend/src/pages/StreamPage.tsx
Always include vace_context_scale in loadParams and initialParameters when VACE is supported, using settings.vaceContextScale ?? 1.0; vace_ref_images still included only if provided.
Backend VACE Configuration
src/scope/server/pipeline_manager.py
Refactored _configure_vace and _load_pipeline_implementation branches to extract/apply vace_context_scale from load_params (default 1.0) for both ref-image and input-video VACE modes; ref_images still applied only when present.
Tests for VACE behavior
tests/test_pipeline_manager_vace.py
Added tests verifying vace_context_scale defaults and propagation, ref_images handling, correct vace_path selection, and Krea pipeline config behavior; mocks heavy dependencies to isolate config logic.
Manifest metadata
package.json
Minor manifest change (lines changed: +4/-1).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nudged the context scale to roam,
Always sent, never left at home.
Ref-images hop in when they may,
But scale stays bright along the way. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main fix: vace_context_scale not being sent in initial parameters without reference images. This aligns perfectly with the core change across both frontend and backend.
Docstring Coverage ✅ Passed Docstring coverage is 82.35% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/vace-context-scale-initial-params

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/scope/server/pipeline_manager.py`:
- Around line 569-571: The Krea branch still builds VACE config inline instead
of using the shared _configure_vace(), so it never gets vace_context_scale;
modify the branch that handles the "krea-realtime-video" pipeline to call
_configure_vace(config, load_params, ...) (same helper used elsewhere) rather
than inlining VACE setup, and after that call set config["vace_path"] to the 14B
checkpoint identifier (override the helper’s default for this branch) so the
Krea pipeline uses the new VACE scale path with the 14B model.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2fce2b1a-c9ee-4795-ac08-6638db61b7c6

📥 Commits

Reviewing files that changed from the base of the PR and between abed05e and 7998b48.

📒 Files selected for processing (2)
  • frontend/src/pages/StreamPage.tsx
  • src/scope/server/pipeline_manager.py

Comment on lines +569 to +571
# Always apply vace_context_scale when provided (applies to both
# ref-image and input-video VACE modes)
config["vace_context_scale"] = load_params.get("vace_context_scale", 1.0)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Krea still bypasses the new VACE scale path.

_configure_vace() now propagates vace_context_scale, but krea-realtime-video still configures VACE inline on Lines 929-938 and never copies that field into config. That leaves one VACE-capable built-in pipeline on the old behavior. Please route the Krea branch through this helper, then override vace_path to the 14B checkpoint there.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/scope/server/pipeline_manager.py` around lines 569 - 571, The Krea branch
still builds VACE config inline instead of using the shared _configure_vace(),
so it never gets vace_context_scale; modify the branch that handles the
"krea-realtime-video" pipeline to call _configure_vace(config, load_params, ...)
(same helper used elsewhere) rather than inlining VACE setup, and after that
call set config["vace_path"] to the 14B checkpoint identifier (override the
helper’s default for this branch) so the Krea pipeline uses the new VACE scale
path with the 14B model.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

🚀 fal.ai Preview Deployment

App ID daydream/scope-pr-630--preview
WebSocket wss://fal.run/daydream/scope-pr-630--preview/ws
Commit 7b72a27

Testing

Connect to this preview deployment by running this on your branch:

uv run build && SCOPE_CLOUD_APP_ID="daydream/scope-pr-630--preview/ws" uv run daydream-scope

🧪 E2E tests will run automatically against this deployment.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

✅ E2E Tests passed

Status passed
fal App daydream/scope-pr-630--preview
Run View logs

Test Artifacts

Check the workflow run for screenshots.

Copy link
Copy Markdown
Collaborator

@leszko leszko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the comment from rabbitcode. Other than that LGTM

The Krea branch in _load_pipeline_implementation inlined its VACE setup
to use the 14B checkpoint instead of the default 1.3B, but this skipped
the vace_context_scale and ref_images extraction that _configure_vace
provides. Add the missing parameter extraction and tests.

Signed-off-by: RyanOnTheInside <[email protected]>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/test_pipeline_manager_vace.py (1)

147-151: Consider adding a test for load_params=None in the Krea branch.

The current tests cover vace_enabled=False but not the case where load_params itself is None. Based on the Krea implementation, when load_params=None:

  • vace_path is set (14B checkpoint)
  • vace_context_scale is not set (the inner if load_params: block is skipped)

This differs from passing {} where vace_context_scale defaults to 1.0. If this behavior is intentional, a test documenting it would be valuable.

📝 Optional: Add test for load_params=None
def test_no_load_params(self):
    """Krea branch with load_params=None should set vace_path but not vace_context_scale."""
    config = self._load_krea_config(None)
    assert "14B" in config["vace_path"]
    assert "vace_context_scale" not in config
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/test_pipeline_manager_vace.py` around lines 147 - 151, Add a new unit
test in tests/test_pipeline_manager_vace.py to cover the Krea branch when
load_params is None: create a method (e.g., test_no_load_params) that calls the
existing helper _load_krea_config(None), asserts that the returned config
contains a vace_path (check that "14B" appears in config["vace_path"]) and
asserts that "vace_context_scale" is not present in the config; this mirrors the
behavior different from passing an empty dict and documents the intended
behavior alongside test_vace_disabled.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tests/test_pipeline_manager_vace.py`:
- Around line 147-151: Add a new unit test in
tests/test_pipeline_manager_vace.py to cover the Krea branch when load_params is
None: create a method (e.g., test_no_load_params) that calls the existing helper
_load_krea_config(None), asserts that the returned config contains a vace_path
(check that "14B" appears in config["vace_path"]) and asserts that
"vace_context_scale" is not present in the config; this mirrors the behavior
different from passing an empty dict and documents the intended behavior
alongside test_vace_disabled.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1878d84a-527d-4247-bb68-c18ef208b7a6

📥 Commits

Reviewing files that changed from the base of the PR and between 7998b48 and 7b72a27.

📒 Files selected for processing (2)
  • src/scope/server/pipeline_manager.py
  • tests/test_pipeline_manager_vace.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/scope/server/pipeline_manager.py

@ryanontheinside ryanontheinside merged commit 7f6a8df into main Mar 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants