Files
AEmotionStudio-ComfyUI-Disc…/README.md
T
2025-03-07 14:35:09 -08:00

9.5 KiB

ComfyUI-DiscordSend

Version ComfyUI License

Send your amazing AI-generated images and videos directly to Discord from ComfyUI!

ComfyUI-DiscordSend provides custom nodes for ComfyUI that allow you to seamlessly:

  • Save images and videos locally with advanced formatting options
  • Send images, videos, and workflows directly to Discord via webhooks
  • Include prompt information and metadata with your creations
  • Maintain unique identifiers between different users and uploads

Tip

Perfect for sharing your creations with communities, friends, or your own archive channels!

Example workflow

✨ Features

🖼️ Image Node: DiscordSendSaveImage

  • Save images in various formats (PNG, JPEG, WebP)
  • Send images directly to Discord via webhooks
  • Include workflow JSON for easy reproduction
  • Customizable Discord messages with prompt information
  • Advanced file naming with date, time, and dimension options
  • High-quality image export with configurable compression settings
  • Built-in preview functionality within ComfyUI interface
  • Batch grouping support (up to 9 images per Discord message)
  • Unique identifier support to prevent conflicts between users

🎬 Video Node: DiscordSendSaveVideo

  • Convert image sequences to videos in multiple formats
  • Support for GIF, MP4, WebM, and professional formats like ProRes
  • Configurable frame rates and quality settings
  • Add audio to your videos (when supported by format)
  • Special effects like ping-pong looping
  • Discord integration for sharing videos
  • Include workflow data and video information in messages
  • UUID support for distinguishing between multiple user uploads

📥 Installation

Option 1: Using ComfyUI Manager

  1. Install ComfyUI Manager if you don't have it already
  2. Open ComfyUI, go to the Manager tab
  3. Search for "ComfyUI-DiscordSend" and install

Option 2: Manual Installation

cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/AEmotionStudio/ComfyUI-DiscordSend
cd ComfyUI-DiscordSend
pip install -r requirements.txt  # Installs the minimal requirements (only the requests library)

Important

  • For video functionality, ffmpeg must be installed on your system. The node will automatically detect its presence.
  • This extension has minimal dependencies, requiring only the 'requests' library which is included in the requirements.txt file.

🚀 Usage

Discord Webhook Setup

  1. In Discord, go to your server settings → Integrations → Webhooks
  2. Create a New Webhook and copy the Webhook URL
  3. Paste this URL into the "webhook_url" field in the DiscordSend nodes

Warning

Security Recommendation: It is strongly recommended to only share access to your server webhook with trusted users. Creating individual webhook integrations per user makes it easier to identify which user is sending content to your Discord server. Using a single webhook for multiple users makes content moderation difficult as all uploads will appear under the same webhook identity.

Image Node

  1. Add the DiscordSendSaveImage node to your workflow
  2. Connect your image output to this node
  3. Configure saving and Discord options
  4. Run your workflow!

Batch Image Handling

When sending multiple images in a batch:

  • Up to 9 images can be grouped in a single Discord message
  • Enable group_batched_images to combine images from a batch
  • Batches larger than 9 images will be split into multiple messages
  • Each batch maintains the same workflow JSON if enabled

Video Node

  1. Add the DiscordSendSaveVideo node to your workflow
  2. Connect your image sequence to this node
  3. Set frame rate, format, and other video options
  4. Optionally connect audio
  5. Run your workflow to create and send videos!

Note

  • The video node does not display a preview in the ComfyUI interface, unlike the image node
  • For best Discord compatibility, keep videos under 8MB (or 50MB for servers with boosts)

📝 Configuration Options

DiscordSendSaveImage Options

