calesthio/OpenMontage · error · ValueError

duration must be between 4 and {max_seconds} or -1

Error message

duration must be between 4 and {max_seconds} or -1

What it means

Error "duration must be between 4 and {max_seconds} or -1" thrown in calesthio/OpenMontage.

Source

Thrown at tools/video/seedance_ark.py:947

    def _normalize_duration(value: Any, max_seconds: int = 15) -> int:
        if value == "auto":
            return -1
        if isinstance(value, bool):
            raise ValueError(
                f"duration must be an integer from 4 to {max_seconds} or -1"
            )
        try:
            duration = int(value)
        except (TypeError, ValueError) as exc:
            raise ValueError(
                f"duration must be an integer from 4 to {max_seconds} or -1"
            ) from exc
        if str(value).strip() not in {str(duration), "auto"}:
            raise ValueError(
                f"duration must be an integer from 4 to {max_seconds} or -1"
            )
        if duration != -1 and not 4 <= duration <= max_seconds:
            raise ValueError(f"duration must be between 4 and {max_seconds} or -1")
        return duration

    @staticmethod
    def _single_image_refs(inputs: dict[str, Any]) -> list[Any]:
        refs = [
            inputs.get("reference_image_url") or inputs.get("image_url"),
            inputs.get("reference_image_path") or inputs.get("image_path"),
        ]
        return [ref for ref in refs if ref]

    @staticmethod
    def _has_any_media(inputs: dict[str, Any]) -> bool:
        keys = (
            "reference_image_url",
            "reference_image_path",
            "reference_image_urls",
            "reference_image_paths",
            "reference_video_url",

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Set duration to an integer between 4 and the model's max_seconds, or -1 for automatic duration.
  2. Check the model variant's allowed duration range in the error message and adjust the value.

When it happens

Trigger: A duration outside the allowed 4-to-max_seconds range (and not -1 for auto) is passed to the Seedance Ark video tool.

Common situations: See trigger scenarios.


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