Select Original Video
Turn a video in your library into a frame batch — with its audio track still attached
- paths
- IMAGE
- frame_count
- width
- height
- fps
- audio
- video_info
Video in ComfyUI is a chain of chores: find the file, decode it, pick the frames you actually want, resize them to something the model's VAE can eat, and somehow keep the audio around. This node automates the ugly middle. Select Original Video grabs one video from your Local Media Manager multi-select, decodes it into a frame batch with OpenCV, resizes each frame to your target, and hands you the audio track as a separate output. One node, both halves of a video pipeline.
How it works
Wire the gallery's paths output in, set index, and the node pulls that video's path out of the selection JSON. Frames are decoded with cv2.VideoCapture (that's why the pack's real dependency is opencv-python-headless, not the heavier moviepy the README once mentioned), then resized with common_upscale and stacked into an IMAGE tensor in temporal order - so frame 0 of the batch is frame 0 of the video. The audio is decoded separately by shelling out to ffmpeg and handed back in the standard ComfyUI AUDIO format (waveform + sample_rate, 44.1kHz stereo), so it plugs into any core audio node. It also emits a video_info JSON with the source's dimensions, fps, total frame count, and duration - useful when you want to know what you're working with before you condition on it.
The inputs that matter
paths- from the gallery'spathsoutput. Required.index- which selected video, 0-based.generation_width/generation_heightandaspect_ratio_preservation- same four-mode resize logic as Select Original Image (original,keep_input,stretch_to_new,crop_to_new). Sizes step by 8 to stay VAE-friendly.force_rate- target fps.0keeps the source frame rate; anything up to 240 resamples. Set it when a video model expects a specific frame count or fps.frame_load_cap- max frames to extract.0means "load the whole video," which for a long clip means a huge tensor and a lot of VRAM. Set it to the frame count your model needs.skip_first_frames- drop N frames from the start (useful when the first second is a fade-in).select_every_nth- take every Nth frame.2halves the frame count while keeping temporal coverage; your cheap way to downsample.
Outputs and where they go
IMAGE- the frame batch. Feed it to a video model's image conditioning (this is the standard first-frame / reference-frame input for the Wan, LTX-Video, and HunyuanVideo pipelines), or VAE-encode it yourself.frame_count(INT),width,height(INT),fps(FLOAT) - the actual values after all your sampling, so downstream nodes that need the real numbers can read them instead of guessing.audio(AUDIO) - the video's audio track, trimmed to start where the frames start. CoreSaveAudiowill write it back out, or you can run it through an audio-conditioned pipeline.video_info(STRING) - the source stats as JSON, mostly for inspection.
Common issues
- No audio track → the node returns silent audio (zeros) rather than erroring. Your frames are fine; just don't wire
audiointo something that needs real sound. - Huge videos bite you.
frame_load_cap = 0plus a 10-minute clip is a recipe for an out-of-memory run. Pick your cap first; raiseselect_every_nthif you want coverage without the memory bill. - Audio start vs. frames. The audio is trimmed using
skip_first_frames / fpsas the offset, so if you're skipping frames to drop a fade-in, the audio roughly follows. Roughly - if you need sample-accurate sync, verify with a quick playback pass.
Install via ComfyUI Manager (search "Local Media Manager") or git clone https://github.com/Firetheft/ComfyUI_Local_Media_Manager into custom_nodes/, then pip install -r requirements.txt. Audio extraction needs the ffmpeg binary on your PATH; the rest of the pack's deps are opencv-python-headless, torchaudio, and send2trash.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| paths | LMM_ALL_PATHS | — | |
| index | INT | 0 | — |
| generation_width | INT | 102464–8096 | Expected video width to generate |
| generation_height | INT | 102464–8096 | Expected video height |
| aspect_ratio_preservation | COMBO | Zoom Mode: - keep_input: Maintain the aspect ratio of the original video - stretch_to_new: Stretch to fit the new size - crop_to_new: Cropped to fit new sizes - original: No processing is performed, use the original video size | |
| force_rate | FLOAT | 00–240 | — |
| frame_load_cap | INT | 0 | — |
| skip_first_frames | INT | 0 | — |
| select_every_nth | INT | 1 | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| frame_count | INT | — |
| width | INT | — |
| height | INT | — |
| fps | FLOAT | — |
| audio | AUDIO | — |
| video_info | STRING | — |