TG Send Video ◀️
VHS output straight to Telegram, metadata and all
- video
- trigger
- message
- message_id
- trigger
Video output in ComfyUI already has a de facto standard: Video Helper Suite's Filenames output, a (bool, [paths]) tuple. This node eats that type directly, which means any workflow that ends in a VHS Video Combine can end in a Telegram message instead of (or as well as) a file on disk. And this is the node in the pack where a ComfyUI habit becomes a privacy problem.
Just wire the filenames in
video is a VHS_FILENAMES socket and requires a link - no typing a path in. Wire Video Combine → Filenames into it, or wire the Listener's own message_video output in if you want the bot to bounce someone's uploaded clip back at them without re-encoding anything.
The node doesn't open the video with ffmpeg or re-encode it. It picks the first usable path out of the tuple (skipping any .png/.json entries VHS may include), reads the bytes, and uploads them with the original filename. If the tuple has nothing usable it raises The VHS_FILENAMES input contains no video file. - usually the sign that you grabbed a preview path rather than the Filenames output.
The metadata warning, in plain words
Image and audio sends in this pack encode the pixels or samples fresh, so they carry no ComfyUI metadata. Video does not work that way - the sender uploads the original file bytes and the original filename, so whatever is embedded in your MP4 is embedded in the message. If that MP4 came out of Video Combine with save_metadata on, you just sent a stranger your entire prompt, checkpoint name, LoRA list and node graph.
The fix is one setting: in Video Combine, turn save_metadata off and connect its Filenames output directly to this node. Do it before the bot ever goes public, not after.
Inputs you'll actually set
chat_id comes from the Listener. send_as is the interesting one:
- Animation sends
sendAnimation- Telegram plays it inline, looping and muted, like a GIF. Good for short show-off clips. - Video sends
sendVideo- a real video with controls and sound. - File sends
sendDocument- no inline player, no re-encode, arrives as a downloadable file. The one to use for anything you want byte-identical.
caption (0–1024 chars) plus parse_mode (None, HTML, Markdown, MarkdownV2) do their usual thing; bad MarkdownV2 markup is a hard 400 from Telegram, not a retry. show_caption_above_media moves the caption over the video, has_spoiler hides it behind a tap-to-reveal blur, disable_notification defaults to True (silent delivery unless you change it) and protect_content blocks forwarding and saving. message_thread_id takes the Listener's thread ID so forum-topic bots reply in the right thread; -1 means no thread and gets stripped before the request.
trigger is the untyped ordering leash - chain it through to guarantee this send happens before the next node fires.
Outputs
message is the Telegram response DICT, message_id is the ID of the posted message (feed it to Edit Message Video if you're doing the post-then-update trick), trigger passes through. If all five retry attempts fail, message/message_id come back as silent blockers so nothing downstream edits a phantom message, and the workflow carries on instead of erroring out.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/CoolBreeze164/ComfyUI-Autonomous-Telegram-Bot
python -m pip install -r ComfyUI-Autonomous-Telegram-Bot/requirements.txt
Use python_embeded\python.exe on Windows portable. The pack needs httpx, numpy, pillow and av>=14.2.0; PyAV ships its own media libraries, so there's no ffmpeg binary to install or PATH to fix. Manager search term is ComfyUI Autonomous Telegram Bot. Restart after.
Common issues
The VHS_FILENAMES input contains no video file- connect Video Combine'sFilenames, notPreview/Images.- Refused or fails on a long clip - the Bot API's own upload ceiling for bots is around 50 MB. Trim, compress, or send it as a file from a smaller encode; nothing in the pack raises that limit.
- Sound missing - you sent it as Animation. Animations are muted by design; use
Video. - It looks like the whole thing hangs - media uploads get a 120-second read allowance per attempt, up to five attempts. A slow link to Telegram is slow, and the node waits rather than dropping your clip.
- Prompt leak - you forgot
save_metadataoff. As above.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| bot_token | STRING | Telegram bot token from BotFather | |
| chat_id | INT | Unique identifier for the target chat | |
| video | VHS_FILENAMES | the video to send (VHS) | |
| caption | STRING | Media caption, 0-1024 characters after entities parsing | |
| parse_mode | COMBO | Mode for parsing entities in the photo caption. See https://core.telegram.org/bots/api#formatting-options for more details. | |
| show_caption_above_media | BOOLEAN | false | Pass True, if the caption must be shown above the message media |
| has_spoiler | BOOLEAN | false | Pass True if the media needs to be covered with a spoiler animation |
| disable_notification | BOOLEAN | true | Sends the message silently. Users will receive a notification with no sound. |
| protect_content | BOOLEAN | false | Protects the contents of the sent message from forwarding and saving |
| send_as | COMBO | How to send the video | |
| message_thread_id | INT | -1-1–9223372036854776000 | Unique identifier for the target message thread of the forum topic (-1 = None) |
| triggeropt | * | Optional trigger to enforce execution order |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| message | DICT | — |
| message_id | INT | — |
| trigger | * | — |