π€ Send to Telegram
Send Every Generation to Telegram β Metadata and All
- images
- images
The main event of this pack
π€ Send to Telegram is the node this whole pack exists for. Drop it at the end of a graph - after VAE Decode, or anywhere an IMAGE flows - and every image that reaches it gets pushed to a Telegram chat or channel by a bot you control. It's the ComfyUI half of Sergey004's sd_telegram_sender project, reworked from an AUTOMATIC1111 extension into a node you place explicitly.
Why reach for it: if you run long batches, remote generations, or a headless box, polling the browser to check results is misery. This puts each finished image in your pocket the moment it's done, with the generation parameters attached. It's also the practical version of the "workflow lives in the file" culture that runs through this ecosystem - every PNG it sends carries metadata a Civitai uploader can auto-read.
How it works
For each image in the batch: it converts the tensor to a PIL image, walks your workflow via hidden prompt/extra_pnginfo inputs to pull the seed, steps, CFG, sampler, scheduler, model, and LoRAs, and saves a PNG to ComfyUI/output with that info embedded as an AUTOMATIC1111-style parameters text chunk plus the ComfyUI prompt JSON. Then it picks a destination chat, resizes if needed, and uploads through Telegram's bot API (api.telegram.org/bot<TOKEN>/sendPhoto or sendDocument) in a background thread with retries. Sending is async - a semaphore caps two concurrent uploads so it doesn't stall your queue - and the node returns the images untouched, so you can keep a SaveImage after it.
Telegram's limits drive the behavior. Photos over 10MB get progressively JPEG-compressed until they fit; landscape images resize to landscape_max_width (default 5120px) and portrait/square ones to max_size (2560px). Want the true original? send_as_document uploads the PNG as a file instead of a photo, skipping Telegram's recompression.
The inputs that matter
Most of these are optional, and you can ignore most of them on day one:
- images (required) - wire your final VAE Decode output here.
- chat_id - leave empty to fall back on the default from Settings.
- positive_prompt / negative_prompt - wire these from CLIP Text Encode; they're what lands in the PNG metadata.
- send_as_document - true sends the original PNG as a file. Use it when you'll re-upload to Civitai or archive.
- enable_nsfw_detection + nsfw_channel_id - scans the positive prompt against a bundled keyword list (and "nsfw" itself) and reroutes to a separate channel. Negative-prompt mentions are ignored, so "nude" in your negative won't trigger it.
- enable_lora_routing (default on) - matches LoRAs used in your workflow against the mapping in Settings and sends to the matching channel by partial match (
anime_style_v2.safetensorsmatches keyanime). - retry_count / retry_delay, max_size / landscape_max_width, filename_prefix (a template like
telegram_%date%_%model%_%seed%), and bot_token_override for a per-node token.
The output is images - the same IMAGE you fed in - so you can keep chaining nodes after it.
The routing-order gotcha
The README says an explicit chat_id should win, but the code actually checks LoRA routing first, then NSFW, then your chat_id/default, then the unsorted channel. Practically: if you type a chat_id but a LoRA mapping matches your workflow, the routed channel wins. If you want the manual chat_id to stick, flip enable_lora_routing off.
Metadata: the part worth caring about
The saved PNG carries a parameters block in A1111 format - Steps: 20, Sampler: euler, CFG scale: 7, Seed: 123456, Model: ..., Lora: ... - which is exactly what Civitai's uploader auto-detects to link the model and LoRAs. Two honest caveats: if you send as a photo, Telegram re-encodes the image and strips that metadata on the copy you receive - the file in your chat is just pixels. For anything you might re-share or re-upload, send_as_document keeps the record intact. And as everywhere in this ecosystem, the PNG saved to ComfyUI/output is your master copy.
Installation
Via ComfyUI Manager: search ComfyUI-Telegram-Sender. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Sergey004/ComfyUI-Telegram-Sender
pip install requests pillow piexif
Restart ComfyUI. No model downloads. After install, configuration happens in Settings β Telegram Sender (token + default chat ID) - full walkthrough on the Telegram Config page.
Common issues
- "No bot token configured" - the token lives in Settings, not the workflow. Graceful failure, though: the node still saves images locally.
- "Chat not found" - channel IDs must start with
-100; the bot needs admin rights in the channel; for a personal chat, message the bot/startonce before first use. - Images not sending - check the console and your internet; bump
retry_count/retry_delay. Upload timeouts scale up to 10 minutes for large files. - The README's own warning: the pack says it "can be broken on latest versions." This is a small, one-maintainer project - when ComfyUI updates, check the repo for a fix.
- Startup surprise: on import the pack spawns a background thread that tries to fetch Civitai previews/info for your models. Harmless, and it fails silently if dependencies are missing, but it does mean network calls to civitai.com at launch.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | β | |
| chat_idopt | STRING | β | |
| bot_token_overrideopt | STRING | β | |
| positive_promptopt | STRING | β | |
| negative_promptopt | STRING | β | |
| send_as_documentopt | BOOLEAN | false | β |
| max_sizeopt | INT | 2560 | β |
| landscape_max_widthopt | INT | 5120 | β |
| enable_nsfw_detectionopt | BOOLEAN | false | β |
| nsfw_channel_idopt | STRING | β | |
| unsorted_channel_idopt | STRING | β | |
| enable_lora_routingopt | BOOLEAN | true | β |
| retry_countopt | INT | 3 | β |
| retry_delayopt | INT | 5 | β |
| enable_enhanced_metadataopt | BOOLEAN | true | β |
| filename_prefixopt | STRING | telegram_%date%_%model%_%seed% | β |
| subdirectory_nameopt | STRING | β | |
| debug_metadataopt | BOOLEAN | false | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | β |