YTDL Preview
YTDL Preview — Actually Listen to (and Watch) What You Just Downloaded, Inside the Graph
- audio
- current_file_path
- media_info_json
- total_files_count
Downloading a file is only half the workflow - you also want to check it's the clip you meant to grab before you run a long audio-to-video or stem-split pass on it. YTDL Preview is the pack's main preview node (it replaced the old audio-only preview in v1.0.7), and it does something ComfyUI rarely bothers with: it embeds a working media player right in the graph, so you can listen to the mp3 or watch the video you just downloaded without leaving ComfyUI or opening a file explorer.
How it works
You hand it the downloaded_files STRING that YTDL Downloader outputs (newline-separated file paths), and the node figures out what each file is - audio or video - by extension and mime type. For audio it loads the waveform via torchaudio (with a fallback that runs FFmpeg to convert anything stubborn to wav). For video it uses OpenCV to read frame counts and resolution, then renders an HTML5 player pointed at the file so it plays right in the node's preview pane. Either way, the audio output gives you a real AUDIO tensor - waveform plus sample rate - so the media is genuinely usable downstream, not just displayable. You get all the metadata (duration, sample rate, channels, resolution, fps) in the media_info_json STRING.
One honest caveat: for video, OpenCV reads every frame into memory just to get stats and metadata. That's fine for a 30-second clip and wasteful for a two-hour movie - long files can make the node feel heavy, and it's the main reason to keep your quality pick sensible.
The inputs and outputs that matter
Only two inputs, and only one you'll touch:
downloaded_files- wire it straight from YTDL Downloader'sdownloaded_filesoutput.file_index- 0-based index into that list. This is the browsing control: download five tracks, then step through them by bumping this number. The console prints a little library with indices and media-type icons so you know what's where.
Outputs, in order: audio (AUDIO tensor - feed it to any node that takes audio, like a Mel-Band RoFormer stem splitter), current_file_path (STRING, the path of whatever index you're viewing - handy for a save or further file-processing node), media_info_json (the metadata blob), and total_files_count (INT, so downstream logic can loop sensibly). A heads-up: despite what a console log line claims, there is no IMAGE output of the video frames - the video plays in the embedded player, and the real data that leaves this node is the audio.
Installing
It ships with the pack, so this is the standard dance:
cd ComfyUI/custom_nodes
git clone https://github.com/Saganaki22/ComfyUI-ytdl_nodes
Restart ComfyUI. Audio preview needs torch and torchaudio, which you already have if ComfyUI runs. Video preview additionally wants opencv-python (and Pillow for image fallbacks) - if a video file plays nothing and the console says OpenCV isn't available, pip install opencv-python in your ComfyUI environment fixes it. The whole pack is a single-dev project and still young, but this is the node the author clearly polished most, and the file browsing plus embedded player makes it the one you'll actually reach for to sanity-check a download before building on it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| downloaded_files | STRING | — | |
| file_index | INT | 00–999 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |
| current_file_path | STRING | — |
| media_info_json | STRING | — |
| total_files_count | INT | — |