ATH-MaaS/Pixelle-Video · error · ValueError

未知的视频生成模型: {model}

Error message

未知的视频生成模型: {model}

What it means

VideoClient.generate_video dispatches to model-specific backends (_generate_wan, _generate_kling, _generate_seedance). If the model string matches none of the known branches, it raises ValueError listing the unknown model. This is a client-side guard against unsupported model names, typically caused by typos or renamed model IDs.

Source

Thrown at pixelle_video/services/api_services/video_client.py:229

                duration,
                shot_type,
                video_ratio,
                last_image_path,
                first_clip_path,
                reference_image_path,
                reference_image_paths,
                reference_video_paths,
                reference_audio_path,
                audio_path,
                negative_prompt,
                resolution,
                prompt_extend,
                watermark if watermark is not None else False,
                seed,
                audio,
            )
        else:
            raise ValueError(f"未知的视频生成模型: {model}")

    def _generate_wan(
        self,
        prompt: str,
        image_path: Optional[str],
        save_path: str,
        model: str,
        duration: int,
        shot_type: str,
        video_ratio: str,
        last_image_path: Optional[str],
        first_clip_path: Optional[str],
        reference_image_path: Optional[str],
        reference_image_paths: Optional[list[str]],
        reference_video_paths: Optional[list[str]],
        reference_audio_path: Optional[str],
        audio_path: Optional[str],
        negative_prompt: Optional[str],

View on GitHub (pinned to 848b054e4f)

Solutions

  1. Check the exact supported model names in video_client.py's dispatch logic and use one verbatim
  2. If the model was renamed, use the new canonical name or a normalize_model_name-supported alias
  3. Update video_client.py to add a branch for the new model if it is genuinely supported by the backend
  4. Print/inspect the model value being passed — often it comes from config with trailing whitespace or wrong case

Example fix

// before
client.generate_video(prompt, model='wan2-t2v')  # ValueError: 未知的视频生成模型
// after
client.generate_video(prompt, model='wan2.2-t2v-plus')  # use a name the dispatcher knows
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED_MODELS = {'wan2.2-t2v-plus', 'kling-v1', 'seedance-...' }  # verify against video_client.py
if model not in SUPPORTED_MODELS:
    raise ValueError(f'Unsupported model: {model!r}; supported: {sorted(SUPPORTED_MODELS)}')

Type guard

def is_known_model(model: object) -> bool:
    return isinstance(model, str) and model in SUPPORTED_MODELS

Try / catch

try:
    client.generate_video(prompt, model=model)
except ValueError as e:
    logging.error(f'{e} — check supported model names in video_client.py')
    model = 'wan2.2-t2v-plus'  # safe default

Prevention

When it happens

Trigger: Calling generate_video(prompt, model='<name>', ...) with a model string that does not match any known model (e.g. 'wan2.0', 'kling-v2', 'seedance-pro' variants not in the dispatch table).

Common situations: Typo or wrong casing in the model name; copying a model ID from vendor docs that this wrapper hasn't mapped; using an old model name after a rename; dynamically chosen model from UI config not in the supported list.

Related errors


AI-assisted analysis of ATH-MaaS/Pixelle-Video@848b054e4f (2026-08-30). Data as JSON: /api/errors/df2c1db69f47494c. Report an issue: GitHub.