Nodes/Story JSON Nodes/String -> ElevenLabs Voice
ComfyUI Node

String -> ElevenLabs Voice

Map character names to ElevenLabs voice IDs

By stepan-bogatorjov·Created 6 months ago·Updated 2 months ago· 0
String -> ElevenLabs Voice
    • voice
    ◄nameRoger►

    StringToElevenLabsVoice is the API side of this pack's voice handling: it maps a character name like "Roger" or "Sarah" to a real ElevenLabs voice ID, so your story JSON can pick voices by name while the actual TTS call happens somewhere with an ElevenLabs key. It's a pure lookup table - no network, no API call of its own.

    The reason it exists is the same reason the whole pack does: scenes reference narrators by short, friendly names in the story JSON. ElevenLabs identifies voices by long opaque IDs (CwhRBWXzGAHq8TQ4Fs17, EXAVITQu4vr4xnSDxMaL...) that nobody wants to type into a workflow. This node takes "Roger" and hands you the ID for that preset voice, typed as ELEVENLABS_VOICE so it plugs straight into the ElevenLabs TTS node elsewhere in your graph.

    How it works

    A hardcoded dict of ~21 names to preset voice IDs - "Roger" → CwhRBWXzGAHq8TQ4Fs17, "Sarah" → EXAVITQu4vr4xnSDxMaL, and so on through the pack's default cast. An unknown name passes through as-is, on the theory that if you typed a raw voice ID in, that's what you wanted. The output is a STRING in the ELEVENLABS_VOICE type so it matches the socket that an ElevenLabs generation node expects.

    Inputs and outputs

    • name - the character name from your story JSON (default "Roger").
    • voice (ELEVENLABS_VOICE) - the resolved voice ID, wired into your ElevenLabs TTS node.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/stepan-bogatorjov/comfy_scenes_json_node
    

    Restart ComfyUI (or install via Manager under "Story JSON Nodes"). No extra dependencies - but the node you wire this into (the actual ElevenLabs node with an API key) is not in this pack.

    Troubleshooting

    The honest caveat: this pack doesn't do ElevenLabs TTS. It maps names to IDs and stops. If you don't have a separate ElevenLabs node to consume the output, this does nothing visible. And because it's a fixed preset list, your own cloned voices won't be in the table - pass their raw voice ID in as the name and it'll flow through untouched. If you'd rather stay local and free, the pack's own alternative is StringToKokoroVoice + KokoroSceneAudio, which need no key at all - the KB's rule of thumb holds here: ElevenLabs is the reliability bar, Kokoro is the speed/footprint corner.

    Categoryaudio

    Inputs (1)

    NameTypeDefaultDescription
    nameSTRINGRoger—

    Outputs (1)

    NameTypeDescription
    voiceELEVENLABS_VOICE—