# LoadFiles The primary goal of these nodes is to provide a way to access files generated by ComfyUI workflows, local to the machine running ComfyUI. These nodes should always return an updated list of files when triggered. ![LoadFiles-LoadImages](docs/LoadFiles-LoadImages.png) ### General Inputs 1. directory * The directory in which you want search files 1. limiter * Regular Expression to 'limit' or filter the files selected 1. sort * Attribute by which to sort the selected files * Name, Date Created, Date Modified, Size 1. direction * Accending or Decending sorting by `sort` attribute. 1. splice * Use the Head or Tail of sorted files * You will likely want to use Tail with Accending, or Head with Decending 1. count * The number of files to return * If fewer than `count` files are found, we re-use existing files to fill the count * A count of 0 will return all files 1. error * No Error - Does not error if `count` is not met * Load Count - Error if `count` is not met ### General Outputs 1. filenames (STRING) * Newline delimited list of files selected ## List Files in Directory > Provide list of Files form Directory This is supposed to be a generic node which allows you to use the core functionality of LoadFiles, with uncommon or new scenarios. ## Load Images from Directory > Load Images from Directory In addition to selecting files and returning the list of files, this will load up the images and provide an IMAGE and MASK output. > Note: Mask might not be working correctly at the moment ## Line Count STRING Attempts to check the number of lines in a STRING by detecting `\n` or `\r\n`.