Option Description
Required Parameters
images The images to save and/or send to Discord
filename_prefix Prefix for saved files (default: "ComfyUI-Image")
overwrite_last Enable to overwrite last image instead of incrementing filenames
File Options
file_format PNG, JPEG, or WebP
quality 1-100 for JPEG/WebP formats
lossless Use lossless compression when available
save_output Whether to save images to disk
show_preview Show preview in ComfyUI interface
Filename Options
add_date Add current date to filenames
add_time Add current time to filenames
add_dimensions Add width and height to filenames
resize_to_power_of_2 Resize to nearest power of 2 dimensions
resize_method Method for resizing (nearest, bilinear, etc.)
Discord Options
send_to_discord Enable Discord webhook integration
webhook_url Discord webhook URL
discord_message Text message to accompany images
include_prompts_in_message Include generation prompts in Discord message
include_format_in_message Include image format details in message
group_batched_images Group batch images into one Discord message (max 9 images)
send_workflow_json Send workflow JSON for reproducibility

DiscordSendSaveVideo Options

Option Description
Required Parameters
images Image sequence to convert to video
filename_prefix Prefix for saved files (default: "ComfyUI-Video")
overwrite_last Enable to overwrite last video instead of incrementing filenames
Video Options
format Various formats including GIF, MP4, WebM, ProRes
frame_rate Frames per second (1-120)
quality Quality setting for compression (1-100)
loop_count Number of loops for GIF (0=infinite)
lossless Use lossless compression when available
pingpong Create forward-backward looping effect
save_output Whether to save video to disk
audio Optional audio to embed in video
Filename Options
add_date Add current date to filenames
add_time Add current time to filenames (DO NOT DISABLE for Discord uploads - see known issues)
add_dimensions Add width and height to filenames
Discord Options
send_to_discord Enable Discord webhook integration
webhook_url Discord webhook URL
discord_message Text message to accompany videos
include_prompts_in_message Include generation prompts in Discord message
include_video_info Include video format details in message (disable if you don't want time/format info)
send_workflow_json Send workflow JSON for reproducibility

📋 Requirements

  • ComfyUI (latest version recommended)
  • Python 3.8+
  • Python dependencies: Only the 'requests' library (automatically installed via requirements.txt)
  • For video functionality: ffmpeg (system-level dependency)

❓ Troubleshooting

Warning

If Discord fails to receive your media, check:

  • File Size: Discord has upload limits (8MB for regular servers, 50MB for boosted servers)
  • Webhook URL: Ensure your webhook URL is valid and has not been regenerated

Discord Limitations

  • Video Processing: Discord reprocesses all uploaded videos to optimize for their platform. This means:

    • Original quality settings may be modified regardless of what you set
    • Videos may be compressed further even with high-quality settings
    • Some formats may be converted to different formats by Discord
    • Previews may not be available immediately after upload
    • Maximum resolution is limited (typically 1080p)
    • Maximum bitrate may be reduced based on server boost level
  • Image Limitations:

    • Maximum of 9 images per message/gallery
    • Images over 10MB may be refused

Troubleshooting

  1. Videos not playing in Discord

    • Try using more compatible formats like h264-MP4
    • Reduce quality settings to decrease file size
    • Make sure add_time is enabled
  2. "ffmpeg not found" warning

    • Install ffmpeg on your system and ensure it's in your PATH
    • Restart ComfyUI after installation
  3. Webhook errors

    • Verify webhook URL is correct and the channel still exists
    • Check Discord's status if all webhooks are failing
  4. UUID Support and Conflicts

    • Each upload includes a UUID to prevent conflicts between users
    • If you experience files overwriting each other, ensure multiple users aren't sharing the same output directory

Known Issues

  1. Critical: Do NOT disable add_time for videos sent to Discord
    • When the add_time option is disabled for videos being sent to Discord, they may appear as a single frame or static image
    • If you want to omit time information in Discord messages, disable include_video_info instead
    • This is a limitation of how Discord identifies and processes video files

🤝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest features
  • Submit pull requests

Please follow the standard GitHub flow for contributions.

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgements

  • ComfyUI team for the amazing platform
  • All contributors and users who provide feedback