{"record":{"id":"1e5bbf02958fd0fb","repo":"Comfy-Org/ComfyUI","slug":"audion-tags-are-not-used-in-mode-image-mode","errorCode":null,"errorMessage":"@AudioN tags are not used in '{MODE_IMAGE}' mode; the prompt should contain only the text to synthesize.","messagePattern":"@AudioN tags are not used in '(.+?)' mode; the prompt should contain only the text to synthesize\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bytedance.py","lineNumber":3182,"sourceCode":"        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            )\n    elif mode == MODE_IMAGE:\n        if not has_image:\n            raise ValueError(f\"Reference mode '{MODE_IMAGE}' requires a reference_image input.\")\n        if max_tag:\n            raise ValueError(\n                f\"@AudioN tags are not used in '{MODE_IMAGE}' mode; the prompt should contain \"\n                f\"only the text to synthesize.\"\n            )\n    elif mode == MODE_SPEAKER:\n        if not preset_voice or preset_voice not in SEED_AUDIO_VOICE_MAP:\n            raise ValueError(f\"Reference mode '{MODE_SPEAKER}' requires selecting a preset voice.\")\n        if max_tag > 1:\n            raise ValueError(\n                f\"'{MODE_SPEAKER}' mode uses a single voice, so @Audio{max_tag} is out of range. \"\n                f\"Remove the @AudioN tags — the whole prompt is read in the selected voice.\"\n            )\n    else:\n        raise ValueError(f\"Unknown reference mode: {mode!r}\")\n\n\nclass ByteDanceSeedAudioNode(IO.ComfyNode):\n\n    @classmethod","sourceCodeStart":3164,"sourceCodeEnd":3200,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bytedance.py#L3164-L3200","documentation":"Thrown by the ByteDance Seed Audio node when reference_mode is 'image reference' and the prompt still contains @AudioN tags. In image mode the model takes voice characteristics from the reference image; @AudioN tags are not interpreted and the prompt should be plain synthesis text. max_tag being non-zero means the tag parser found at least one @AudioN reference.","triggerScenarios":"reference_mode == 'image reference', a reference image IS connected, but the text_prompt contains one or more @AudioN tags (max_tag > 0).","commonSituations":"User reuses a multi-speaker dialogue prompt written for 'audio reference' mode after switching the mode dropdown to 'image reference'; template prompts that always include speaker tags.","solutions":["Strip all @AudioN tags from the prompt so it contains only the text to synthesize.","If you intended per-clip voice cloning, switch reference_mode back to 'audio reference' and connect the matching reference_audio inputs."],"exampleFix":"// before: prompt = \"<@Audio1>Hello there\" (mode: image reference)\n// after:  prompt = \"Hello there\" (mode: image reference)","handlingStrategy":"validation","validationCode":"import re\n\ndef strip_audio_tags_for_mode(prompt: str, mode: str) -> str:\n    if mode == \"image reference\":\n        return re.sub(r\"@Audio\\d+\", \"\", prompt).strip()\n    return prompt","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When changing reference_mode, re-read the prompt and remove tags the new mode does not use.","Maintain separate prompt templates per mode (tagged for audio reference, plain for image/preset)."],"tags":["comfyui","bytedance","seed-audio","validation","prompt-format"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}