sgl-project/sglang · error · ValueError

SANA-WM is a TI2V world model and requires condition_image f

Error message

SANA-WM is a TI2V world model and requires condition_image for first-frame conditioning. Provide --image-path, --condition-image, or the equivalent API image input.

What it means

SANA-WM is a text-image-to-video (TI2V) world model: it cannot generate from pure noise and requires a condition_image for first-frame conditioning. Omitting it raises this ValueError immediately.

Source

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

        log_sana_wm_tensor_stats("latents.initial_noise", latents)

        batch.raw_latent_shape = latent_shape

        condition_image = getattr(batch, "condition_image", None)
        if condition_image is not None:
            try:
                latents = self._splice_first_frame(
                    latents, condition_image, dtype, device, batch=batch
                )
                self.log_info("First-frame spliced into noise latents.")
            except Exception as e:
                raise RuntimeError(
                    "SANA-WM first-frame conditioning failed; refusing to "
                    "continue with pure-noise latents because that produces "
                    "misleading low-quality output."
                ) from e
        else:
            raise ValueError(
                "SANA-WM is a TI2V world model and requires condition_image "
                "for first-frame conditioning. Provide --image-path, "
                "--condition-image, or the equivalent API image input."
            )

        batch.latents = latents

        # The released SANA-WM checkpoint is camera-conditioned. Official
        # inference requires a camera trajectory or action DSL. If the SGLang
        # request omits one, use a static identity trajectory so the UCPE path
        # remains active instead of silently dropping all camera conditioning.
        try:
            camera_conditions, chunk_plucker, camera_source = (
                self._build_camera_conditioning(
                    batch,
                    batch_size=batch_size,
                    num_frames=num_frames,
                    latent_shape=latent_shape,

View on GitHub (pinned to 0132848349)

Solutions

  1. Provide a first-frame image via --image-path or --condition-image (CLI) or the image field in the API request.
  2. If you wanted pure text-to-video, switch to a T2V model checkpoint instead of SANA-WM.
  3. Verify the image is loaded and actually reaches the stage (not dropped by an upstream stage).

Example fix

# before
python -m sglang.launch_server --model sana-wm ...  # prompt-only request
# after
curl ... -F image=@first_frame.png -d 'text=...'
Defensive patterns

Strategy: validation

Validate before calling

if condition_image is None:
    raise ValueError('SANA-WM requires a first-frame image; attach image to the request')

Type guard

def request_has_condition_image(req) -> bool:
    return req.get('image') is not None or req.get('condition_image') is not None

Prevention

When it happens

Trigger: Calling forward without condition_image / --image-path / --condition-image — i.e. trying to run image-free text-to-video.

Common situations: Reusing a T2V server config or prompt-only CLI invocation against the SANA-WM model; omitting the image field in API requests.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


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