ComfyUI Node

💬 Auto-MSG-Discord-Bot

The auto-messaging bot node

By xlinx·Created 2 years ago·Updated 2 years ago· 9
💬 Auto-MSG-Discord-Bot
  • trigger_any_type
  • trigger_append_image
  • output-original-input
  • output-original-input-IMAGE
  • 🌀output-text-LINE
  • 🌀output-text-Telegram
  • 🌀output-text-Discord
enable_im_discord
msg_png_info_enabled
msg_pos_prompt_enabled
msg_neg_prompt_enabled
im_discord_token_botidxxxxxxxxxxxxxxxxxxxxxxxxxxx
im_discord_token_chatid1274866471884816395
im_discord_msg_header[from-ComfyUI-discord]

If you already live in a Discord server, this is the node that makes ComfyUI post into it. Auto-MSG-Discord-Bot is one of the three single-channel senders in xlinx's auto-messaging pack - same shared core as the Telegram and LINE nodes, but aimed at Discord, which is also the fiddliest of the three to set up.

You'd reach for it when your finished renders should land somewhere other people (or another machine of yours) can see them - a shared channel for a client, a team, or just a channel that doubles as your render log. It's strictly send-only: the pack's two-way "command from your phone back to ComfyUI" feature was killed by the author over security concerns, so don't expect to control the queue from Discord.

How it works

When the node runs, it turns the incoming IMAGE tensor into a PNG and POSTs it to https://discord.com/api/v10/channels/<CHANNEL_ID>/messages with an Authorization: Bot <token> header, uploading the image as an attachment plus an embed. The prompt JSON (truncated to 500 characters) rides along in the message content.

One honest caveat from reading the source: the Discord sender also stuffs a message_reference with a hardcoded message ID into the payload, which is a little odd and is the kind of thing that can make this channel the first one to misbehave on stricter servers. When it does, the 🌀output-text-Discord output carries the API's error body - that's your debug line.

Getting the pieces (the whole setup)

The README walks through this and it's the longest of the three channels:

  1. Create a channel in your server.
  2. In Discord, Settings → Appearance → check Developer Mode.
  3. Right-click the channel name → Copy Channel ID → that's im_discord_token_chatid.
  4. In the Discord Developer Portal, create an app, add a Bot, and check the Message Content Intent.
  5. Copy the bot token → that's im_discord_token_botid.
  6. Under OAuth2 → Scopes, tick bot, grant the Send Messages permission, and use the generated invite URL to add the bot to your channel.

Flip enable_im_discord to true, feed trigger_append_image your VAE output, and the msg_* toggles are the same dead-but-harmless booleans the whole pack shares.

Install

ComfyUI Manager: search "ComfyUI-decadetw-auto-messaging-realtime". Or:

cd ComfyUI/custom_nodes
git clone https://github.com/xlinx/ComfyUI-decadetw-auto-messaging-realtime

Restart ComfyUI. No extra dependencies to install and nothing to download - the pack runs on requests and Pillow, both of which ship with ComfyUI.

Common issues

  • No post in the channel? Read the 🌀output-text-Discord output. A 403 usually means the bot isn't in that channel or lacks Send Messages; a 404 means the channel ID is wrong (or copied from the wrong server).
  • The bot posts to the wrong place: the chat ID is a channel ID, not your user ID. Copy it from the actual channel.
  • Your bot token is a plaintext widget in the workflow JSON - scrub it before sharing a workflow anywhere, since anyone with it can post to your server. And remember, custom nodes are arbitrary code running with full user access, so only install packs you trust.
Category🧩 Auto-Msg-Realtime

Inputs (9)

NameTypeDefaultDescription
enable_im_discordCOMBO2 options: true, false
msg_png_info_enabledCOMBO2 options: true, false
msg_pos_prompt_enabledCOMBO2 options: true, false
msg_neg_prompt_enabledCOMBO2 options: true, false
im_discord_token_botidSTRINGxxxxxxxxxxxxxxxxxxxxxxxxxxx
im_discord_token_chatidSTRING1274866471884816395
im_discord_msg_headerSTRING[from-ComfyUI-discord]
trigger_any_typeopt*
trigger_append_imageoptIMAGE

Outputs (5)

NameTypeDescription
output-original-input*
output-original-input-IMAGEIMAGE
🌀output-text-LINESTRING
🌀output-text-TelegramSTRING
🌀output-text-DiscordSTRING