Telegram Serving
Your ComfyUI workflow as a Telegram bot, no server required
- Serving config
TelegramServing is the pack's answer to the question "my friends don't use Discord, can they still use my bot?" Yes - this node plugs your whole ComfyUI workflow into a Telegram bot, so anyone in an allowed chat can type /generate a sleepy cat in a teacup and get a PNG back, generated on your machine, from your workflow. It's the same trick as DiscordServing but aimed at the people who never left Telegram. It's one of the newer entry points in the pack (Telegram support landed in late 2024), and it's been the pack's most-searched node on comfy.icu, so you're not alone in wanting this.
The workflow is exactly the same shape as every other serving node in this toolkit: TelegramServing sits at the start, spits out a Serving config, and that config gets wired into a handful of input nodes (text, image, number) and at least one output node that sends the result back. The bot polls Telegram in a background thread, waits for a message that looks like a command, and hands the parsed arguments to your graph.
The command syntax is the pack's universal one: /generate <your prompt> --argument <value>. The free text becomes the prompt argument; anything after -- is split into named arguments. Set command_name-style routing with a CommandPickerServing node if you want multiple commands (/generate, /help, /upscale) pointing at different branches of the graph.
The inputs that matter:
telegram_token- your bot token from @BotFather. This is the only thing you genuinely must get right. No Discord-style message-content intent to enable; Telegram just works with the token.allowed_chat_ids- the whitelist of chat IDs allowed to use the bot. Leave it empty and anyone who finds the bot can generate. The check is a plain string membership test, so put each ID on its own line; if one chat ID is a substring of another you'll get surprised by who's allowed in.
The output is a single Serving config (SERVING_CONFIG) - feed it into ServingInputText, ServingInputImage, ServingOutput, and friends. Attach a photo to your command and the caption is treated as the command text, with the photo exposed as attachment_url_0, so image-to-image works out of the box via ServingInputImage or ServingInputImageAsLatent.
Install the usual pack way - ComfyUI Manager, search "Serving Toolkit", or:
cd ComfyUI/custom_nodes
git clone https://github.com/matan1905/ComfyUI-Serving-Toolkit
cd ComfyUI-Serving-Toolkit
pip install -r requirements.txt
That pulls in pyTelegramBotAPI, discord.py, websocket-client, rel, and opencv-python - opencv is the chunky one, and it's needed by the image-handling nodes regardless of which entry point you use. There are no model downloads; the node only serves whatever models your existing workflow already loads.
Two things trip people up. First, the node blocks waiting for a message, so you must enable Auto Queue on the workflow or the graph runs once and dies - the README's "Running" section is explicit that the bot only stays up while ComfyUI keeps re-queuing. Second, polling is single-threaded: one TelegramServing node per workflow, and the token has to be live at load time. If you see the workflow execute and return nothing, check that Auto Queue is on and that the token is actually valid before blaming the node.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| telegram_token | STRING | — | |
| allowed_chat_idsopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Serving config | SERVING_CONFIG | — |