Extensions/ComfyUI-Get-Random-File
ComfyUI Extension

ComfyUI-Get-Random-File

πŸš€ Picks a random IMAGE file from a directory and provides you with the IMAGE and its filepath as a STRING! This awesome tool brings a touch of randomness to your files and images, making your file management tasks a breeze.

By ChrisColeTechΒ·Created 2 years agoΒ·Updated 17 days agoΒ· 5
ChrisColeTech/ComfyUI-Get-Random-File
Nodes14
On cloudLocal install
CategoryπŸ€– CCTech/Files
Stars5
Updated17 days ago

Nodes (14)

Get Image File By Index πŸ–ΌοΈ

Step through a folder of images one queue at a time β€” the non-random sibling

πŸ€– CCTech/Files
Get Video File By Index ▢️

A counter for your video folder β€” same idea as the image version, frames included

πŸ€– CCTech/Files
Preview Audio w/ Length ⚑

The runtime number ComfyUI never handed you

πŸ€– CCTech/Files
Random File Path 🎲

The 'grab me a random file' node people actually recommend

πŸ€– CCTech/Files
Random Image Path 🎲

A random image from a folder on every run β€” img2img roulette, minus the setup

πŸ€– CCTech/Files
Random Video Path 🎲

Random video, decoded to frames β€” fun until your RAM taps out

πŸ€– CCTech/Files
Load Random Video (Path) 🎲

Feed a Random Video From Any Folder β€” and Actually Know Which One Ran

πŸ€– CCTech/Files
Save Audio w/ Length ⚑

FLAC, MP3 or Opus, anywhere on your disk

πŸ€– CCTech/Files
Save Image to Folder ⚑

Save Image to Folder – ComfyUI Node Guide

πŸ€– CCTech/Files
Save Image to Remote ⚑

The save node that never touches your own disk

πŸ€– CCTech/Files
Save Video to Folder ⚑

Save a video to literally any folder, not just ComfyUI's output directory

πŸ€– CCTech/Files
Save Video to Remote ⚑

Ship the finished MP4 to another machine, then maybe delete the original

πŸ€– CCTech/Files
Text β†’ Frames (Speech Estimate)⚑

Stop guessing how many frames your narration needs

πŸ€– CCTech/Files
Load Video (Path) ▢️

The Load-Video That Doesn't Care Where Your Files Live

πŸ€– CCTech/Files
Readme

πŸŽ‰ ComfyUI-Get-Random-File πŸŽ‰

Build Status

Welcome to ComfyUI-Get-Random-File! πŸš€ This awesome tool brings a touch of randomness to your files and images, making your file management tasks a breeze. Whether you're wor king on a creative project or just want some fun, our tool is here to help you get random files and images effortlessly. Use these nodes for a variety of applications where you need a random file!

Included Nodes 🌟

  • 🎲 Random File Path
    Chooses a random file from a directory and returns the filepath as a STRING.

  • πŸ–ΌοΈ Get Image File By Index
    Retrieves a IMAGE from a specified directory by index and returns both the IMAGE and its filepath as a STRING.

  • 🎲 Random Image Path
    Picks a random IMAGE file from a directory and provides you with the IMAGE and its filepath as a STRING.

  • ⚑ Save Image to Folder
    Saves images to ANY folder on your computer (not just ComfyUI's output directory). Creates the folder if missing, never overwrites (stock-style _00001_ counter), embeds the workflow metadata in PNGs, and supports the stock %width%/%date-style prefix variables.

  • ⚑ Save Video to Folder
    Saves a VIDEO input to ANY folder on your computer using ComfyUI's own writer β€” streams are copied when compatible and re-encoded only when the format/codec/CRF require it.

πŸ“ Prompt Metadata Outputs

Both image nodes (Random Image Path and Get Image File By Index) also output positive_prompt and negative_prompt STRINGs extracted from the picked image's embedded ComfyUI workflow metadata β€” so you can wire the prompts that originally generated an image straight into whatever consumes it. Works with titled prompt nodes, sampler/guider link traversal (including parallel chains, Anything-Everywhere-injected graphs, and combined prep nodes like this family's own img2img nodes that carry prompt widgets), CLIPTextEncode/CLIPTextEncodeFlux, the core TextEncode* encoders (QwenImageEdit, ZImageOmni, SDXL, SD3, HunyuanDiT, ...), text concatenation and wildcard nodes. Images without embedded prompts (or non-PNG files) simply return empty strings.

πŸ“Έ Preview

🎲 Random File Path
Preview Image

🎲 Random Image Path
Preview Image

πŸ–ΌοΈ Get Video By Index
Preview Image

πŸ“Έ Get Image By Index
Preview Image

Installation πŸ› οΈ

Method 1: Clone Repository into custom_nodes Folder

  1. Clone the Repository:

    Open Command Prompt or PowerShell and run the following command to clone the repository into the `custom_nodes` directory of your ComfyUI setup:

    git clone https://github.com/ChrisColeTech/ComfyUI-Get-Random-File.git <path/to/comfyui/custom_nodes>

    Replace path/to/comfyui with the actual path to your ComfyUI installation.

  2. Restart ComfyUI:

    Restart your ComfyUI server to load the new node.

Method 2: Install via ComfyUI Manager

  1. Open ComfyUI Manager:

    Launch the ComfyUI Manager.

  2. Search for ComfyUI-Get-Random-File:

    In the ComfyUI Manager, go to the Node Manager and search for ComfyUI-Get-Random-File.

  3. Install the Node:

    Click on the Install button next to ComfyUI-Get-Random-File. The manager will handle the installation and setup process for you.

  4. Restart ComfyUI:

    After installation, restart your ComfyUI server to ensure that the new node is properly integrated.