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).

By sammykumar·Created 11 months ago·Updated 7 months ago· 5
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)

    NameTypeDefaultDescription
    media_sourceCOMBOReddit PostChoose whether to upload media, randomize from a directory path, download from a Reddit post, or randomize from a subreddit
    media_typeCOMBOimageSelect the type of media to process
    seedINT00–18446744073709550000Seed for randomization when using 'Randomize Media from Path' or 'Randomize from Subreddit'. Use different seeds to force re-execution.
    media_pathoptSTRINGDirectory path to randomly select media from, including all subdirectories (used when media_source is Randomize Media from Path)
    uploaded_image_fileoptSTRINGPath to uploaded image file (managed by upload widget)
    uploaded_video_fileoptSTRINGPath to uploaded video file (managed by upload widget)
    reddit_urloptSTRINGReddit post URL (used when media_source is Reddit Post)
    subreddit_urloptSTRINGSubreddit URL or name (e.g., 'r/pics' or 'https://www.reddit.com/r/pics/') - used when media_source is Randomize from Subreddit
    max_durationoptFLOAT0.00–300Maximum duration in seconds for videos (0 = use full video). Video will be trimmed if longer.
    resize_modeoptCOMBONoneResize mode: None (original size), Auto (832x480 landscape, 480x832 portrait), Custom (specify dimensions)
    resize_widthoptINT83264–8192Target width for Custom resize mode
    resize_heightoptINT48064–8192Target height for Custom resize mode

    Outputs (7)

    NameTypeDescription
    media_pathSTRING
    media_typeSTRING
    media_infoSTRING
    heightINT
    widthINT
    durationFLOAT
    fpsFLOAT