sgl-project/sglang · error · ValueError

SANA-WM action and camera_to_world/camera_path are mutually

Error message

SANA-WM action and camera_to_world/camera_path are mutually exclusive.

What it means

SANA-WM supports two camera-control modes: action conditioning (learned action vectors) or explicit camera_to_world/camera_path. Supplying both is ambiguous and rejected.

Source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/sana_wm/base.py:1937

                    )
        else:
            camera_to_world = extra.get("camera_to_world", None)
            intrinsics = extra.get("intrinsics", None)
            if camera_to_world is None:
                camera_to_world = self._first_mapping_value(
                    diffusers_kwargs,
                    "camera_to_world",
                    "camera_to_world_path",
                    "camera_path",
                )
            if intrinsics is None:
                intrinsics = self._first_mapping_value(
                    diffusers_kwargs,
                    "intrinsics",
                    "intrinsics_path",
                )
            if action is not None and camera_to_world is not None:
                raise ValueError(
                    "SANA-WM action and camera_to_world/camera_path are "
                    "mutually exclusive."
                )

            if action is not None:
                source = (
                    "action" if intrinsics is not None else "action_default_intrinsics"
                )
                translation_speed = self._request_float_value(
                    extra,
                    diffusers_kwargs,
                    "translation_speed",
                    "action_translation_speed",
                    "sana_wm_translation_speed",
                    default=_SANA_WM_DEFAULT_TRANSLATION_SPEED,
                )
                rotation_speed_deg = self._request_float_value(
                    extra,

View on GitHub (pinned to 0132848349)

Solutions

  1. Remove camera_to_world/camera_path from diffusers_kwargs when using action conditioning.
  2. Or drop the action tensor and keep only the explicit camera path.
  3. Audit config merging so a default camera path doesn't leak into action-mode requests.

Example fix

# before
stage.forward(..., diffusers_kwargs={'action': act, 'camera_to_world': c2w})
# after
stage.forward(..., diffusers_kwargs={'action': act})
Defensive patterns

Strategy: type-guard

Validate before calling

assert not (action is not None and (camera_to_world is not None or kwargs.get('camera_path') is not None))

Type guard

def control_mode_is_exclusive(action, camera_to_world, camera_path) -> bool:
    return sum(x is not None for x in (action, camera_to_world, camera_path)) <= 1

Prevention

When it happens

Trigger: Calling forward with both action is not None and camera_to_world (or camera_path via kwargs) set — e.g. an agent-style action array plus an explicit camera trajectory.

Common situations: Pipelines that default camera_to_world and then also forward user-supplied action; merging configs from examples that each use a different control mode.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/4ff61a69ecb02843. Report an issue: GitHub.