Comfy-Org/ComfyUI · error · RuntimeError
ByteDance request failed. Code: {response.error['code']}, me
Error message
ByteDance request failed. Code: {response.error['code']}, message: {response.error['message']} What it means
ByteDance image tasks return an error object inside an otherwise-HTTP-200 response. get_image_url_from_response checks response.error and re-raises it as RuntimeError with the API's code and message, after logging it at info level.
Source
Thrown at comfy_api_nodes/nodes_bytedance.py:427
def _seedance2_price_extractor(model_id: str, has_video_input: bool, resolution: str):
"""Returns a price_extractor closure for Seedance 2.0 poll_op."""
rate = seedance2_price_per_1k_tokens(model_id, has_video_input, resolution)
if rate is None:
return None
def extractor(response: TaskStatusResponse) -> float | None:
if response.usage is None:
return None
return response.usage.total_tokens * 1.43 * rate / 1_000.0
return extractor
def get_image_url_from_response(response: ImageTaskCreationResponse) -> str:
if response.error:
error_msg = f"ByteDance request failed. Code: {response.error['code']}, message: {response.error['message']}"
logging.info(error_msg)
raise RuntimeError(error_msg)
logging.info("ByteDance task succeeded, image URL: %s", response.data[0]["url"])
return response.data[0]["url"]
class ByteDanceImageNode(IO.ComfyNode):
@classmethod
def define_schema(cls):
return IO.Schema(
node_id="ByteDanceImageNode",
display_name="ByteDance Image",
category="partner/image/ByteDance",
description="Generate images using ByteDance models via api based on prompt",
inputs=[
IO.Combo.Input("model", options=["seedream-3-0-t2i-250415"]),
IO.String.Input(
"prompt",
multiline=True,View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Read the code/message pair: content-policy rejections need a prompt change; quota errors need billing/credits.
- Fix the parameter the code points at (size, seed range, model id).
- Transient codes can be handled by re-queueing the workflow once.
Defensive patterns
Strategy: try-catch
Try / catch
try:
url = get_image_url_from_response(response)
except RuntimeError as e:
code = parse_code(str(e))
if code in TRANSIENT_CODES:
response = await recreate_task(...) # single retry
else:
raise # moderation/quota errors need human action Prevention
- Check response.error on every ByteDance task response instead of assuming 200 means success.
- Keep prompts within content policy and monitor account credits before long batch runs.
When it happens
Trigger: Any ByteDanceImageNode task whose ImageTaskCreationResponse carries a non-null error - invalid prompt (moderation), quota exhausted, invalid parameters, or content policy rejection.
Common situations: Prompt trips content moderation; account out of credits; model name or size string rejected by the API; transient upstream failure during task creation.
Related errors
- Seedance session {session.session_id} completed without a gr
- Seed Audio returned no audio (code={response.code}): {respon
- Seed API error ({response.error.code}): {response.error.mess
- Empty response from Seed model.
- Reference video {index} is too small: {w}x{h} = {pixels:,} t
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/5750acebe36689de.
Report an issue: GitHub.