Comfy-Org/ComfyUI · error · RuntimeError
Only {len(urls)} of {len(response.data)} images were generat
Error message
Only {len(urls)} of {len(response.data)} images were generated before error. What it means
Raised by ByteDanceSeedreamNode (Seedream 4.5/5.0 unified image node) when a sequential/batch generation request finished but only some of the requested images succeeded. The API returns a list of result items in response.data and some items lack a 'url' key, meaning the model stopped or errored partway. With fail_on_partial=True (the default for this node) the node refuses to return a partial batch.
Source
Thrown at comfy_api_nodes/nodes_bytedance.py:760
ApiEndpoint(path=BYTEPLUS_IMAGE_ENDPOINT, method="POST"),
response_model=ImageTaskCreationResponse,
data=Seedream4TaskCreationRequest(
model=model,
prompt=prompt,
image=reference_images_urls,
size=f"{w}x{h}",
seed=seed,
sequential_image_generation=sequential_image_generation,
sequential_image_generation_options=Seedream4Options(max_images=max_images),
watermark=watermark,
output_format="png" if model == "seedream-5-0-260128" else None,
),
)
if len(response.data) == 1:
return IO.NodeOutput(await download_url_to_image_tensor(get_image_url_from_response(response)))
urls = [str(d["url"]) for d in response.data if isinstance(d, dict) and "url" in d]
if fail_on_partial and len(urls) < len(response.data):
raise RuntimeError(f"Only {len(urls)} of {len(response.data)} images were generated before error.")
return IO.NodeOutput(torch.cat([await download_url_to_image_tensor(i) for i in urls]))
def _seedream_model_inputs(
*,
max_ref_images: int,
presets: list,
max_width: int = 6240,
max_height: int = 4992,
supports_batch: bool = True,
):
inputs = [
IO.Combo.Input(
"size_preset",
options=[label for label, _, _ in presets],
tooltip="Pick a recommended size. Select Custom to use the width and height below.",
),
IO.Int.Input(View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Set fail_on_partial=False if partial results are acceptable; the node then downloads whatever URLs came back instead of raising.
- Reduce max_images (e.g. to 2-3) so the sequential run is less likely to fail partway.
- Simplify the prompt to avoid content that causes individual images in the batch to be dropped.
- Retry with a different seed; a partial failure is often specific to the sampled sequence.
Example fix
// before (workflow / node params) sequential_image_generation = "auto" max_images = 6 fail_on_partial = True // raises when only 4 of 6 URLs come back // after sequential_image_generation = "auto" max_images = 3 fail_on_partial = False // returns the images that succeeded
Defensive patterns
Strategy: fallback
Try / catch
# partial batch results are expected behavior, not a crash
try:
out = await ByteDanceSeedreamNode.execute(...) # or run node in workflow
except RuntimeError as e:
if 'images were generated before error' in str(e):
logger.warning('partial Seedream batch: %s', e)
out = await rerun_with(fail_on_partial=False)
else:
raise Prevention
- Set fail_on_partial=False unless downstream code requires an exact image count.
- Keep max_images small (2-3) for long sequential runs.
- Wrap batch outputs with a length check before indexing a fixed count.
When it happens
Trigger: sequential_image_generation='auto' with max_images>1 on Seedream 4.5/5.0; the BytePlus API completes the task but returns fewer URL-bearing entries than response.data entries (e.g. content-filtered or failed generations), and fail_on_partial is left at its default True.
Common situations: Batch story-scene generation where one image in the sequence trips moderation; long multi-image runs that time out server-side mid-batch; users who need all N images downstream (e.g. torch.cat of a fixed count) and therefore keep fail_on_partial on.
Related errors
- Minimum image resolution for the selected model is 0.92MP, b
- Maximum image resolution for the selected model is 4.19MP, b
- Maximum image resolution for the selected model is 16.78MP,
- 'thinking' can only be disabled for text-to-image; enable it
- Only a single input image is supported.
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/7890c693e328f574.
Report an issue: GitHub.