Nodes/ComfyUI-ElevenLabs-Pro/ElevenLabs Pro - Get Voice By Name
ComfyUI Node

ElevenLabs Pro - Get Voice By Name

Turn a voice's name into its ID, no copy-paste required

By IxMxAMAR·Created 5 months ago·Updated about a month ago· 1
ElevenLabs Pro - Get Voice By Name
    • voice_id
    • matched_name
    api_key
    nameRachel
    match_modecontains
    force_refreshfalse

    Somewhere in your ElevenLabs library there's a voice you cloned, and you keep forgetting its ID. GetVoiceByName is the pack's answer to that: type the name - "Rachel", "my podcaster clone" - and it looks the voice up against your account and returns the voice_id plus the exact matched name. It's the convenience node that sits between the full FetchVoices listing and the static Voice Selector dropdown.

    The mechanism is what you'd hope: it fetches your account's voices (same endpoint and 5-minute cache as FetchVoices) and scans them case-insensitively for your name. Three match_mode options control how strict the match is - exact, contains (the default, so "Rach" finds "Rachel"), and starts_with. It returns the first hit, as both voice_id and matched_name outputs, so you always know which voice you actually landed on. If nothing matches, you get a clear error naming the voice and mode rather than a silent empty string - which is exactly the right failure mode for a lookup node, because a silent failure would let a TTS call run with an empty ID and burn nothing but confusion.

    Two optional inputs round it out: force_refresh to bypass the cache (handy right after cloning a voice) and the always-required api_key. The node re-executes on every queue like FetchVoices, but since it's a cached read, that costs you nothing.

    Why this node beats its alternatives: the Voice Selector dropdown is offline but only knows premade voices; FetchVoices lists everything but dumps a wall of JSON at you. GetVoiceByName is the sweet spot for a parameterized workflow - you can drive a whole TTS setup by a single text field holding a voice name, then feed the resolved ID into Text to Speech, Dialogue, or Speech to Speech. It's also the right tool when a workflow you downloaded references a voice by name and you need to re-resolve it against your account.

    Install is the pack standard:

    cd ComfyUI/custom_nodes
    git clone https://github.com/IxMxAMAR/ComfyUI-ElevenLabs-Pro.git
    pip install -r ComfyUI-ElevenLabs-Pro/requirements.txt
    

    Restart ComfyUI, or install "ComfyUI-ElevenLabs-Pro" via ComfyUI Manager. Only requests and soundfile in requirements - no downloads, this is a thin API client.

    Two gotchas. First, contains mode matches the first voice alphabetically-ish in the fetch order, so if you have three clones whose names all contain "Dave", you get whichever comes first - use exact for uniqueness or you'll occasionally narrate with the wrong Dave. Second, the lookup only sees your account's voices plus what the fetch returns; a premade voice that ElevenLabs renamed mid-stream might not resolve under an old name, in which case the Voice Selector's static list is the safer fallback. And because it's account-specific, this node (unlike Voice Selector) genuinely needs your API key - no key, no lookup.

    CategoryElevenLabs Pro/Voice

    Inputs (4)

    NameTypeDefaultDescription
    api_keySTRING
    nameSTRINGRachelExact or partial voice name (case-insensitive).
    match_modeoptCOMBOcontains3 options: exact, contains, starts_with
    force_refreshoptBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    voice_idSTRING
    matched_nameSTRING