calesthio/OpenMontage · error · ValueError

provide only one of end_image_url/end_image_path

Error message

provide only one of end_image_url/end_image_path

What it means

Raised when operation is 'image_to_video' and both end_image_url and end_image_path are non-empty. The Ark last-frame slot takes one image, so providing the end frame through two channels at once is ambiguous and rejected before the request is sent.

Source

Thrown at tools/video/seedance_ark.py:758

                raise ValueError(
                    "text_to_video does not accept reference media; use "
                    "image_to_video or reference_to_video"
                )
        elif operation == "image_to_video":
            first_refs = self._single_image_refs(inputs)
            if len(first_refs) != 1:
                raise ValueError("image_to_video requires exactly one reference image")
            content.append(self._image_content(first_refs[0], role="first_frame"))
            end_refs = [
                value
                for value in (
                    inputs.get("end_image_url"),
                    inputs.get("end_image_path"),
                )
                if value
            ]
            if len(end_refs) > 1:
                raise ValueError("provide only one of end_image_url/end_image_path")
            if end_refs:
                content.append(self._image_content(end_refs[0], role="last_frame"))
        else:
            image_refs = list(inputs.get("reference_image_urls") or [])
            image_refs.extend(inputs.get("reference_image_paths") or [])
            if inputs.get("reference_image_url"):
                image_refs.append(inputs["reference_image_url"])
            if inputs.get("reference_image_path"):
                image_refs.append(inputs["reference_image_path"])
            max_images = 30 if variant == "2.5" else 9
            max_videos = 10 if variant == "2.5" else 3
            max_audios = 10 if variant == "2.5" else 3
            max_reference_seconds = 30 if variant == "2.5" else 15
            if len(image_refs) > max_images:
                raise ValueError(
                    f"reference_to_video accepts at most {max_images} reference images"
                )

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Keep only one end-frame key (end_image_url for remote, end_image_path for local) and delete the other
  2. If both point at the same asset, keep the URL variant

Example fix

# before
inputs = {"operation": "image_to_video", "reference_image_url": a,
           "end_image_url": eu, "end_image_path": ep}

# after
inputs = {"operation": "image_to_video", "reference_image_url": a,
           "end_image_url": eu}
Defensive patterns

Strategy: validation

Validate before calling

if inputs.get("end_image_url") and inputs.get("end_image_path"):
    raise ValueError("set only one of end_image_url/end_image_path")
# or: inputs.pop("end_image_path", None) when a URL is present

Type guard

def has_single_end_frame(inputs: dict) -> bool:
    return bool(inputs.get("end_image_url")) != bool(inputs.get("end_image_path"))

Prevention

When it happens

Trigger: inputs containing truthy values for both end_image_url and end_image_path simultaneously under image_to_video.

Common situations: A config template that fills both URL and local-path variants of every field; migrating a caller from paths to URLs without clearing the old key.

Related errors


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