ComfyUI Node

💬 Auto-MSG-Telegram-Bot

The Telegram-bot node that pings your phone

By xlinx·Created 2 years ago·Updated 2 years ago· 9
💬 Auto-MSG-Telegram-Bot
  • trigger_any_type
  • trigger_append_image
  • output-original-input
  • output-original-input-IMAGE
  • 🌀output-text-LINE
  • 🌀output-text-Telegram
  • 🌀output-text-Discord
enable_im_telegram
msg_png_info_enabled
msg_pos_prompt_enabled
msg_neg_prompt_enabled
im_telegram_token_botidxxxxxxxxxxxxxxxxxxxxxxxxxxx
im_telegram_token_chatid1967680189
im_telegram_msg_header[from-ComfyUI-telegram]

The name is the honest part. Wire Auto-MSG-Telegram-Bot into the end of a workflow and it posts your generated image - caption included - to a Telegram chat of your choosing. No cloud server, no webhook, no API key of your own: your ComfyUI instance is the sender, and Telegram does the rest.

This is one node out of xlinx's auto-messaging pack, from the Taiwanese dev behind the slightly more famous ComfyUI-decadetw-auto-prompt-llm. The pack's whole pitch is "check your results at the gym" - kick off a 40-image batch, walk away, and let the render come to you instead of the other way around. If that's your life, this is the node you reach for.

How it works

When the node runs, it converts the incoming IMAGE tensor to a PNG, then POSTs it to Telegram's sendPhoto endpoint using your bot token. It also appends ▣prompt: plus a JSON dump of the workflow's prompt (truncated to 500 characters) to the message caption, so the text you get tells you what was actually generated.

The pack is one shared core function wearing four hats - Telegram, LINE, Discord, and "all of the above." This node just exposes only the Telegram fields in the UI and keeps the others off.

The inputs that matter

Only a handful are worth your attention:

  • im_telegram_token_botid - the bot token from @BotFather
  • im_telegram_token_chatid - your chat ID, found via the getUpdates API
  • enable_im_telegram - the on/off switch
  • trigger_append_image (optional IMAGE) - the image to send; feed it your VAE-decoded output
  • trigger_any_type (optional, any type) - a pass-through so you can inline the node without breaking your graph
  • im_telegram_msg_header - the caption above the image

About those three msg_png_info_enabled / msg_pos_prompt_enabled / msg_neg_prompt_enabled booleans: in the code as shipped, they're accepted but never actually branch anything. The prompt gets appended regardless. Don't lose sleep over which combination you pick.

Outputs are the pass-throughs (output-original-input, output-original-input-IMAGE) plus three STRING outputs - one per service. The 🌀output-text-Telegram one holds the API's JSON response, and that's your entire debugging story, so wire it to a text/console node.

Getting the token and chat ID

Follow the README and it's a ten-minute job:

  1. Message @BotFather, run /newbot, pick a name and a username ending in _bot, and copy the token it gives you.
  2. Add your new bot as a friend.
  3. Hit https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates and read chat.id from the JSON - that number goes in im_telegram_token_chatid.

Install

ComfyUI Manager: search "ComfyUI-decadetw-auto-messaging-realtime". Or the manual way:

cd ComfyUI/custom_nodes
git clone https://github.com/xlinx/ComfyUI-decadetw-auto-messaging-realtime

Restart ComfyUI. There's no requirements.txt and nothing to download - the pack only leans on requests and Pillow, both of which ship with ComfyUI already.

Common issues

  • No message arrives? Read the 🌀output-text-Telegram output. Telegram returns "ok": true on success, or a clear error like 400 chat not found. That output tells you whether it's a bad token, a bad chat ID, or a network problem.
  • "Caption too long" text message: the code truncates captions to 800 characters and then sends the full text as a separate message. Intentional, not a bug.
  • You shared a workflow and your bot got hijacked: the token is a plaintext widget in the workflow JSON. Scrub it before sharing - that's the classic way people get their Telegram bots taken over. Custom nodes also run arbitrary Python with full access to your machine, so only install packs you trust.
Category🧩 Auto-Msg-Realtime

Inputs (9)

NameTypeDefaultDescription
enable_im_telegramCOMBO2 options: true, false
msg_png_info_enabledCOMBO2 options: true, false
msg_pos_prompt_enabledCOMBO2 options: true, false
msg_neg_prompt_enabledCOMBO2 options: true, false
im_telegram_token_botidSTRINGxxxxxxxxxxxxxxxxxxxxxxxxxxx
im_telegram_token_chatidSTRING1967680189
im_telegram_msg_headerSTRING[from-ComfyUI-telegram]
trigger_any_typeopt*
trigger_append_imageoptIMAGE

Outputs (5)

NameTypeDescription
output-original-input*
output-original-input-IMAGEIMAGE
🌀output-text-LINESTRING
🌀output-text-TelegramSTRING
🌀output-text-DiscordSTRING