diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..011bc3d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [1.1.0] - 2026-01-10 + +### Added +- **Image Node**: `DiscordSendSaveImage` for saving and sending images with advanced formatting. +- **Video Node**: `DiscordSendSaveVideo` for converting image sequences to video (GIF, MP4, WebM, ProRes). +- **GitHub Integration**: Automatically archive Discord CDN URLs to a GitHub repository. +- **Testing**: Added initial test suite. +- **Logging**: Implemented structured logging for better debugging. diff --git a/README.md b/README.md index 68ccf2a..5423f56 100644 --- a/README.md +++ b/README.md @@ -1,56 +1,96 @@ # ComfyUI-DiscordSend -![Version](https://img.shields.io/badge/version-1.1.0-blue.svg) -![ComfyUI](https://img.shields.io/badge/ComfyUI-compatible-green) -![License](https://img.shields.io/badge/license-GPL--3.0-brightgreen.svg) - -**Send your 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 -- Archive Discord CDN URLs to GitHub repositories for easy access - -> [!TIP] -> Perfect for sharing your creations with communities, friends, or your own archive channels! +![ComfyUI](https://img.shields.io/badge/ComfyUI-Extension-green?style=for-the-badge) +![Version](https://img.shields.io/badge/Version-1.1.0-orange?style=for-the-badge) +![License](https://img.shields.io/badge/License-GPLv3-red?style=for-the-badge) +![Dependencies](https://img.shields.io/badge/dependencies-none-brightgreen?style=for-the-badge&color=blue) +![Downloads](https://img.shields.io/badge/dynamic/json?color=blueviolet&label=Downloads&query=downloads.smart_count&url=https://raw.githubusercontent.com/AEmotionStudio/ComfyUI-DiscordSend/refs/heads/badges/traffic_stats.json&style=for-the-badge&logo=github) +![Visitors](https://img.shields.io/badge/dynamic/json?color=blue&label=Visitors&query=views.uniques&url=https://raw.githubusercontent.com/AEmotionStudio/ComfyUI-DiscordSend/refs/heads/badges/traffic_stats.json&style=for-the-badge&logo=github) +![Clones](https://img.shields.io/badge/dynamic/json?color=success&label=Clones&query=clones.uniques&url=https://raw.githubusercontent.com/AEmotionStudio/ComfyUI-DiscordSend/refs/heads/badges/traffic_stats.json&style=for-the-badge&logo=github) +![Last Commit](https://img.shields.io/github/last-commit/AEmotionStudio/ComfyUI-DiscordSend?style=for-the-badge&label=Last%20Update&color=orange) +![Activity](https://img.shields.io/github/commit-activity/m/AEmotionStudio/ComfyUI-DiscordSend?style=for-the-badge&label=Activity&color=yellow) ![Example workflow](/images/nodes_example_3.png) +**Send your AI-generated images and videos directly to Discord from ComfyUI!** + +[Features](#-features) • [Installation](#-installation) • [Settings](#-settings) • [Technical Details](#-technical-details) • [Contributing](#-contributing) • [Changelog](#-changelog) + +--- + +## What's New in v1.1.0 (January 10, 2026) + +### 🚀 Core Updates +- **Structured Logging**: Implemented comprehensive logging for better debugging and stability. +- **Testing Suite**: Added initial test framework to ensure reliability. +- **Enhanced Stability**: Various improvements to image and video handling logic. + +📄 See [CHANGELOG.md](CHANGELOG.md) for the complete version history. + +--- + ## ✨ Features -### 🖼️ Image Node: `DiscordSendSaveImage` + + + + + +
+

🖼️ 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
  • +
+
+ Image Node +
-- 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 + +

🎬 Video Node: DiscordSendSaveVideo

+
    +
  • Convert image sequences to videos in multiple formats
  • +
  • Support for GIF, MP4, WebM, and professional formats like ProRes
  • +
  • Configurable frame rates from 0.1 to 120 fps
  • +
  • Extra-slow frame rates for photo slideshows
  • +
  • Add audio to your videos
  • +
  • Special effects like ping-pong looping
  • +
  • Discord integration for sharing videos
  • +
  • Include workflow data and video information in messages
  • +
