Nodes/ComfyUI Telegram Suite/Send Audio πŸ”½
ComfyUI Node

Send Audio πŸ”½

Send TTS and audio straight to Telegram β€” voice notes included

By SwissCore92Β·Created about a year agoΒ·Updated 2 months agoΒ· 9
Send Audio πŸ”½
  • bot
  • audio
  • trigger
  • message
  • message_id
  • trigger
β—„chat_idβ€”β–Ί
β—„captionβ–Ί
β—„parse_modeβ–Ύβ–Ί
β—„show_caption_above_mediafalseβ–Ί
β—„disable_notificationtrueβ–Ί
β—„protect_contentfalseβ–Ί
β—„send_asβ–Ύβ–Ί
β—„file_nameaudioβ–Ί
β—„message_thread_id-1β–Ί

If you're generating audio in ComfyUI - TTS, music, sound effects - this is the node that gets it to your phone. It takes an AUDIO tensor and posts it to a Telegram chat as a voice note, a playable audio file, or a raw file. That "sent a voice message" mechanic is genuinely nice for TTS workflows: you end up with a chat history of every line the model read.

It's part of the ComfyUI Telegram Suite pack, and it's the sibling of Send Image(s) - same Telegram Bot wiring, same message/message_id outputs, one extra moving part: ffmpeg.

How it works

The AUDIO input follows ComfyUI's standard audio dict format (waveform + sample_rate, the kind of thing you get out of an audio-loading pack or a TTS node). The node renders it to WAV bytes with torchaudio, then branches on the send_as dropdown:

  • Voice β†’ converted to OGG (Opus) via ffmpeg and sent with sendVoice. This is the "voice message" style - the little bubble with the play button.
  • Audio β†’ converted to MP3 via ffmpeg and sent with sendAudio (the "music file" style with title/artist metadata).
  • File β†’ sent as-is with sendDocument (WAV, no conversion).

The quiet gotcha is in that middle column: converting to OGG or MP3 shells out to ffmpeg, which must be on your PATH. The README flags ffmpeg as a requirement up front, and it's the one dependency pip can't install for you. If you only ever use File mode you can skip it - but Voice and Audio will fail with a runtime error the moment they hit a machine without ffmpeg.

Inputs and outputs that matter

  • bot, chat_id - from a Telegram Bot πŸ”½ node (your configured token + target chat).
  • audio - the AUDIO tensor.
  • send_as - Voice / Audio / File, described above.
  • caption, parse_mode - text under the audio; parse_mode is None/HTML/Markdown/MarkdownV2.
  • file_name (default "audio") - base name for the uploaded file.
  • disable_notification (default True) - silent delivery, flip to False for an actual ping.
  • protect_content - blocks forwarding/saving.
  • message_thread_id - forum topic targeting; -1 means the main chat.

Outputs are message (raw API response DICT), message_id (INT - keep it if you want to edit this message later), and the trigger passthrough.

Installation

Same as every node in this pack - it all ships together:

cd ComfyUI/custom_nodes
git clone https://github.com/SwissCore92/comfyui-telegram-suite.git
cd comfyui-telegram-suite
pip install -r requirements.txt

or install "ComfyUI Telegram Suite" via ComfyUI Manager and restart. Then put your bot tokens and chat IDs in ComfyUI/user/default/telegram-suite/config.json and restart again. No model downloads; the pip deps are light (httpx, colorama, plus torchaudio). The one system-level requirement is ffmpeg.

Troubleshooting

  • ffmpeg audio conversion failed - ffmpeg isn't on PATH. Install it system-wide (or drop an ffmpeg binary on PATH) and restart. Test with ffmpeg -version.
  • "Telegram bot token ... was not found" - the config file was auto-created with placeholders on first run; fill in real values and restart.
  • Voice/Audio send works, File doesn't, or vice versa - different code paths. File mode skips ffmpeg entirely; the other two require it.
  • Your bot token lives in plaintext in config.json. Don't share that file.
CategoryTelegram Suite πŸ”½

Inputs (12)

NameTypeDefaultDescription
botTELEGRAM_BOTTelegram bot instance
chat_idINTUnique identifier for the target chat
audioAUDIOthe audio to send
captionSTRINGMedia caption, 0-1024 characters after entities parsing
parse_modeCOMBOMode for parsing entities in the photo caption. See https://core.telegram.org/bots/api#formatting-options for more details.
show_caption_above_mediaBOOLEANfalsePass True, if the caption must be shown above the message media
disable_notificationBOOLEANtrueSends the message silently. Users will receive a notification with no sound.
protect_contentBOOLEANfalseProtects the contents of the sent message from forwarding and saving
send_asCOMBOHow to send the audio
file_nameSTRINGaudiothe file name for this media
message_thread_idINT-1-1–9223372036854776000Unique identifier for the target message thread of the forum topic (-1 = None)
triggeropt*Optional trigger to enforce execution order

Outputs (3)

NameTypeDescription
messageDICTβ€”
message_idINTβ€”
trigger*β€”