Comfy-Org/ComfyUI · error · ValueError

Model refused to respond: {block.refusal}

Error message

Model refused to respond: {block.refusal}

What it means

Raised while parsing a ByteDance Seed (LLM) responses-API reply: an output message contained a content block of type 'refusal' with non-empty text. This mirrors the OpenAI-style Responses API refusal mechanism — the model (or its safety layer) declined to answer, and the refusal text is passed through verbatim.

Source

Thrown at comfy_api_nodes/nodes_bytedance_llm.py:82

            tooltip="Controls randomness. 0.0 is deterministic, higher values are more random.",
            advanced=True,
        ),
    ]


def _get_text_from_response(response: BytePlusResponseObject) -> str:
    """Extract concatenated text from all assistant message output_text blocks."""
    if not response.output:
        return ""
    chunks: list[str] = []
    for item in response.output:
        if item.type != "message" or not item.content:
            continue
        for block in item.content:
            if block.type == "output_text" and block.text:
                chunks.append(block.text)
            elif block.type == "refusal" and block.refusal:
                raise ValueError(f"Model refused to respond: {block.refusal}")
    return "\n".join(chunks)


async def _build_image_content_blocks(
    cls: type[IO.ComfyNode],
    image_tensors: list[Input.Image],
) -> list[BytePlusInputImage]:
    urls = await upload_images_to_comfyapi(
        cls,
        image_tensors,
        max_images=SEED_MAX_IMAGES,
        wait_label="Uploading reference images",
    )
    return [BytePlusInputImage(image_url=url) for url in urls]


async def _build_video_content_blocks(
    cls: type[IO.ComfyNode],

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Read the refusal text in the error — it usually states which policy was hit.
  2. Rephrase the prompt to remove the triggering content or framing.
  3. Move the sensitive constraint into the system_prompt with a professional, clinical framing if it is legitimate.
  4. Try a different Seed model from the model dropdown if one is available with different filtering.
Defensive patterns

Strategy: try-catch

Try / catch

try:
    result = await seed_node.execute(...)
except ValueError as e:
    if "refused to respond" in str(e):
        # policy refusal: rephrase prompt, do not retry unchanged
        return fallback_text

Prevention

When it happens

Trigger: A chat/completions call to BYTEPLUS_RESPONSES_ENDPOINT returns an assistant message whose content includes {type: 'refusal', refusal: '...'} — typically triggered by prompts the safety filter classifies as disallowed.

Common situations: Prompts touching violence, personal data, or other policy categories; jailbreak-adjacent phrasing; regionally restricted topics; occasionally over-triggering on benign medical/security research wording.

Related errors


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