Comfy-Org/ComfyUI · error · ValueError

Up to {SEED_MAX_IMAGES} images are supported per request.

Error message

Up to {SEED_MAX_IMAGES} images are supported per request.

What it means

Raised by the ByteDanceSeedNode before any request when the total number of image frames across all connected image inputs exceeds SEED_MAX_IMAGES (20). The node sums get_number_of_images over every connected image tensor (a batched tensor of N images counts as N), so a single 25-frame batch trips it just like 25 separate images.

Source

Thrown at comfy_api_nodes/nodes_bytedance_llm.py:204

            ),
        )

    @classmethod
    async def execute(
        cls,
        prompt: str,
        model: dict,
        seed: int,
        system_prompt: str = "",
    ) -> IO.NodeOutput:
        validate_string(prompt, strip_whitespace=True, min_length=1)
        model_label = model["model"]
        temperature = model["temperature"]
        model_id = SEED_MODELS[model_label]

        image_tensors: list[Input.Image] = [t for t in (model.get("images") or {}).values() if t is not None]
        if sum(get_number_of_images(t) for t in image_tensors) > SEED_MAX_IMAGES:
            raise ValueError(f"Up to {SEED_MAX_IMAGES} images are supported per request.")

        video_inputs: list[Input.Video] = [v for v in (model.get("videos") or {}).values() if v is not None]
        if len(video_inputs) > SEED_MAX_VIDEOS:
            raise ValueError(f"Up to {SEED_MAX_VIDEOS} videos are supported per request.")

        content: list[BytePlusMessageContent] = []
        if image_tensors:
            content.extend(await _build_image_content_blocks(cls, image_tensors))
        if video_inputs:
            content.extend(await _build_video_content_blocks(cls, video_inputs))
        content.append(BytePlusInputText(text=prompt))

        response = await sync_op(
            cls,
            ApiEndpoint(path=BYTEPLUS_RESPONSES_ENDPOINT, method="POST"),
            response_model=BytePlusResponseObject,
            data=BytePlusResponseCreateRequest(
                model=model_id,

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Reduce the connected images/batches so the total frame count is 20 or fewer (split into multiple Seed node runs and merge text outputs).
  2. Use an ImageBatch/ImageConcat node downstream selection, or trim the batch with an image-picker node before connecting.
  3. If you need full-video understanding, pass a VIDEO input instead — video frames are counted separately (max 4 videos).

Example fix

// before: images with 24-frame batch -> Seed node
// after:  trim batch to 20 frames (e.g. ImageCrop/segment nodes) or run two 12-frame requests and combine results
Defensive patterns

Strategy: validation

Validate before calling

SEED_MAX_IMAGES = 20

def total_frames(image_tensors: list) -> int:
    return sum(t.shape[0] if t.ndim == 4 else 1 for t in image_tensors)

# before connecting: assert total_frames(images) <= SEED_MAX_IMAGES

Prevention

When it happens

Trigger: sum(get_number_of_images(t) for connected image tensors) > 20 — e.g. one batched IMAGE tensor of 24 images, or several inputs whose frames total more than 20.

Common situations: Feeding a video frame dump or an image grid batch straight into the Seed LLM; daisy-chaining multiple Load Image (batch) nodes; assuming the limit counts tensor inputs rather than frames.

Related errors


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