Display your AI-generated images and videos directly in VRChat with automatic updates from ComfyUI!
Note
VR headsets are NOT required to use VRChat or this asset! VRChat can be played in "Desktop Mode" on any PC, and mobile support is coming soon.
ComfyUI-VRChat-Assets provides a seamless pipeline to:
- Automatically fetch and display images from GitHub repositories in VRChat
- Stream videos directly from Discord CDN URLs to VRChat video players
- Support for both Unity Video Player and AVPro Video Player
- Maintain unique identifiers between different uploads
- Handle error recovery and automatic updates
Tip
Perfect for creating dynamic galleries and video players that automatically update with your latest AI creations!
- Automatically fetch images from GitHub repositories
- Support for various image formats (PNG, JPEG, WebP)
- Customizable display options
- Automatic error recovery and retries
- Support for image captions
- Runtime caching for improved performance
- Configurable update intervals
- Batch loading support for multiple images
- Stream videos directly from Discord CDN and other sources
- Support for both Unity Video Player and AVPro Video Player
- Configurable playback settings
- Automatic recovery from video playback errors
- Integration with VRCUrlInputField for manual control
- Playlist functionality with automatic advancement
- Built-in diagnostics and troubleshooting
- Automatic checking for new content
- Support for Markdown-formatted URL lists
- Configurable update intervals
- Built-in error handling for network issues
- Caption extraction for improved user experience
This package is designed to work seamlessly with ComfyUI-DiscordSend to create a pipeline from AI generation to VRChat display:
- Generate content in ComfyUI
- Use ComfyUI-DiscordSend to send images/videos to Discord and save CDN URLs to GitHub
- Configure these URLs in ComfyUI-VRChat-Assets components and publish your VRChat world
Important
VRChat worlds cannot dynamically fetch new URLs after publishing!
Due to VRChat's security model, all URLs must be pre-defined in Unity before publishing your world. The workflow is:
- Generate and update your GitHub URL list using ComfyUI-DiscordSend
- In Unity, use the editor tools to fetch these URLs and generate VRCUrl objects
- Publish your VRChat world with these pre-defined URLs
- To add new content, you must repeat this process and republish your world
The only exception is streaming via AVPro Video Player to a specific URL that you've already defined, but this requires careful setup and may have limitations.
To use this complete workflow, you need to:
- Install ComfyUI-DiscordSend in your ComfyUI setup
- Configure Discord webhooks to send images/videos
- Enable the GitHub CDN URL saving feature in ComfyUI-DiscordSend
- Unity 2022.3.22f1
- VRChat SDK3 for Worlds
- UdonSharp 1.0 or newer
- VRChat account with at least "New User" trust rank to publish worlds
Note
To publish your own VRChat worlds, you need a VRChat account that has reached at least "New User" trust rank. For more information on VRChat's trust system, see the official VRChat documentation.
The VRChat Creator Companion (VCC) provides the easiest way to set up your VRChat development environment:
-
Download and Install the VCC
- Get the Creator Companion from the official VRChat documentation
- Follow the installation instructions provided on the website
-
Create a New VRChat World Project
- Launch the Creator Companion
- Click "New Project" and select a world template
- Configure your project settings and click "Create Project"
- This will automatically set up a Unity project with all required VRChat SDKs and dependencies
-
Install Required Packages
- In the Creator Companion, select your project
- Go to the "Manage Project" tab
- Ensure "World SDK" is installed
- Add UdonSharp from the "Community Packages" section
-
Import ComfyUI-VRChat-Assets
- Once your VRChat project is set up through the Creator Companion, proceed with importing this package as described below
Using the Creator Companion simplifies the setup process by handling Unity version management, SDK installation, and package dependencies for you.
For your convenience, this package includes ready-to-use prefabs:
- Image Display Prefab - For displaying images from GitHub repositories
- Unity Video Player Prefab - For playing videos using the Unity Video Player
- AVPro Video Player Prefab - For playing videos using the AVPro Video Player
To use these prefabs:
-
Import the Package
-
Drag and Drop the Prefab
-
Configure the GitHub URL
-
Generate Predefined URLs
-
Adjust Settings as Needed
- Configure update intervals, playback options, and other settings based on your preferences
That's it! Your prefab is now configured to automatically fetch and display content from your GitHub repository.
If you prefer to set up components manually:
-
Set Up Image Display
a. Create a new GameObject in your scene
b. Add the
ImageLoadercomponentc. Configure GitHub URL and update settings
d. Add Raw Image components as children for display
-
Set Up Video Player
a. Create a new GameObject in your scene
b. Add either a VRC Unity Video Player or AVPro Video Player
c. Add the
VideoURLProvidercomponentd. Configure GitHub URL for the CDN list
-
Configure Update Intervals
a. Set appropriate update intervals based on your world's usage
b. For public worlds, consider longer intervals (300+ seconds)
c. For private worlds, shorter intervals (60-120 seconds) are suitable
Note
While the ComfyUI-DiscordSend plugin automatically creates properly formatted Markdown files with Discord CDN links, this component can work with any valid URL source, not just Discord CDNs. You can manually create Markdown files with URLs from any image/video hosting service.
Create a Markdown file in your GitHub repository with image URLs in any of these formats:
# Image Gallery
1. https://example.com/image1.png
2. https://example.com/image2.jpg
3. Title: https://example.com/image3.webpCreate a Markdown file with video URLs:
# Video Playlist
1. My Cool Video: https://cdn.discordapp.com/attachments/123456789/video1.mp4
2. Awesome Creation: https://cdn.discordapp.com/attachments/123456789/video2.mp4For working examples of CDN URL formatting and organization, check out my example repository: ComfyUI-CDN-Link-Examples - This repository demonstrates proper formatting of CDN URLs for image and video casting to VRChat.
ComfyUI-VRChat-Assets is designed to work seamlessly with the GitHub CDN URL lists generated by ComfyUI-DiscordSend. Here's how to set up the complete workflow:
In your ComfyUI workflow:
- Add either the
DiscordSendSaveImageorDiscordSendSaveVideonode - Enable the following options:
send_to_discord: Set to Truesave_cdn_urls: Set to Truegithub_cdn_update: Set to Truegithub_repo: Set to your repository in format "username/repo"github_token: Set to your personal access tokengithub_file_path: Set to the path for your URLs file (e.g., "image_urls.md" or "video_urls.md")
- Go to GitHub β Settings β Developer settings β Personal access tokens β Tokens Classic
- Click "Generate new token"
- Set an appropriate expiration date
- Select Public_Repo
- Scroll down to generate and copy the token to use in ComfyUI-DiscordSend
- Create a new repository or use an existing one
- You don't need to manually create the URL list file; ComfyUI-DiscordSend will create it automatically
- For better organization, you can create separate files for images and videos:
image_urls.mdfor imagesvideo_urls.mdfor videos
ComfyUI-DiscordSend includes several security measures for GitHub tokens:
- Tokens are hidden from logs
- Tokens are removed from workflow JSON files before sharing
- Tokens are protected in error messages and tracebacks
Warning
Always treat GitHub tokens as sensitive information:
- Never share your token in public forums or Discord
- Set an appropriate expiration date for your token
- Use repository-specific access when possible
- Regularly rotate your tokens for better security
- Monitor your token usage in GitHub settings
ComfyUI-DiscordSend will automatically update your GitHub repository with URLs in this format:
# Discord CDN URLs - Last Updated: YYYY-MM-DD HH:MM:SS
## Images/Videos:
1. 2023-09-01_14-30-45_MyImage.png: https://cdn.discordapp.com/attachments/123456789/image.png
2. 2023-09-01_15-45-30_MyVideo.mp4: https://cdn.discordapp.com/attachments/123456789/video.mp4This format is perfectly compatible with ComfyUI-VRChat-Assets' URL parsing system.
- Set the
GitHub Raw URLto your Markdown file's raw URL - Click
Fetch URLs from GitHubto test your configuration - Click
Auto-Generate Predefined URLsto populate the URL list - Configure update intervals and display settings
- Assign your video player (Unity or AVPro)
- Set the
GitHub Raw URLto your video list's raw URL - Configure playback settings
- Click
Fetch URLs from GitHubto test your configuration - Click
Auto-Generate Predefined URLsto populate the URL list
To get the raw URL for your GitHub markdown file:
- Navigate to your file in GitHub repository
- Click the "Raw" button
- Copy the URL from your browser address bar
- The URL should look like:
https://raw.githubusercontent.com/username/repo/branch/path/to/file.md
The components provide several public methods for control:
NextVideo()- Advance to the next videoPreviousVideo()- Go to the previous videoCheckForNewUrls()- Manually check for updatesClearOlderUrls()- Clear the runtime cache
| Option | Description |
|---|---|
| GitHub Settings | |
githubRawUrlString |
Raw URL to the GitHub Markdown file |
checkIntervalSeconds |
How often to check for updates (in seconds) |
maxImagesToKeep |
Maximum number of images to keep in memory |
| Display Settings | |
defaultCaption |
Default caption for images without specific captions |
newestImagesFirst |
Show newest images first |
liveUpdateMode |
Automatically cycle through new images |
| Error Handling | |
retryCount |
Number of retry attempts for failed downloads |
retryDelay |
Delay between retry attempts (in seconds) |
| Option | Description |
|---|---|
| Video Player References | |
unityVideoPlayer |
Reference to the VRCUnityVideoPlayer |
avproVideoPlayer |
Reference to the VRCAVProVideoPlayer |
urlInputField |
Optional VRCUrlInputField for manual control |
| GitHub CDN List Settings | |
githubRawUrlString |
Raw URL to the GitHub Markdown file |
checkIntervalSeconds |
How often to check for updates (in seconds) |
maxVideosToKeep |
Maximum number of videos in the playlist |
defaultCaption |
Default caption for videos without specific captions |
| Playback Settings | |
retryCount |
Number of retry attempts for failed playback |
retryDelay |
Delay between retry attempts (in seconds) |
maxVideoPlaytime |
Maximum time to play a video before advancing (in seconds) |
enforceMaxPlaytime |
Whether to enforce the maximum playtime |
autoAdvance |
Automatically advance to the next video when current one ends |
- Check GitHub URL: Ensure your raw GitHub URL is correct and accessible
- Verify Image URLs: Make sure image URLs in your Markdown file are direct links to images
- Check Update Interval: If set too high, updates may appear delayed
- Increase Retry Count: For unreliable networks, increase the retry count
- Check Video Format: VRChat best supports H.264 MP4 videos
- Check Video Size: Keep videos under 100MB for reliable playback
- Check CDN URL: Ensure video URLs are direct links to videos
- Use AVPro Player: For better compatibility, use the AVPro Video Player
- Verify Network Access: Ensure the video CDN is accessible to VRChat
Important
Discord CDN URLs are not permanent and may expire!
- Standard attachments in Discord channels typically remain accessible for a long period (months to years)
- However, Discord does not guarantee permanent availability of these URLs
- For more reliable long-term storage, consider using a dedicated image/video hosting service
- Schedule regular updates of your content to ensure continued availability
- Consider implementing a rotation system where older content is replaced with newer content
- URL Count: VRChat has limits on the number of VRCUrl objects that can be used in a single world
- Memory Usage: Loading many high-resolution images or videos can consume significant memory
- Network Bandwidth: VRChat may throttle bandwidth for video streaming in busy instances
- Video Formats: Only certain video formats are supported (H.264 MP4 is most reliable)
- Video Resolution: Maximum supported resolution is typically 1080p for reliable playback
- Instance Rejoin: When users rejoin an instance, they may need to wait for content to reload
- Quest Compatibility: Quest users face stricter limitations on video playback capabilities
- Texture Size: VRChat has maximum texture size limitations (typically 4096Γ4096)
- Check Video Format: Ensure videos are in a compatible format
- Increase Retry Count: Set a higher retry count for playback
- Check Video Playtime: Ensure max playtime is set appropriately
- Disable Auto Advance: If videos are cutting short, try disabling auto advance
- Token Permissions: Ensure your GitHub token has "Contents" write access
- Repository Access: Verify the token has access to the specified repository
- File Path: Check that the file path is valid (no leading slash needed)
- URL Format: The raw GitHub URL should start with
https://raw.githubusercontent.com/ - Rate Limits: Be aware of GitHub API rate limits for token requests
Tip
For more in-depth information about VRChat world creation and troubleshooting, consult the official VRChat Creators Documentation.
If you have specific questions about this asset or need help with setup, please join our Discord community where we provide support and share tips for getting the most out of ComfyUI-VRChat-Assets.
Both components include built-in diagnostic methods:
-
Video URL Provider:
DiagnosePlaylistIssues()- Outputs detailed diagnostic information to the debug consoleDebugShowPlaylist()- Shows the current playlist in the debug console
-
Image Loader:
- Runtime console logging for troubleshooting download issues
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
Please follow the standard GitHub flow for contributions.
- VRChat team for the SDK and platform
- UdonSharp developers for making VRChat world scripting accessible
- ComfyUI team for the amazing AI image generation platform
- All contributors and users who provide feedback
- YouTube: AEmotionStudio
- GitHub: AEmotionStudio
- Discord: Join our community - Get help with setup and share your creations!
- Website: aemotionstudio.org
If you find ComfyUI-VRChat-Assets useful, consider supporting its development:
Your support helps me dedicate more time to maintaining and improving this project and others with new features, bug fixes, and better documentation.
- β Star the repository
- π’ Share it with others
- π οΈ Contribute to its development
- πΈ Share creations made with this tool
For business inquiries or professional support, please contact me through my website or join my Discord server.















