Preview Image (with Discord option)
Get your ComfyUI gens into a Discord channel — webhook in, zero bots
- images
- passthrough_image
- image
You finish a batch, the preview pops up, and now you want it in your Discord channel before you've even screenshotted it. That's what Preview Image (with Discord option) is for: ComfyUI's usual preview/save behavior with a webhook strapped to it. It shows your image like normal, and if you flip one boolean it also posts it to a Discord channel you own. No bot, no API key, no account - just a webhook URL in a config file.
The whole pack is this one node, and it's small: MIT-licensed, a solo project (gmorks) shipped as a single class in a single Python file. It won't change your life, but if you generate into a shared server - a collab channel, a "dailies" feed for a team, your own phone for checking gens away from the desk - it's the least-configured way to get there. The design decision that actually matters: the webhook URL lives in config.ini, not in the workflow. Other Discord nodes tend to want the URL as an input, which means it gets baked into every workflow JSON you save and share. Here it stays on disk where it belongs.
How it works
Feed it an image (or a batch) and it does what a SaveImage does: writes the PNG into ComfyUI's temp folder with the prompt and workflow metadata embedded, then shows it in the UI. If send_to_discord is on and a webhook is configured, it POSTs the file to Discord's webhook endpoint. The interesting parts happen at the edge:
- Compression. If a file is bigger than
max_file_size_mb(8 MB by default), it's re-encoded as WebP atcompression_quality(80). That strips the embedded workflow metadata - the node knows, and compensates by attaching the workflow JSON as a second file in the same message. Slightly clunky, but it means the sender never silently loses your workflow. - Batch mode. With
batch_modeon, images queue up and flush together at 5 images (or at the end of the run). Discord caps a message at roughly 25 MB of attachments, so batches over that trigger the fallback: individual sends, one by one. It's a solid, boring safety net, and you can flipenable_fallbackoff if you'd rather have it fail loudly. - The output. It's an output node (
OUTPUT_NODE), so it can terminate a workflow - but it also returnsimage. Connectpassthrough_imageand it returns that instead, letting you park the node mid-chain: send a copy to Discord, keep the real output flowing to your SaveImage or upscaler.
Inputs that matter
Three required, and honestly only one you'll touch:
images- your IMAGE tensor, straight out of a VAE Decode.send_to_discord- the whole point. Defaults tofalse; flip it to send.batch_mode- on for grouped sends, off to fire each image as it's produced.
passthrough_image is the optional one for mid-chain wiring. The single output is image, an IMAGE.
Install
Through ComfyUI Manager - search "ComfyUI-SendToDiscord" - or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/gmorks/ComfyUI-SendToDiscord
cd ComfyUI-SendToDiscord
pip install -r requirements.txt
Then the step that trips everyone: copy config.ini.example to config.ini and paste in your webhook URL (Server Settings → Integrations → Webhooks → New Webhook). The README calls the template config.ini.template, but the repo actually ships config.ini.example - either way, that file is the only thing between you and a working node. Dependencies are the lightest possible: Pillow, requests, numpy. No model files, nothing to download.
Where people get burned
- Nothing posts and you swear it's broken. If
config.inidoesn't exist, the webhook URL is empty and the node silently skips sending - no error, no console scream. Check that file exists before debugging anything else. - "Where did my workflow metadata go?" That's the WebP compression doing its job. Set
enable_compression = falseif you want the workflow-in-PNG preserved, or just grab the JSON file it attaches. - The URL is a key. Anyone holding it can post to that channel as the webhook. It lives outside the workflow for exactly this reason - keep it that way, and don't commit it to a repo.
On a failed send you'll see a ❌ status in the console with HTTP details; the usual causes are a mistyped webhook URL or a file so big that even compression couldn't get it under Discord's ~25 MB cap.
For a niche utility it's refreshingly self-contained. Grab a webhook, set the boolean, and your gens start showing up in the channel without you thinking about it.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| send_to_discord | BOOLEAN | false | — |
| batch_mode | BOOLEAN | false | — |
| passthrough_imageopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |