Send WEBP to Telegram
Your Render, Straight to a Telegram Chat
- webp
- webp
- response
When a long batch finishes at 3am, the nicest notification is the picture itself. Send WEBP to Telegram posts the render to a Telegram chat the moment the graph finishes - no manual download, no browsing ComfyUI's output folder. Combined with the pack's Image to WEBP node it's a dead-simple "notify me when it's done" pipeline: VAE decode → Image to WEBP → Send WEBP to Telegram.
How it works
It's a thin wrapper over Telegram's Bot API. Each webp in the batch gets POSTed to https://api.telegram.org/bot<token>/sendDocument (or sendPhoto when send_as_document is off) as multipart upload, with your caption attached. Responses are concatenated into the response STRING output. If Telegram returns an error - bad token, wrong chat_id - the node raises and shows you the API's own error body, which is usually enough to fix it.
The inputs you actually set:
bot_token- from BotFather when you create the bot.chat_id- the chat to send to. For a DM with your bot, grab it from a tool like @userinfobot; for a group, it's the group ID. Both are just strings.caption- optional text under the image.send_as_document- default true, and keep it that way if the metadata matters. Sent as a document, Telegram stores your original bytes, so the workflow EXIF from Image to WEBP survives and you can drag the file back into ComfyUI to recover the graph. Sent as a photo, Telegram recompresses the image and the workflow is gone.timeout_seconds- default 60; raise it if you're on a slow uplink and big batches.
There's also background_upload (default true). On, the node hands the upload to a background thread pool and returns immediately with a "queued in background" status - so a slow upload doesn't stall your graph. Off, it blocks and returns Telegram's actual JSON response. Both outputs are the same: webp (the original, passed through untouched) and response (a STRING - the API body, or the queued message when backgrounded).
Install
Ships in Ye0l/ComfyUI-KSTR-Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/Ye0l/ComfyUI-KSTR-Nodes
or search "ComfyUI-KSTR-Nodes" in ComfyUI Manager. It needs requests (in the pack's requirements.txt; Manager installs it, a manual clone needs pip install -r requirements.txt), then restart.
Where people get burned
Three things. Empty bot_token or chat_id → it raises immediately, so fill both before you queue. The WEBP input is this pack's own type - it must come from the sibling Image to WEBP node, not a stock image. And remember what this node is: a small bit of arbitrary Python holding a credential and making network calls by design. The token is your bot's key, not your account's, but it's still a credential - don't paste a workflow containing it somewhere public. If you turn background_upload on, remember failures happen silently in the background (they're logged, not raised), so check your logs if a render never arrives.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| webp | WEBP | — | |
| bot_token | STRING | — | |
| chat_id | STRING | — | |
| caption | STRING | — | |
| send_as_document | BOOLEAN | true | — |
| timeout_seconds | INT | 601–600 | — |
| background_upload | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| webp | WEBP | — |
| response | STRING | — |