Nodes/ComfyUI-DiscordWebhookWithInput/Use Discord Webhook (+message input)
ComfyUI Node

Use Discord Webhook (+message input)

Ship your ComfyUI renders to Discord without leaking your webhook URL

By maxmad62·Created 11 months ago·Updated 11 months ago· 0
Use Discord Webhook (+message input)
  • image
  • IMAGE
message
send_Messagefalse
send_Imagetrue
prepend_message

You've got a workflow that grinds for minutes, and you want the result to land in a Discord channel the second it finishes - either for yourself, or so a friend can watch your progress. Discord webhook nodes have been around since Dayuppy's original in 2024, and they're a nice little quality-of-life ending for any graph. The catch: the original stored your webhook URL inside the node, which means it got baked into the workflow JSON and shipped in every PNG you shared. In a community where "workflow included" is the norm, that's how you hand strangers a token that can post to your channel forever.

This fork from maxmad62 fixes exactly that, and adds the one feature the original refused to build: a connectable text input. That's the whole story of Use Discord Webhook (+message input) - Discord delivery that doesn't leak your URL and can speak your actual prompt.

How it works

Two nodes work as a pair. Set Discord Webhook takes the URL once, validates it starts with https://discord.com/api/webhooks/, and writes it to a local secrets/webhook.txt file inside the pack's folder. From then on, Use Discord Webhook (+message input) reads it on every run - and never stores it in the workflow or PNG metadata, because it's not even in the graph. Resolution order is: the DISCORD_WEBHOOK_URL environment variable first, then the secrets file, then a deprecated discord_webhook_url.txt. If all three are empty you get a clear "Missing Discord webhook URL" error rather than a silent no-op.

Under the hood it's the discord-webhook Python library. Your image tensor gets converted to a PNG in a temp folder; if the file would exceed Discord's 20 MB cap it's halved in resolution and recompressed. Batches of images are split into messages of four files each (Discord allows ten, the author plays it safe at four). Messages are hard-truncated at 2000 characters, Discord's limit.

The inputs that matter

The info_schema is refreshingly small:

  • image (required) - plug your final render here.
  • message (required, multiline) - this is the improvement over the original. Wire your positive prompt, seed, or any string in. send_Message defaults to off, so toggle it if you want the text to actually post.
  • send_Image (default on) - flip it off for text-only posts.
  • prepend_message - an optional prefix, handy for a fixed label like "New render from the server:" ahead of your dynamic prompt.

The single output is your IMAGE passed straight through, which makes this a clean terminal node - it sits at the end of the graph and everything before it just flows.

Installing it

ComfyUI Manager: search "DiscordWebhookWithInput" and hit install. Manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/maxmad62/ComfyUI-DiscordWebhookWithInput.git

Then restart ComfyUI. The one real gotcha: the repo ships no requirements.txt, so Manager may not pull the dependency for you. The code needs discord-webhook, and if it's missing you'll get a ModuleNotFoundError on startup. Fix it with:

pip install discord-webhook
# portable Windows install:
python_embeded\python.exe -m pip install discord-webhook

Where people get burned

Mostly by setup order: you must set the webhook (or create secrets/webhook.txt) before the first run, or the node throws the missing-URL error. Don't be tempted to hardcode the URL into the message node to get around it - that reintroduces the leak this whole pack exists to prevent. And remember that in this ecosystem, every custom node runs arbitrary Python with your user account, so only install packs you can skim; this one is small enough to read in a minute, and it only talks to Discord's API, nowhere else.

CategoryDiscord

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
messageSTRING
send_MessageoptBOOLEANfalse
send_ImageoptBOOLEANtrue
prepend_messageoptSTRING

Outputs (1)

NameTypeDescription
IMAGEIMAGE