Nodes/comfyui_tg_notification/Telegram Notification Bot
ComfyUI Node

Telegram Notification Bot

Get a ping on your phone when ComfyUI finishes — via a bot you already trust

By Vkabuto23·Created 6 months ago·Updated 6 months ago· 0
Telegram Notification Bot
  • image
    bot_token
    chat_id
    textComfyUI notification!

    The waiting is the worst part of ComfyUI. You queue up a 20-minute upscale or a long video render, and now you're staring at a progress bar like it owes you money. This node is the fix: a tiny Telegram bot that pings your phone - message and optionally the image - the moment your run finishes. No VRAM, no model files, no cloud credits. Just a few lines of Python that do one job well.

    Telegram Notification Bot lives in the notifications category, and it's an output node in the truest sense: it produces no outputs and just does a thing at the end of your graph. That's the plumbing layer of ComfyUI - the nodes that touch no pixels but make a workflow usable - and it shines precisely when you're not watching the screen: long renders, or ComfyUI running headless on a box in the corner.

    How it works

    Despite the "API" vibes, the name is a slight lie - there's no external image service, no inference call, no key to a model vendor. It makes two plain HTTP POSTs to Telegram's public bot API. If you've wired an image in, it takes the first tensor in the batch, converts it to a PIL image, PNG-encodes it in memory, and sends it via sendPhoto with your text as the caption. No image connected? It just calls sendMessage. That's the whole mechanism.

    One thing worth knowing before it surprises you: it only sends the first frame of a batch. Generate four images and the batch arrives as one IMAGE tensor - this node grabs image[0] and sends just that one. It's not a bug, it's a deliberate "keep it simple" choice.

    The inputs that matter

    There are only three real ones, plus an optional image:

    • bot_token - the token from your Telegram bot.
    • chat_id - the ID of the chat to send to.
    • text - the message (defaults to ComfyUI notification!, which you will almost certainly change to something like the model name).
    • image (optional) - wire any IMAGE output here to send it as a photo.

    There are no outputs. It's a terminal node - it ends a branch and returns nothing to the graph.

    Setting up the bot

    The setup is the same for every Telegram-notification node, and the README spells it out: make a bot with @BotFather (/newbot, grab the token), then get your chat ID via @userinfobot or similar. The classic trap that burns everyone once: a bot can't message you until you've started a conversation with it. Open a chat with your new bot and press Start, or the send will silently fail.

    Installing it

    Standard custom-node fare - via ComfyUI Manager (search for comfyui_tg_notification) or manually:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/Vkabuto23/comfyui_tg_notification.git
    

    Then restart ComfyUI. There's no requirements.txt in the repo, which sounds alarming until you notice the deps - requests, Pillow, numpy, torch - are all things ComfyUI already ships in its own environment. It just works out of the box. Nothing to download, no models, nothing to babysit.

    Troubleshooting, honestly

    The gotcha that will actually bite you: this node fails quietly in the UI. It never raises - it catches everything and prints Telegram Notification Error: ... to the server console. If your phone stays silent, don't stare at the canvas; check the terminal where ComfyUI is running. A wrong token or chat ID shows up as an HTTP error in that console, not as a red node on your graph.

    The other thing worth knowing is a privacy take, not a bug: the bot token lives in your workflow, and ComfyUI embeds the whole workflow in every PNG you save. Share that render and you've just published your bot token. The saving grace - and why Telegram is genuinely a fine place for this - is that a bot token is scoped to one bot, and you can revoke it any time from BotFather. It's not your main credential; treat it as a revocable doorbell.

    That's also why the one safety habit from this ecosystem applies: a custom node that carries a credential and phones home by design is the shape of the thing that got weaponized once (the LLMVISION incident). The counterweight here is that the whole pack is open source and short enough to read in a minute - do that before you paste a token into anything.

    It's a thin node, and the genre is thin. But for two strings and a wire, it turns "babysit the render" into "get told when it's done." Worth the two minutes of BotFather setup for long jobs and headless boxes.

    Categorynotifications

    Inputs (4)

    NameTypeDefaultDescription
    bot_tokenSTRING
    chat_idSTRING
    textSTRINGComfyUI notification!
    imageoptIMAGE

    Outputs (0)

    No outputs