{"record":{"id":"3fef38bde3cb83f4","repo":"Comfy-Org/ComfyUI","slug":"reference-mode-mode-audio-requires-at-least-on","errorCode":null,"errorMessage":"Reference mode '{MODE_AUDIO}' requires at least one reference_audio input (or switch to '{MODE_TEXT}').","messagePattern":"Reference mode '(.+?)' requires at least one reference_audio input \\(or switch to '(.+?)'\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bytedance.py","lineNumber":3165,"sourceCode":"def 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            )\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 \"","sourceCodeStart":3147,"sourceCodeEnd":3183,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bytedance.py#L3147-L3183","documentation":"In 'audio reference' mode (MODE_AUDIO) the Seed-OSS audio node requires at least one connected reference_audio input, because the mode's whole purpose is timbre/sound transfer from clips. With an empty audio_indices list the node fails fast rather than sending a request the provider would reject.","triggerScenarios":"Setting mode='audio reference' on the audio node while no reference_audio inputs are connected (audio_indices is empty).","commonSituations":"Flipping the mode widget to try voice transfer without wiring clips; disconnected audio branch after graph edits.","solutions":["Connect at least one audio clip to reference_audio_1.","Or switch the mode back to 'text only' if no reference is intended."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if mode == MODE_AUDIO and not audio_indices:\n    raise ValueError(\"audio reference mode needs at least one reference_audio input\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wire reference_audio_1 whenever the mode widget says 'audio reference'.","Switch back to 'text only' when no clips are connected."],"tags":["bytedance","seed-audio","validation","missing-input","api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}