Nodes/ComfyUI-KSTR-Nodes/Send WEBP to Telegram
ComfyUI Node

Send WEBP to Telegram

Your Render, Straight to a Telegram Chat

By Ye0l·Created 2 months ago·Updated about a month ago· 0
Send WEBP to Telegram
  • webp
  • webp
  • response
bot_token
chat_id
caption
send_as_documenttrue
timeout_seconds60
background_uploadtrue

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.

CategoryYeol/Network

Inputs (7)

NameTypeDefaultDescription
webpWEBP
bot_tokenSTRING
chat_idSTRING
captionSTRING
send_as_documentBOOLEANtrue
timeout_secondsINT601–600
background_uploadBOOLEANtrue

Outputs (2)

NameTypeDescription
webpWEBP
responseSTRING