Comfy-Org/ComfyUI · error · ValueError
The prompt references @Audio{max_tag}, but only {len(audio_i
Error message
The prompt references @Audio{max_tag}, but only {len(audio_indices)} reference audio(s) are connected. What it means
Thrown by the ByteDance Seed Audio 1.0 node when the text prompt contains an @AudioN tag whose index N exceeds the number of connected reference_audio inputs. The node parses @AudioN tags out of the prompt in 'audio reference' mode and requires one connected audio input per tag. It is a workflow-wiring validation error raised before any API call is made.
Source
Thrown at comfy_api_nodes/nodes_bytedance.py:3174
if mode == MODE_TEXT:
if max_tag:
raise ValueError(
f"The prompt references @Audio{max_tag}, but reference mode is '{MODE_TEXT}'. "
f"Switch to '{MODE_AUDIO}' and connect the reference clip(s)."
)
elif mode == MODE_AUDIO:
if not audio_indices:
raise ValueError(
f"Reference mode '{MODE_AUDIO}' requires at least one reference_audio input "
f"(or switch to '{MODE_TEXT}')."
)
if audio_indices != list(range(1, len(audio_indices) + 1)):
raise ValueError(
"Connect reference_audio inputs in order without gaps: reference_audio_1, then _2, then _3."
)
if max_tag > len(audio_indices):
raise ValueError(
f"The prompt references @Audio{max_tag}, but only {len(audio_indices)} "
f"reference audio(s) are connected."
)
elif mode == MODE_IMAGE:
if not has_image:
raise ValueError(f"Reference mode '{MODE_IMAGE}' requires a reference_image input.")
if max_tag:
raise ValueError(
f"@AudioN tags are not used in '{MODE_IMAGE}' mode; the prompt should contain "
f"only the text to synthesize."
)
elif mode == MODE_SPEAKER:
if not preset_voice or preset_voice not in SEED_AUDIO_VOICE_MAP:
raise ValueError(f"Reference mode '{MODE_SPEAKER}' requires selecting a preset voice.")
if max_tag > 1:
raise ValueError(
f"'{MODE_SPEAKER}' mode uses a single voice, so @Audio{max_tag} is out of range. "
f"Remove the @AudioN tags — the whole prompt is read in the selected voice."View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Connect additional reference_audio_N inputs up to the highest @AudioN index used in the prompt (ensure they are wired in order: _1, then _2, then _3).
- Or edit the prompt so the highest @AudioN tag does not exceed the number of connected reference audios (e.g. change '@Audio3' to '@Audio2' or remove it).
- If you only have one voice clip, switch reference_mode to 'preset voice' and drop the @AudioN tags entirely.
Example fix
// before: prompt = "<@Audio1>Hi<@Audio3>Bye" with only reference_audio_1 connected // after: prompt = "<@Audio1>Hi<@Audio2>Bye" with reference_audio_1 and reference_audio_2 connected
Defensive patterns
Strategy: validation
Validate before calling
import re
def check_audio_tags(prompt: str, num_reference_audios: int) -> None:
tags = [int(n) for n in re.findall(r"@Audio(\d+)", prompt)]
if tags and max(tags) > num_reference_audios:
raise ValueError(f"prompt uses @Audio{max(tags)} but only {num_reference_audios} reference audios connected") Prevention
- Keep the highest @AudioN tag in the prompt equal to the count of wired reference_audio inputs.
- Wire reference_audio inputs strictly in order (_1, _2, _3) with no gaps.
- Before running the full workflow, validate the prompt's tag count with a regex check in a small script node.
When it happens
Trigger: Node reference_mode is 'audio reference', audio_indices is non-empty and gap-free, but max_tag (the highest @AudioN index found in the prompt) is greater than len(audio_indices). E.g. prompt contains '@Audio3' while only reference_audio_1 and reference_audio_2 are connected.
Common situations: User edits the prompt to add a third speaker tag but forgets to wire reference_audio_3; copying a workflow that had more reference audios than the current copy; batching a multi-speaker dialogue script with more @AudioN tags than available voice clips.
Related errors
- Reference mode '{MODE_IMAGE}' requires a reference_image inp
- @AudioN tags are not used in '{MODE_IMAGE}' mode; the prompt
- Reference mode '{MODE_SPEAKER}' requires selecting a preset
- '{MODE_SPEAKER}' mode uses a single voice, so @Audio{max_tag
- Unknown reference mode: {mode!r}
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/9e2a84e1977c72ae.
Report an issue: GitHub.