{"record":{"id":"7890c693e328f574","repo":"Comfy-Org/ComfyUI","slug":"only-len-urls-of-len-response-data-images-we","errorCode":null,"errorMessage":"Only {len(urls)} of {len(response.data)} images were generated before error.","messagePattern":"Only (.+?) of (.+?) images were generated before error\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bytedance.py","lineNumber":760,"sourceCode":"            ApiEndpoint(path=BYTEPLUS_IMAGE_ENDPOINT, method=\"POST\"),\n            response_model=ImageTaskCreationResponse,\n            data=Seedream4TaskCreationRequest(\n                model=model,\n                prompt=prompt,\n                image=reference_images_urls,\n                size=f\"{w}x{h}\",\n                seed=seed,\n                sequential_image_generation=sequential_image_generation,\n                sequential_image_generation_options=Seedream4Options(max_images=max_images),\n                watermark=watermark,\n                output_format=\"png\" if model == \"seedream-5-0-260128\" else None,\n            ),\n        )\n        if len(response.data) == 1:\n            return IO.NodeOutput(await download_url_to_image_tensor(get_image_url_from_response(response)))\n        urls = [str(d[\"url\"]) for d in response.data if isinstance(d, dict) and \"url\" in d]\n        if fail_on_partial and len(urls) < len(response.data):\n            raise RuntimeError(f\"Only {len(urls)} of {len(response.data)} images were generated before error.\")\n        return IO.NodeOutput(torch.cat([await download_url_to_image_tensor(i) for i in urls]))\n\n\ndef _seedream_model_inputs(\n    *,\n    max_ref_images: int,\n    presets: list,\n    max_width: int = 6240,\n    max_height: int = 4992,\n    supports_batch: bool = True,\n):\n    inputs = [\n        IO.Combo.Input(\n            \"size_preset\",\n            options=[label for label, _, _ in presets],\n            tooltip=\"Pick a recommended size. Select Custom to use the width and height below.\",\n        ),\n        IO.Int.Input(","sourceCodeStart":742,"sourceCodeEnd":778,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bytedance.py#L742-L778","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before (workflow / node params)\nsequential_image_generation = \"auto\"\nmax_images = 6\nfail_on_partial = True  // raises when only 4 of 6 URLs come back\n\n// after\nsequential_image_generation = \"auto\"\nmax_images = 3\nfail_on_partial = False // returns the images that succeeded","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"# partial batch results are expected behavior, not a crash\ntry:\n    out = await ByteDanceSeedreamNode.execute(...)  # or run node in workflow\nexcept RuntimeError as e:\n    if 'images were generated before error' in str(e):\n        logger.warning('partial Seedream batch: %s', e)\n        out = await rerun_with(fail_on_partial=False)\n    else:\n        raise","preventionTips":["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."],"tags":["bytedance","seedream","api-nodes","partial-results","batch-generation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}