ATH-MaaS/Pixelle-Video · error · ValueError

DashScope legacy video models require image_path.

Error message

DashScope legacy video models require image_path.

What it means

Older DashScope video models (wan2.1, wan2.6, etc.) submit via img_url and require an input image. If image_path is falsy when the legacy branch is taken, this ValueError is raised instead of sending a request that would fail server-side.

Source

Thrown at pixelle_video/services/api_services/video_dashscope.py:330

            if negative_prompt:
                call_kwargs["negative_prompt"] = negative_prompt
            if resolution:
                call_kwargs["resolution"] = resolution
            if video_ratio:
                call_kwargs["ratio"] = video_ratio
            if prompt_extend is not None:
                call_kwargs["prompt_extend"] = prompt_extend
            if seed is not None:
                call_kwargs["seed"] = seed

            rsp = self._with_network_retry(
                "submit task",
                lambda: VideoSynthesis.call(**call_kwargs),
            )
        else:
            # Older models (wan2.1, wan2.6 etc.) use 'img_url' and 'shot_type'
            if not image_path:
                raise ValueError("DashScope legacy video models require image_path.")

            call_kwargs = {
                "api_key": self.api_key,
                "model": model,
                "prompt": prompt,
                "img_url": self._to_media_url(image_path),
                "duration": duration,
                "shot_type": shot_type,
            }
            if negative_prompt:
                call_kwargs["negative_prompt"] = negative_prompt
            if resolution:
                call_kwargs["resolution"] = resolution
            if video_ratio:
                call_kwargs["ratio"] = video_ratio
            if prompt_extend is not None:
                call_kwargs["prompt_extend"] = prompt_extend
            if watermark is not None:

View on GitHub (pinned to 848b054e4f)

Solutions

  1. Supply an existing image_path when using legacy wan2.x models.
  2. If you intended text-to-video, use a model where _is_text_to_video_model returns true instead.
  3. Verify the model string for typos causing wrong branch selection.
  4. Confirm the image-producing upstream step ran before calling generate_video.

Example fix

// before
client.generate_video(model="wan2.1-i2v", prompt=p)
// after
client.generate_video(model="wan2.1-i2v", prompt=p, image_path="input.jpg")
Defensive patterns

Strategy: validation

Validate before calling

if is_legacy_video_model(model) and not image_path:
    raise ValueError(f"{model} requires image_path")

Type guard

def legacy_inputs_ok(model: str, image_path: str | None) -> bool:
    return not is_legacy_video_model(model) or bool(image_path)

Try / catch

try:
    client.generate_video(model="wan2.1-i2v", prompt=p, image_path=img)
except ValueError as e:
    logger.error("legacy model input missing: %s", e)
    raise

Prevention

When it happens

Trigger: A legacy model name is passed to generate_video() without image_path (None or empty string), reaching the 'else' legacy branch that needs image_path for img_url.

Common situations: Switching from a newer model to wan2.1/wan2.6 while keeping only text or video inputs; image_path cleared after a failed upstream download; model name typo routing into the legacy branch unintentionally.

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 ATH-MaaS/Pixelle-Video@848b054e4f (2026-08-30). Data as JSON: /api/errors/fe23729a6ef69ab2. Report an issue: GitHub.