CivArchive
    Telegram bot in ComfyUI - Telegram Bot V2
    NSFW

    ◀️ A fully autonomous functioning bot for Telegram made completely inside a single ComfyUI workflow without any 3rd party software and complicated server setups. Simply copy your bot_token, hit Run and that's it! Share your bot with friends on Telegram so they can generate something using ComfyUI, running on your computer!

    🔥🔥🔥 VERSION 2 IS OUT! 🔥🔥🔥

    TLDR: Completely overhauled bot logic and custom nodes used. All of the previous shortcomings and issues were addressed and fixed! Massively improved latency and robustness, as well as compatibility. Added new commands and features, including video generation via Minimax H3.

    Now it is a fully fledged and optimized All-in-One bot workflow/framework with multiple features and functionalities that include:

    • Unified message receiver: the bot can now receive all of the main media types – text, image, audio and video! (current workflow version only utilizes text and image inputs)

    • Smart message handler: the bot accepts different commands that change its state, enabling turn-based operation.

    • Different generators: text2image (Krea-2), image edit (Flux2 Klein), LLM chat with TTS voiceover (Omnivoice), text2video, image2video and reference2video (Minimax H3). For the purpose of using image-requiring functions, the bot can accept an uploaded image or automatically use previously generated one.

    • Independent persistent cache of chat data for every user: saved image (for image-requiring functions), generation parameters set by the user (chosen aspect ratio, video duration and workflow state are saved in special config files) and LLM chat history. All of this data is saved independently for different users that interact with the bot (based on their ChatID), thus, excluding any possibility of potential data sharing between them.

    • Multiple users can interact with the bot at the same time without any errors or bugs. Though the bot cannot answer while generating something, so the messages are queued.

    • Blacklist/whitelist access modes: allows you to set the access mode for your bot and specify ChatIDs that can or can’t interact with it.

    Of course, you can expand upon those features if you figure out the workflow structure. I added some notes inside the workflow to explain how it works.

    To summarize, this workflow was designed as a general modular framework for building a multi-purpose bot that allows two-way communication between ComfyUI and Telegram through HTTP calls (Long Polling). And because the bot is entirely contained in ComfyUI, it allows to use the platform’s full functionality and limitless potential. If you can find good custom node packs for other apps like Discord, you can probably make a similar bot for them as well. Just swap the receiver and sender nodes.

    ⚡️ Ok, so how do you actually set up the bot and use the workflow?

    1. Download this V2 workflow, install missing custom nodes using Manager and download required models (diffusion models, text encoders, VAE, etc.).

    2. Create a new bot using @BotFather and get your bot's unique HTTP API token (just google it if you are not sure how to do that). The token should look like this:
      0123456789:AbCdEfGhIjKlMnOpQrStUvWxYz0AbCdEfGh

    3. Inside the workflow copy the bot token into the dedicated text node (purple, on the top-left), which is connected to all Telegram nodes.

    4. Finally, change the workflow queue mode from simple "Run" to "Run (Instant)". Now run the workflow and the bot should work for you and everyone you share it with! (ignore any "missing input" errors, they don't block the workflow from running)

    ⚙️ Required custom nodes:

    All of the required custom nodes can be easily installed through the Manager (“Install missing custom nodes” button). Previous Telegram packs I used in V1 and V1.1 (kept both workflows as legacy) were lacking features and optimization. So, I decided to make a new improved unified pack myself:

    https://github.com/CoolBreeze164/ComfyUI-Autonomous-Telegram-Bot

    Additionally, I made another pack of utility nodes that were designed specifically to support this new bot workflow:

    https://github.com/CoolBreeze164/ComfyUI-CoolB-Nodes

    Both of these packs are required for V2 workflow. Other required packs include:

    https://github.com/rgthree/rgthree-comfy
    https://github.com/kijai/ComfyUI-KJNodes
    https://github.com/yolain/ComfyUI-Easy-Use (⚠️make sure to update this one if you already have it, otherwise “Inversed Switch” nodes will produce errors)
    https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite
    https://github.com/PlagueKind/ComfyUI-PlagueKind-Nodes
    https://github.com/huwhitememes/comfyui-krea2-conditioning
    https://github.com/kantan-kanto/ComfyUI-LLM-Session (if getting errors with LLM node try downgrading to version 1.4.0)
    https://github.com/Saganaki22/ComfyUI-OmniVoice-TTS (⚠️requires transformers>=5.3.0; if link is missing, try downloading manually from https://registry.comfy.org/nodes/ComfyUI-omnivoice-tts)
    https://github.com/pytraveler/MiniMax-H3-Prompt-Rewriter-ComfyUI
    https://github.com/Larryvrh/ComfyUI-MiniMax-H3-Turbo (custom sampler and turbo LoRA loader)

    🛠️ Compatibility:

    • V2 workflow is tested on Portable ComfyUI 0.37.0 and updated custom node packs. Python version 3.12.7; PyTorch version 2.14.0+cu130; 16GB VRAM; 64 GB RAM. If you have low memory hardware, use low-bit quants of the models (int4, nvfp4 or ggufs).

    • The LLM voiceover uses OmniVoice TTS, which requires transformers>=5.3.0. If you have a prior version (4.x), installation of this pack will attempt to upgrade several dependencies, including torch, which will BRICK your ComfyUI. Though this TTS is one of the best for voiceover of long texts atm, you can swap it for different one that works for you. Aside from that, other custom nodes have low requirements and will probably run on any ComfyUI build.

    📂 Models used:

    ⚠️ If Telegram is banned in your country:

    Because the bot uses ComfyUI for HTTP calls, it does not connect to your installed Telegram app in any way and thus, cannot utilize its custom built-in protocols like MTProto or SOCKS for connection with Telegram servers. This means that if Telegram is blocked in your country, the bot will not be able to call the server. To bypass these restrictions, I recommend using Cloudflare's WARP (https://one.one.one.one/) (Traffic and DNS (UDP) or Traffic and DNS (HTTPS) modes) or a VPN.

    📝 Other useful stuff and tips:

    1) How to set up command menu inside the bot chat (like in the demo above):

    Click on your bot above the chat window → Manage → Edit Commands → after choosing "Edit Commands", send the command list to @BotFather:

    start - Bot info
    image_from_text - T2I: generate an image
    image_edit - Edit saved image
    talk - Send a message to Donald Trump
    video_from_text - T2V: generate a video
    video_from_image - I2V: video starts from saved image
    video_from_reference - Ref2V: video uses saved image as reference

    2) If you want to manually check your API connection to the bot, you can paste the following link (with your bot token ofc) into the url bar of the browser:

    https://api.telegram.org/bot[BOT_TOKEN]/getUpdates

    This should open a page with a simple text string like this:

    {"ok":true,"result":[]}

    If instead the page isn't loading at all, then ComfyUI would not be able to receive any messages from the bot or send output back. This is due to either Telegram being blocked in your country, or Telegram bot servers are temporarily offline.

    3) Where is chat data stored?

    All of the cached data is stored inside this subfolder:
    \ComfyUI\output\telegram_bot\

    • \ComfyUI\output\telegram_bot\images\ – saved images.  

    • \ComfyUI\output\telegram_bot\configs\ – user configs.

    • \ComfyUI\output\telegram_bot\llm_history\ – LLM talk history.

    • \ComfyUI\output\telegram_bot\videos\ – generated videos are stored indefinitely.

    The name of each of those files corresponds to the ChatID of the user that interacted with the bot.

    Description

    Completely overhauled bot logic and custom nodes used. All of the previous shortcomings and issues were addressed and fixed! Massively improved latency and robustness, as well as compatibility. Added new commands and features, including video generation via Minimax H3.

    Now it is a fully fledged and optimized All-in-One bot workflow/framework with multiple features and functionalities that include:

    • Unified message receiver: the bot can now receive all of the main media types – text, image, audio and video! (current workflow version only utilizes text and image inputs)

    • Smart message handler: the bot accepts different commands that change its state, enabling turn-based operation.

    • Different generators: text2image (Krea-2), image edit (Flux2 Klein), LLM chat with TTS voiceover (Omnivoice), text2video, image2video and reference2video (Minimax H3). For the purpose of using image-requiring functions, the bot can accept an uploaded image or automatically use previously generated one.

    • Independent persistent cache of chat data for every user: saved image (for image-requiring functions), generation parameters set by the user (chosen aspect ratio, video duration and workflow state are saved in special config files) and LLM chat history. All of this data is saved independently for different users that interact with the bot (based on their ChatID), thus, excluding any possibility of potential data sharing between them.

    • Multiple users can interact with the bot at the same time without any errors or bugs. Though the bot cannot answer while generating something, so the messages are queued.

    • Blacklist/whitelist access modes: allows you to set the access mode for your bot and specify ChatIDs that can or can’t interact with it.

    FAQ

    Workflows
    MiniMax H3

    Details

    Downloads
    69
    Platform
    CivitAI
    Platform Status
    Available
    Created
    10/3/2026
    Updated
    10/8/2026
    Deleted
    -

    Files

    telegramBotInComfyui_telegramBotV2_3268416.zip

    telegramBotInComfyui_telegramBotV2_3268411.zip