calesthio/OpenMontage · error · ValueError

resolution must be 480p, 720p, 1080p, or 4k

Error message

resolution must be 480p, 720p, 1080p, or 4k

What it means

Second check in `_build_payload`: after lowercasing, `resolution` (default '720p') must be a key in the tool's `OUTPUT_DIMENSIONS` map — 480p, 720p, 1080p, or 4k. These are the resolutions Ark's Seedance content-generation API accepts; anything else (e.g. '1440p', '2k', '540p') would be rejected by or confuse the provider, so the tool fails fast before the paid POST.

Source

Thrown at tools/video/seedance_ark.py:701

                ),
                duration_seconds=round(time.time() - started, 2),
            )

    def _build_payload(self, inputs: dict[str, Any]) -> dict[str, Any]:
        operation = str(inputs.get("operation", "text_to_video"))
        if operation not in {
            "text_to_video",
            "image_to_video",
            "reference_to_video",
        }:
            raise ValueError(
                "operation must be text_to_video, image_to_video, or reference_to_video"
            )

        model, variant = self._resolve_model(inputs)
        resolution = str(inputs.get("resolution", "720p")).lower()
        if resolution not in self.OUTPUT_DIMENSIONS:
            raise ValueError("resolution must be 480p, 720p, 1080p, or 4k")
        if variant in {"2.5", "fast", "mini"} and resolution not in {
            "480p",
            "720p",
        }:
            raise ValueError(f"{variant} supports only 480p or 720p resolution")

        ratio = str(inputs.get("aspect_ratio", "16:9"))
        valid_ratios = {
            "adaptive",
            "21:9",
            "16:9",
            "4:3",
            "1:1",
            "3:4",
            "9:16",
        }
        if ratio not in valid_ratios:
            raise ValueError(

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Use exactly one of: '480p', '720p', '1080p', '4k' (case-insensitive)
  2. Note that the 4k literal has no 'p' — '4kp' is invalid
  3. Cross-check the variant constraint: if the model variant is 2.5/fast/mini, only 480p/720p are allowed (next check)

Example fix

# before
inputs = {"resolution": "2k", "prompt": "..."}
# after
inputs = {"resolution": "1080p", "prompt": "..."}
Defensive patterns

Strategy: validation

Validate before calling

VALID_RES = {"480p", "720p", "1080p", "4k"}
resolution = str(inputs.get("resolution", "720p")).lower()
if resolution not in VALID_RES:
    raise ValueError(f"resolution {resolution!r} not in {sorted(VALID_RES)}")

Type guard

def is_valid_resolution(r: object) -> bool:
    return str(r).lower() in {"480p", "720p", "1080p", "4k"}

Prevention

When it happens

Trigger: Passing `resolution: '2k'`, `'1440p'`, `'sd'`, `'hd'`, or an empty string; passing 1080 (int) which lowercases to '1080' without the 'p'; typos like '720P' actually pass (case is lowered) but '720 p' fails.

Common situations: Porting settings from another provider whose resolution vocabulary differs (fal/Runway use different tokens); treating the value as a dimension pair or pixel height; config defaults left as placeholders.

Related errors


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