Skip to content

Send images, captions and text to Telegram channels and DM's from comfyui

License

Notifications You must be signed in to change notification settings

Phil9l/Comfyui-TelegramSender

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Sender for ComfyUI

This script is a custom node for ComfyUI that allows you to send images and text messages to a Telegram chat or channel using a Telegram bot.

Features

  • Send images generated by ComfyUI to a Telegram chat or channel
  • Send text messages with various formatting options (bold, italic, code, strikethrough, underline, spoiler)
  • Customize image format, compression level, and quality
  • Enable or disable notifications and content protection

Requirements

  • Python 3.x
  • requests library
  • ComfyUI

Installation

  1. Make sure you have Python 3.x installed on your system.

  2. Install the required requests library by running the following command:

pip install requests

  1. Clone or download this repository to your local machine.

  2. Copy the telegram_sender.py script to the custom_nodes directory of your ComfyUI installation.

Usage

  1. Create a new Telegram bot by talking to the BotFather on Telegram. Follow the prompts to set a name and username for your bot, and obtain the bot token.

  2. In ComfyUI, add the "Telegram Sender" node to your workflow.

  3. Configure the node with the following inputs:

  • chat_id: The ID of the Telegram chat or channel where you want to send the messages.
  • bot_token: The token of your Telegram bot.
  • enable_image: Enable or disable sending images (default: True).
  • enable_text: Enable or disable sending text messages (default: False).
  • text: The text message to send (only applicable if enable_text is True).
  • bold, italic, code, strikethrough, underline, spoiler: Formatting options for the text message.
  • disable_notification: Enable or disable notifications for the messages (default: False).
  • protect_content: Enable or disable content protection for the messages (default: False).
  • image_format: The format of the image to send (default: PNG).
  • png_compress_level, jpeg_quality, webp_lossless, webp_quality: Image compression and quality settings.
  1. Connect the output of an image node to the "images" input of the Telegram Sender node.

  2. Run the workflow. The generated images and/or text messages will be sent to the specified Telegram chat or channel.

License

This script is released under the MIT License.

Acknowledgements

Special thanks to the developers and contributors of ComfyUI and the crew at Banodoco discord! This script was developed with the assistance of the AI language model Claude Opus by Anthropic.

Support

If you encounter any issues or have questions regarding this script, please open an issue on the GitHub repository.

About

Send images, captions and text to Telegram channels and DM's from comfyui

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%