Comfy-Org/ComfyUI · error · ValueError

Asset video aspect ratio (W/H) must be in [0.4, 2.5], got {r

Error message

Asset video aspect ratio (W/H) must be in [0.4, 2.5], got {ratio:.3f} ({w}x{h}).

What it means

The Create Seedance Asset video node validates uploaded reference assets against BytePlus asset constraints: aspect ratio W/H must lie in [0.4, 2.5] (portrait 2:5 to landscape 5:2). The check runs after validate_video_duration/dimensions and before upload, so nothing is transmitted for an out-of-range ratio.

Source

Thrown at comfy_api_nodes/nodes_bytedance.py:3050

        )

    @classmethod
    async def execute(
        cls,
        video: Input.Video,
        group_id: str = "",
        # name: str = "",
    ) -> IO.NodeOutput:
        # if len(name) > 64:
        #     raise ValueError("Name of asset can not be greater then 64 symbols")
        validate_video_duration(video, min_duration=2, max_duration=15)
        validate_video_dimensions(video, min_width=300, max_width=6000, min_height=300, max_height=6000)

        w, h = video.get_dimensions()
        if h > 0:
            ratio = w / h
            if not (0.4 <= ratio <= 2.5):
                raise ValueError(f"Asset video aspect ratio (W/H) must be in [0.4, 2.5], got {ratio:.3f} ({w}x{h}).")
        pixels = w * h
        if not (409_600 <= pixels <= 927_408):
            raise ValueError(
                f"Asset video total pixels (W×H) must be in [409600, 927408], " f"got {pixels:,} ({w}x{h})."
            )

        fps = float(video.get_frame_rate())
        if not (24 <= fps <= 60):
            raise ValueError(f"Asset video FPS must be in [24, 60], got {fps:.2f}.")

        resolved_group = await _resolve_group_id(cls, group_id)
        asset_id = await _create_seedance_asset(
            cls,
            group_id=resolved_group,
            url=await upload_video_to_comfyapi(cls, video),
            name="",
            asset_type="Video",
        )

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Crop or pad the video so W/H is between 0.4 and 2.5 (e.g. pad a 3:1 strip vertically).
  2. Pick a different source clip whose framing already fits the band.
Defensive patterns

Strategy: validation

Validate before calling

w, h = video.get_dimensions()
if h > 0 and not (0.4 <= w / h <= 2.5):
    raise ValueError("crop or pad to bring W/H into [0.4, 2.5]")

Prevention

When it happens

Trigger: Uploading an extreme aspect-ratio video (e.g. 9:16 is fine at 0.5625, but a 1:3 vertical slice at 0.333 or a 3:1 panorama at 3.0 fails) to the video asset creation node.

Common situations: Cinemascope strips, tall phone-cropped slices, or letterboxed exports whose actual pixel ratio falls outside the band.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/419c344d9d1591d5. Report an issue: GitHub.