calesthio/OpenMontage · error · ValueError

local image width/height ratio must be between 0.4 and 2.5

Error message

local image width/height ratio must be between 0.4 and 2.5

What it means

Error "local image width/height ratio must be between 0.4 and 2.5" thrown in calesthio/OpenMontage.

Source

Thrown at tools/video/seedance_ark.py:1070

        self._validate_image_bytes(path.read_bytes(), str(path))

    @staticmethod
    def _validate_image_bytes(data: bytes, source: str) -> None:
        try:
            from PIL import Image

            with Image.open(io.BytesIO(data)) as image:
                width, height = image.size
                image.verify()
        except Exception as exc:
            raise ValueError(f"image is unreadable or corrupt: {source}") from exc
        if not (300 <= width <= 6000 and 300 <= height <= 6000):
            raise ValueError(
                "local image width and height must each be 300 to 6000 pixels"
            )
        ratio = width / height
        if not 0.4 <= ratio <= 2.5:
            raise ValueError(
                "local image width/height ratio must be between 0.4 and 2.5"
            )

    def _validate_data_uri(
        self,
        value: str,
        *,
        suffix_to_mime: dict[str, str],
        max_bytes: int,
        label: str,
    ) -> str:
        mime, decoded = self._decode_data_uri(
            value,
            suffix_to_mime=suffix_to_mime,
            max_bytes=max_bytes,
            label=label,
        )
        if label == "image":

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Adjust the image so width/height ratio is between 0.4 and 2.5 (crop or pad).
  2. Extreme panoramas or tall strips are not accepted; trim them to a standard aspect ratio.

When it happens

Trigger: A local reference image has a width/height aspect ratio outside the allowed 0.4-2.5 range.

Common situations: See trigger scenarios.


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