+
-### 🎬 Video Node: `DiscordSendSaveVideo` - -- Convert image sequences to videos in multiple formats -- Support for GIF, MP4, WebM, and professional formats like ProRes -- Configurable frame rates from 0.1 to 120 fps (slow-motion to time-lapse) -- Extra-slow frame rates below 1 fps for photo slideshows (e.g., 0.5 fps = 2 seconds per image) -- 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 - -### 🔄 GitHub Integration - -- Save Discord CDN URLs to a GitHub repository -- Automatically update existing URL collections with new uploads -- Formatted markdown files with timestamps and organized links -- Perfect for building media galleries or documentation -- Comprehensive security measures for GitHub tokens + + + + + +
+

🔄 GitHub Integration

+
    +
  • Save Discord CDN URLs to a GitHub repository
  • +
  • Automatically update existing URL collections with new uploads
  • +
  • Formatted markdown files with timestamps and organized links
  • +
  • Perfect for building media galleries or documentation
  • +
  • Comprehensive security measures for GitHub tokens
  • +
+
+ GitHub Integration +
## 📥 Installation @@ -73,7 +113,7 @@ pip install -r requirements.txt # Installs the minimal requirements (only the r > - 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 +## ⚙️ Settings ### Discord Webhook Setup @@ -93,95 +133,8 @@ pip install -r requirements.txt # Installs the minimal requirements (only the r ![Configure webhook in node](/images/discord_webhook_step4.png) -#### Webhook Auto-Sanitization - -ComfyUI-DiscordSend includes an automatic webhook sanitization feature that: -- Strips out sensitive parts of the webhook URL when displaying in logs -- Automatically converts various Discord webhook URL formats to the standard format -- Supports Discord webhook URLs from different domains (discord.com, discordapp.com) -- Validates webhook URLs before sending to help prevent errors -- Preserves the webhook token internally for actual API calls while hiding it from exposure -- Removes webhook URLs from workflow JSON files before they're sent to Discord -- Sanitizes image metadata to prevent webhook URLs from being embedded in saved images -- Filters webhook URLs from Discord messages to prevent accidental token sharing -- Ensures that webhook URLs are never exposed through any generated content, so long as you are using these nodes to save and not other save nodes in combination (as other save nodes will not sanitize the webhook url when saving alongside this one). - -This comprehensive sanitization helps protect your Discord server's webhook tokens from accidental exposure in logs, screenshots, saved files, or shared content while making it easier to use any webhook URL format. - -> [!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. - -### GitHub Integration Setup - -The GitHub integration allows you to automatically save Discord CDN URLs to a GitHub repository. - -1. Create a personal access token with `public_repo` permissions on GitHub -2. Configure the GitHub options in the node: - - `github_cdn_update`: Enable to activate GitHub integration - - `github_repo`: Your repository in format `username/repo` - - `github_token`: Your personal access token - - `github_file_path`: Path to the file in repository (default: `cdn_urls.md`) - -> [!NOTE] -> GitHub tokens are secured with the same comprehensive sanitization as webhook URLs. Tokens are: -> - Hidden from logs with [REDACTED_TOKEN] -> - Removed from workflow JSON files before sharing -> - Sanitized from image metadata -> - Protected in error messages and tracebacks - -### 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! - -#### Creating Photo Slideshows - -You can now create slideshow videos from still images: -- Use frame rates below 1 to make each image stay longer on screen -- Example: 0.5 fps = 2 seconds per image -- Example: 0.25 fps = 4 seconds per image -- Example: 0.1 fps = 10 seconds per image -- Perfect for creating galleries and presentations from your images - -> [!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) - -### 📱 Discord Message Preview - -Here's how your images and videos will appear in Discord when sent using ComfyUI-DiscordSend: - -![Discord message formatting](/images/discord_formatting.png) - -The node formats messages with: -- Optional custom message text -- Generation prompts when enabled -- Technical details about the media -- Professional presentation with markdown formatting -- Attached workflow JSON file when enabled -- Image galleries for batch uploads (up to 9 images per message) - -## 📝 Configuration Options - -### DiscordSendSaveImage Options +
+🖼️ Image Node Options (Click to Expand) | Option | Description | |--------|-------------| @@ -216,7 +169,10 @@ The node formats messages with: | `github_token` | GitHub personal access token (with repo permissions) | | `github_file_path` | Path to file in repository to update (default: "cdn_urls.md") | -### DiscordSendSaveVideo Options +
+ +
+🎬 Video Node Options (Click to Expand) | Option | Description | |--------|-------------| @@ -251,103 +207,60 @@ The node formats messages with: | `github_token` | GitHub personal access token (with repo permissions) | | `github_file_path` | Path to file in repository to update (default: "cdn_urls.md") | -## 📋 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) +## 🔧 Technical Details -## ❓ 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 +| Component | Description | +|-----------|-------------| +| **Video Processing** | Discord reprocesses all uploaded videos. Quality settings may be modified, and videos compressed. | +| **Max Resolution** | Typically limited to 1080p by Discord. | +| **Max Bitrate** | Reduced based on server boost level. | +| **Image Limit** | Max 9 images per message/gallery. Images >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 +1. **Videos not playing in Discord**: Try h264-MP4 format, reduce quality, enable `add_time`. +2. **"ffmpeg not found"**: Install system ffmpeg and restart ComfyUI. +3. **Webhook errors**: Verify URL validity and channel existence. +4. **UUID Conflicts**: Ensure unique output directories for multiple users. +5. **GitHub Issues**: Check token permissions (`public_repo`) and repo access. -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 - -5. **GitHub Integration Issues** - - Verify your token has proper permissions (needs 'public_repo' scope) - - Ensure the repository exists and you have write access - - Check that the file path is valid and doesn't conflict with existing directories - -### 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 +> [!WARNING] +> **Critical Issue**: Do NOT disable `add_time` for videos sent to Discord. They may appear as a single frame due to Discord's processing. Disable `include_video_info` instead if you want to hide details. ## 🤝 Contributing -Contributions are welcome! Feel free to: -- Report bugs -- Suggest features -- Submit pull requests +Contributions are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to get started. Whether it's bug reports, feature suggestions, or pull requests, your help is appreciated. -Please follow the standard GitHub flow for contributions. - -## 🙏 Acknowledgements - -- ComfyUI team for the amazing platform -- All contributors and users who provide feedback - -## 🔗 Connect with me - -- YouTube: [AEmotionStudio](https://www.youtube.com/@aemotionstudio/videos) -- GitHub: [AEmotionStudio](https://github.com/AEmotionStudio) -- Discord: [Join our community](https://discord.gg/UzC9353mfp) -- Website: [aemotionstudio.org](https://aemotionstudio.org/) - -## ☕ Support - -If you find ComfyUI-DiscordSend useful, consider supporting its development: - -[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/aemotionstudio) - -Your support helps me dedicate more time to maintaining and improving this project and others with new features, bug fixes, and better documentation. - -### 💖 Additional Ways to Support - -- ⭐ Star the repository -- 📢 Share it with others -- 🛠️ Contribute to its development - -For business inquiries or professional support, please contact me through my [website](https://aemotionstudio.org/) or join my [Discord server](https://discord.gg/UzC9353mfp). +1. Fork the Project +2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) +3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) +4. Push to the Branch (`git push origin feature/AmazingFeature`) +5. Open a Pull Request ## 📜 License -This project is licensed under the GPL-3.0 License - see the LICENSE file for details. +This project is licensed under the [GPL-3.0 License](LICENSE.md) - see the LICENSE file for details. + +--- + +
+
+

Developed by Æmotion Studio

+ + + YouTube + + + Discord + + + Ko-fi + + +
+
+ +

Happy Creating! 🎨

+