ComfyUI Node
Media Selection
Selects an image or video from uploads, filesystem directories, or Reddit sources, optionally trims/resizes it, and returns the resolved path plus metadata (type, dimensions, duration, fps).
Media Selection
- media_path
- media_type
- media_info
- height
- width
- duration
- fps
◄media_sourceReddit Post►
◄media_typeimage►
◄seed0►
◄media_path►
◄uploaded_image_file►
◄uploaded_video_file►
◄reddit_url►
◄subreddit_url►
◄max_duration0.0►
◄resize_modeNone►
◄resize_width832►
◄resize_height480►
CategorySwiss Army Knife 🔪/Utils
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| media_source | COMBO | Reddit Post | Choose whether to upload media, randomize from a directory path, download from a Reddit post, or randomize from a subreddit |
| media_type | COMBO | image | Select the type of media to process |
| seed | INT | 00–18446744073709550000 | Seed for randomization when using 'Randomize Media from Path' or 'Randomize from Subreddit'. Use different seeds to force re-execution. |
| media_pathopt | STRING | Directory path to randomly select media from, including all subdirectories (used when media_source is Randomize Media from Path) | |
| uploaded_image_fileopt | STRING | Path to uploaded image file (managed by upload widget) | |
| uploaded_video_fileopt | STRING | Path to uploaded video file (managed by upload widget) | |
| reddit_urlopt | STRING | Reddit post URL (used when media_source is Reddit Post) | |
| subreddit_urlopt | STRING | Subreddit URL or name (e.g., 'r/pics' or 'https://www.reddit.com/r/pics/') - used when media_source is Randomize from Subreddit | |
| max_durationopt | FLOAT | 0.00–300 | Maximum duration in seconds for videos (0 = use full video). Video will be trimmed if longer. |
| resize_modeopt | COMBO | None | Resize mode: None (original size), Auto (832x480 landscape, 480x832 portrait), Custom (specify dimensions) |
| resize_widthopt | INT | 83264–8192 | Target width for Custom resize mode |
| resize_heightopt | INT | 48064–8192 | Target height for Custom resize mode |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| media_path | STRING | — |
| media_type | STRING | — |
| media_info | STRING | — |
| height | INT | — |
| width | INT | — |
| duration | FLOAT | — |
| fps | FLOAT | — |