calesthio/OpenMontage · error · ValueError

model_name {model_name!r} is not supported for api_family=om

Error message

model_name {model_name!r} is not supported for api_family=omni

What it means

ValueError raised when building a Kling omni-family image request with a model_name outside the OMNI_IMAGE_MODELS allowlist. The omni path (operation='omni' or api_family='omni') defaults to kling-image-o1 and only accepts omni-capable models; generation-family names are rejected here.

Source

Thrown at tools/graphics/kling_official_image.py:297

        elements = normalize_element_list(inputs.get("element_list"))
        if elements:
            payload["element_list"] = elements
        self._copy_common_task_fields(inputs, payload)
        return {
            "protocol": "classic",
            "path": "/v1/images/generations",
            "payload": payload,
            "api_family": "generation",
            "operation": "generate",
            "model": payload["model_name"],
            "references_used": self._reference_metadata_from_generation_payload(payload),
            "element_ids": element_ids(payload.get("element_list")),
        }

    def _build_omni_request(self, inputs: dict[str, Any]) -> dict[str, Any]:
        model_name = str(inputs.get("model_name") or "kling-image-o1")
        if model_name not in OMNI_IMAGE_MODELS:
            raise ValueError(f"model_name {model_name!r} is not supported for api_family=omni")
        image_items, references_used = self._normalize_omni_image_list(inputs)
        prompt, prompt_references = build_image_prompt_references(self._prompt(inputs), image_items)
        references_used = prompt_references or references_used
        elements = normalize_element_list(inputs.get("element_list"))
        payload: dict[str, Any] = {
            "model_name": model_name,
            "prompt": prompt,
            "resolution": inputs.get("resolution", "1k"),
            "n": int(inputs.get("n", 1) or 1),
            "result_type": inputs.get("result_type", "single"),
            "aspect_ratio": inputs.get("aspect_ratio", "16:9"),
        }
        if image_items:
            payload["image_list"] = [{"image": item["image"]} for item in image_items]
        if elements:
            payload["element_list"] = elements
        if inputs.get("series_amount"):
            payload["series_amount"] = inputs["series_amount"]

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Use an OMNI_IMAGE_MODELS entry such as kling-image-o1 when api_family=omni
  2. Or drop api_family/operation back to generation if you actually want kling-v3
  3. Check for typos in the model name string
  4. Update OMNI_IMAGE_MODELS in kling_official_image.py when Kling ships a verified new omni model

Example fix

// before
inputs = {"operation": "omni", "model_name": "kling-v3"}
// after
inputs = {"operation": "omni", "model_name": "kling-image-o1"}
Defensive patterns

Strategy: validation

Validate before calling

OMNI_IMAGE_MODELS = {"kling-image-o1"}  # mirror the tool's allowlist
model = inputs.get("model_name") or "kling-image-o1"
assert model in OMNI_IMAGE_MODELS, f"unsupported omni model: {model}"

Prevention

When it happens

Trigger: Setting api_family='omni' (or operation='omni') while leaving model_name as a generation model like kling-v3; passing a typo'd or unreleased omni model name.

Common situations: Switching api_family to omni for multi-reference prompting but forgetting to update model_name; copy-pasting request templates between the two families; new omni models not yet allowlisted.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/41ecce4f9dbcda0b. Report an issue: GitHub.