TG_ImageSaver
The Node That Actually Puts Your Images in Telegram
- Images
You don't run TG_ImageSaver to save a file. You run it so a Telegram bot can hand you the picture on your phone. It's the output end of ComfyUI-TG, Daxton Caylor's little pack that turns a running ComfyUI into a Telegram bot - the whole "queue from chat, get results in chat" trick - and this is the node that makes results exist anywhere the bot can find them. The rest of the pack is plumbing; this is the payoff.
Here's the full loop, because it explains everything about the node. You send /q in the chat, the Node.js bot rewrites the workflow's Path input to a per-user folder, POSTs it to your ComfyUI API, then polls /history/{prompt_id} every second. The moment the job completes, it finds the TG_ImageSaver node in the output, reads the image paths it reported, and sends each one as a photo. So TG_ImageSaver is basically the bot's return value - the graph can't finish without it, and the bot won't know anything was generated if it's missing.
How it works
Mechanically it's a stripped-down SaveImage with a twist. It takes the IMAGE tensor, moves it to CPU, multiplies by 255, and saves each frame as a PNG - embedding the full workflow as PNG metadata along the way, so your images stay reproducible the way ComfyUI culture expects. Compression is fixed at level 4, there's no filename field, and that's deliberate: files are named 0001.png, 0002.png⦠zero-padded counters based on how many files are already in the target folder (it counts recursively). In the bot flow you never see these - the bot saves per user under ComfyUI/Telegram/output/<your_id> - so the anonymous names don't matter. If you're using it outside the bot, though, the naming is the thing that'll annoy you. No prompts in filenames, no timestamps, just counters. For your own archive, the stock SaveImage with a filename function is the better tool.
The inputs that matter
It's an output node, so there are no outputs - just two required inputs:
- Images - the IMAGE tensor. Wire this from your VAE Decode (or whatever produces images in your graph).
- Path - a plain string. In bot mode the
/qcommand overwrites this for you, so you can leave anything there. Standalone, type an absolute filesystem path; the folder is created if it doesn't exist.
That's the whole surface. About as simple as a ComfyUI node gets.
Installing the pack
TG_ImageSaver only ships inside ComfyUI-TG, so you install the pack: ComfyUI Manager β search "ComfyUI-TG", or
cd ComfyUI/custom_nodes
git clone https://github.com/daxcay/ComfyUI-TG.git
Then restart ComfyUI. The real dependency isn't Python - requirements.txt is empty - it's Node.js. On Windows the pack downloads and installs Node v20.11.1 itself (an MSI straight from nodejs.org, so it's official, but you should know your machine is running an installer at startup). On Linux/Mac you have to install Node yourself first, or the bot simply never starts. After that: create a bot with BotFather, drop the token into ComfyUI/Telegram/telegram.json, and enable dev mode before saving your workflow in API format - with TG_ImageSaver attached, per the README.
Where people get burned
- Non-Windows + no Node.js - the pack prints a warning and gives up. Nothing breaks loudly, you just get no bot.
- "Workflow failed/interrupted to generate result" from the bot usually means the queue actually errored, or you uploaded a workflow without TG_ImageSaver in it, so there's nothing to read back.
- Standalone path mistakes - it's an absolute path; a relative one lands somewhere you won't find it. And remember it counts existing files, so a full folder means your next image continues at a higher number, not restarts.
It's a niche tool for a niche workflow, and honestly as a general-purpose saver it's outclassed. But for "text the bot, get art back in your pocket," it's the one node in the graph that matters.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| Images | IMAGE | β | |
| Path | STRING | β |
Outputs (0)
No outputs