An open API service indexing awesome lists of open source software.

https://github.com/daxcay/comfyui-tg

Comfy UI in Telegram
https://github.com/daxcay/comfyui-tg

comfyui comfyui-nodes comfyui-workflow telegram-bot telegram-chat

Last synced: 6 months ago
JSON representation

Comfy UI in Telegram

Awesome Lists containing this project

README

          






ComfyUI in Telegram


Report Bug
·
Request Feature






# About The Project

This project enables the use of ComfyUI Workflows in Telegram.


> [!IMPORTANT]
> This node works on **Bot** provided by **Telegram** so if you want to change Bot register New bot using **BotFather** and change **BOT_TOKEN** in `telegram.json`

> [!IMPORTANT]
> Supports group chat. add bot to a group and any user can give commands of that group.


# Installation

- ### Installing Using `comfy-cli`
- `comfy node registry-install ComfyUI-TG`
- https://registry.comfy.org/publishers/daxcay/nodes/comfyui-tg

- ### Manual Method
- Go to your `ComfyUI\custom_nodes` and Run CMD.
- Copy and paste this command: `git clone https://github.com/daxcay/ComfyUI-TG.git`

- ### Automatic Method with [Comfy Manager](https://github.com/ltdrdata/ComfyUI-Manager)
- Inside ComfyUI > Click the Manager Button on the side.
- Click `Custom Nodes Manager` and search for `ComfyUI-TG`, then install this node.

- ### Node Installation
- For someone facing automated node installation error or is not on windows os.
- Install lateset version of node js.
- https://nodejs.org/en/download/package-manager

> [!CAUTION]
> Update to nodejs version v20.17.0 if you already have it. https://nodejs.org/dist/v20.17.0/node-v20.17.0-x64.msi





>[!IMPORTANT]
> #### **Restart ComfyUI and Stop ComfyUI before proceeding to next step**


# Setup

## Enable Dev Mode

>[!IMPORTANT]
> #### **Enable dev mode and save workflow in `api` format to make it compatible.**

![download (1)](https://github.com/user-attachments/assets/15d6fda5-86af-4514-9884-32e7bb4cde84)


### Getting bot token from BotFather

![Untitled design (6)](https://github.com/user-attachments/assets/ea381db3-4d28-4535-9c87-490ff2af9df4)

### Location of Telegram folder

#### ComfyUI Folder
- `Drive:/ComfyUI_windows_portable/Telegram`

#### Stable Matrix
- **Full Version**: `Drive:/StabilityMatrix/Packages/ComfyUI/Telegram`
- **Portable Version**: `Drive:/StabilityMatrix/Data/Packages/ComfyUI/Telegram`

From `ComfyUI/Telegram` folder open `telegram.json`

![image](https://github.com/user-attachments/assets/a30ca344-d07a-48a2-8f65-39b3a564d83b)

> [!IMPORTANT]
> Fill `BOT_TOKEN` and save it.

>[!IMPORTANT]
> #### **Start ComfyUI before proceeding to next step**


## Uploading WorkFlow

To upload a workflow to be used in in telegram use the `workflow` button in telegram dashboard.

>[!IMPORTANT]
> #### **Attach `TG-ImageSaver` Node before saving the workflow in api format**

![image](https://github.com/user-attachments/assets/2ae18c4b-dd0d-4385-b404-0c4c09a08e5a)

Now upload it in workflow section

![image](https://github.com/user-attachments/assets/d0cae95f-3dea-42d5-9948-69093486ab52)


# Telegram Commands

Writing **/c** or **/start** will also provide the list of all commands:

![image](https://github.com/user-attachments/assets/e1eae84a-e0f2-41a8-9389-144eb5afd8bd)

- Write **/wfs** to get a numbered list of uploaded workflows.

![image](https://github.com/user-attachments/assets/4227503e-df68-4692-8c10-d5fd2ace5754)

- Write **/wf id** to select the workflow.

![image](https://github.com/user-attachments/assets/d5c63d1c-98e1-422f-8986-e38dc86f6986)

- Write **/wns** to get numbered list of selected workflow nodes.

![image](https://github.com/user-attachments/assets/04577a8d-53a2-41f2-ab8f-92c409598ef0)

- Write **/wn id** to get numbered list of inputs available.

![image](https://github.com/user-attachments/assets/85b19d92-39ee-48c9-965d-27ffaed24b1d)

- Write **/s node_id input_id value** to set value for input selected.

![image](https://github.com/user-attachments/assets/e3e6de3f-792a-4b1c-8696-5ed4540a4c3f)

- Sending Image to Load Image

https://github.com/user-attachments/assets/e3b1d267-11b6-46b8-8a80-8d2c4b9512c5

- find node id of load image you want.
- find input id of load image node (0 most of time could be other if using custom node )
- attach image and in caption write `/s 25 0` and send like this
- Once uploaded you can use it like `/s 25 0 {file}` as it reside in `Comfy/Input` folder.


- Write **/sce** enable auto ksampler seed change.

![image](https://github.com/user-attachments/assets/5792d046-ceb6-4923-aae9-bb3c9f7d83ff)

- Write **/scd** disable auto ksampler seed change.

![image](https://github.com/user-attachments/assets/f2e8209e-1dd7-4f3e-bd3d-fc30916789f5)

- Write **/q** to queue.

![image](https://github.com/user-attachments/assets/1fcd1e64-eb2b-4216-b958-b6ff820397f5)

- Write **/r** to reset all to default settings.

![image](https://github.com/user-attachments/assets/e615e2f1-cd4b-4f42-9572-e2f684542ff9)

- Write **/i** to interrupt queue.

![image](https://github.com/user-attachments/assets/d9710b51-c7b5-4750-8c96-47a3e040dacc)


# Contact

### Daxton Caylor - ComfyUI Node Developer

- ### Contact
- **Email** - daxtoncaylor+Github@gmail.com
- **Discord Server**: https://discord.gg/UyGkJycvyW

- ### Support
- **Patreon**: https://patreon.com/daxtoncaylor
- **Buy me a coffee**: https://buymeacoffee.com/daxtoncaylor


# Disclaimer

This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Telegram or any of its subsidiaries or its affiliates. The official Telegram website can be found at https://telegram.org/. "Telegram" as well as related names, marks, emblems and images are registered trademarks of their respective owners.

I have used `NodeJS` and 'Python` combined to make this project the library, I am using the following library in nodejs to enable telegram functionality.

https://github.com/yagop/node-telegram-bot-api