ATH-MaaS/Pixelle-Video · error · ValueError

DashScope video edit models require video input and may use

Error message

DashScope video edit models require video input and may use reference_image input.

What it means

For video-edit DashScope models, _build_video_edit_media needs a source video (first_clip_path) and optionally a reference image. If it returns no media, this ValueError is raised. The edit model cannot operate without a video to edit.

Source

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

                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),
            )
        elif self._is_video_edit_model(model):
            media = self._build_video_edit_media(
                video_path=first_clip_path,
                reference_image_path=reference_image_path or last_image_path or image_path,
            )
            if not media:
                raise ValueError("DashScope video edit models require video input and may use reference_image input.")

            call_kwargs = {
                "api_key": self.api_key,
                "model": model,
                "prompt": prompt,
                "media": media,
                "duration": duration,
                "watermark": watermark,
            }
            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:

View on GitHub (pinned to 848b054e4f)

Solutions

  1. Provide a valid video via first_clip_path.
  2. Add a reference image via reference_image_path/image_path/last_image_path only as a complement — the video input is mandatory.
  3. Confirm the model name; if you meant first/last-frame image-to-video, pick the matching model class.
  4. Ensure the clip-producing step ran and set first_clip_path before this call.

Example fix

// before
client.generate_video(model="wan-video-edit", prompt=p, image_path="f.jpg")
// after
client.generate_video(model="wan-video-edit", prompt=p,
                      first_clip_path="clips/in.mp4",
                      reference_image_path="f.jpg")
Defensive patterns

Strategy: validation

Validate before calling

if model_requires_edit(model) and not first_clip_path:
    raise ValueError("video edit model requires first_clip_path")

Type guard

def video_edit_inputs_ok(model: str, first_clip_path: str | None) -> bool:
    return not model_requires_edit(model) or bool(first_clip_path)

Try / catch

try:
    client.generate_video(model=model, prompt=p, first_clip_path=clip)
except ValueError as e:
    logger.error("video edit input missing: %s", e)
    raise

Prevention

When it happens

Trigger: _is_video_edit_model(model) is true but first_clip_path is None/empty (no video input supplied), so media ends up empty.

Common situations: Using an edit model but passing frames as image_path only; first_clip_path variable unset because the prior clip-generation step was skipped or failed; wrong model name routing a normal generation into the edit branch.

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/8cfe6a6f5b59bd20. Report an issue: GitHub.