ComfyUI Extension: ComfyUI-MediaURLLoader
Custom nodes for loading and previewing media from URLs in ComfyUI.
Custom Nodes (0)
README
ComfyUI-MediaUtilities
Custom nodes for loading and previewing media from URLs in ComfyUI.
Features
- Load Audio From URL: Download and load audio files from the internet
- Preview Audio: Play downloaded audio in the ComfyUI interface
- Load Video From URL: Download and extract frames from videos on the internet
- Preview Video: Play extracted video frames in the ComfyUI interface
- Save Audio: Save audio data to file in various formats
- Save Video: Save video frames to file with optional audio
Installation
Manual Installation
- Clone this repository into your ComfyUI custom_nodes directory:
cd ComfyUI/custom_nodes
git clone https://github.com/your-username/ComfyUI-MediaUtilities.git
- Install the required dependencies:
cd ComfyUI-MediaUtilities
pip install -r requirements.txt
- Restart ComfyUI
Usage
Load Audio From URL
This node allows you to load audio files directly from a URL.
Inputs:
url
: URL to the audio file (.mp3, .wav, .flac, .ogg, .m4a)
Outputs:
AUDIO
: Audio data that can be used with other ComfyUI audio nodes
Preview Audio
This node creates an audio player in the UI to preview audio data.
Inputs:
audio
: Audio data from an audio loader node
Load Video From URL
This node allows you to load video files directly from a URL and extract frames.
Inputs:
url
: URL to the video file (.mp4, .webm, .mkv, .mov, .avi)force_rate
: Force a specific frame rate (0 to use original)force_size
: Resize video to specific dimensionscustom_width
: Width for custom resizingcustom_height
: Height for custom resizingframe_load_cap
: Maximum number of frames to loadskip_first_frames
: Number of frames to skip from the beginningselect_every_nth
: Select every nth frame
Outputs:
FRAMES
: Extracted video framesframe_count
: Number of extracted framesaudio
: Audio track extracted from the videovideo_info
: Video metadata (fps, duration, etc.)
Preview Video
This node creates a video player in the UI to preview extracted frames.
Inputs:
frames
: Frames from a video loader nodefps
: Playback frame ratevideo_info
: Video metadata
Save Audio
This node saves audio data to a file in various formats.
Inputs:
audio
: Audio data to savefilename_prefix
: Base name for the output fileformat
: Output format (mp3, wav, flac, ogg)sample_rate
: Output sample ratenormalize
: Whether to normalize audio levels
Save Video
This node saves video frames to a file with optional audio.
Inputs:
frames
: Video frames to savefps
: Frame rate for the output videofilename_prefix
: Base name for the output fileformat
: Output format (mp4, webm, avi, mov, gif)codec
: Video codec to usequality
: Video quality (1-100)audio
(optional): Audio to include in the videoloop_count
(optional): Number of times to loop the videopingpong
(optional): Whether to play the video forward then backward
Outputs:
video_path
: Path to the saved video file
Example Workflows
Audio Loading and Preview
- Add a "Load Audio From URL" node
- Enter the URL of an audio file
- Connect the output to a "Preview Audio" node
- Execute the workflow to download and play the audio
Video Loading and Preview
- Add a "Load Video From URL" node
- Enter the URL of a video file
- Configure the frame rate, size, and other options as needed
- Connect the "FRAMES" output to a "Preview Video" node
- Execute the workflow to download the video and preview the frames
Save Audio From URL
- Add a "Load Audio From URL" node
- Enter the URL of an audio file
- Connect the output to a "Save Audio" node
- Configure the output format and options
- Execute the workflow to download and save the audio
Save Video From URL with Audio
- Add a "Load Video From URL" node
- Enter the URL of a video file
- Connect the "FRAMES" output to a "Save Video" node
- Connect the "audio" output to the "audio" input of the "Save Video" node
- Configure the output format, codec, and other options
- Execute the workflow to download and save the video with its audio
License
MIT
Credits
This project was inspired by: