{"record":{"id":"89440d44ea59afdb","repo":"Comfy-Org/ComfyUI","slug":"the-prompt-references-audio-max-tag-but-referen","errorCode":null,"errorMessage":"The prompt references @Audio{max_tag}, but reference mode is '{MODE_TEXT}'. Switch to '{MODE_AUDIO}' and connect the reference clip(s).","messagePattern":"The prompt references @Audio(.+?), but reference mode is '(.+?)'\\. Switch to '(.+?)' and connect the reference clip\\(s\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bytedance.py","lineNumber":3159,"sourceCode":"        i\n        for i in range(1, 3 + 1)\n        if reference_mode.get(f\"reference_audio_{i}\") is not None\n    ]\n\n\ndef validate_seed_audio_inputs(\n    text_prompt: str,\n    mode: str,\n    audio_indices: list[int],\n    has_image: bool,\n    preset_voice: str | None = None,\n) -> None:\n    validate_string(text_prompt, field_name=\"text_prompt\", min_length=1, max_length=3000)\n    max_tag = max_audio_tag(text_prompt)\n\n    if mode == MODE_TEXT:\n        if max_tag:\n            raise ValueError(\n                f\"The prompt references @Audio{max_tag}, but reference mode is '{MODE_TEXT}'. \"\n                f\"Switch to '{MODE_AUDIO}' and connect the reference clip(s).\"\n            )\n    elif mode == MODE_AUDIO:\n        if not audio_indices:\n            raise ValueError(\n                f\"Reference mode '{MODE_AUDIO}' requires at least one reference_audio input \"\n                f\"(or switch to '{MODE_TEXT}').\"\n            )\n        if audio_indices != list(range(1, len(audio_indices) + 1)):\n            raise ValueError(\n                \"Connect reference_audio inputs in order without gaps: reference_audio_1, then _2, then _3.\"\n            )\n        if max_tag > len(audio_indices):\n            raise ValueError(\n                f\"The prompt references @Audio{max_tag}, but only {len(audio_indices)} \"\n                f\"reference audio(s) are connected.\"\n            )","sourceCodeStart":3141,"sourceCodeEnd":3177,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bytedance.py#L3141-L3177","documentation":"The Seed-OSS audio node uses @Audio{N} tags in the prompt to reference connected clips. If max_audio_tag(text_prompt) finds such a tag but the mode widget is 'text only' (MODE_TEXT), the tag has no meaning and the node refuses to run, telling the user to switch to 'audio reference' mode and connect the clips.","triggerScenarios":"Calling the audio generation node with mode='text only' while text_prompt contains '@Audio1' or higher (max_audio_tag returns > 0).","commonSituations":"Starting from an audio-reference template but leaving the mode widget on text only; hand-editing prompts that retain @Audio tags from an earlier workflow.","solutions":["Switch the mode widget to 'audio reference' and connect the referenced clips.","Or remove all @Audio tags from the prompt to run pure text-to-sound."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from comfy_api_nodes.nodes_bytedance import max_audio_tag, MODE_TEXT\nif mode == MODE_TEXT and max_audio_tag(text_prompt):\n    raise ValueError(\"remove @Audio tags or switch mode to audio reference\")","typeGuard":"def prompt_has_audio_tags(prompt: str) -> bool:\n    return max_audio_tag(prompt) > 0","tryCatchPattern":null,"preventionTips":["In text-only mode keep prompts free of @Audio{N} tags.","When templates carry tags, set the mode widget to 'audio reference'."],"tags":["bytedance","seed-audio","validation","prompt","api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}