Working with AI, whether professionally or as a hobby, will put you in a constant battle for physical space. Not as in a larger house, but available disk space on your computer. I previously wrote a guide for cleaning up space on your computer, you should read it, it’s a great guide!
In this guide I have refined the python scripts and turned them into ComfyUI nodes, for your convenience.
Prefer to watch a video? Here’s the complete tutorial:
Step 1: The Triage Specialist – File Sorter (Creepybits)
This is the first wave. You go into the chaotic battlefield (the Downloads folder) and you group the combatants. This node works as the ultimate organizer, instantly separating images from videos, text files from zip archives. It’s the digital Marie Kondo that asks, “Does this file spark joy, and if so, where the heck does it belong?” The screenshot you have is perfect for this section.

Paste the path to the folder you want sorted. In the top text box add the image extensions you want to include, in the middle text box you add the video extensions you want to include, and in the bottom text box you can add any custom extensions you want to include.
Execute sort: When set to false, it will do a dry run and only provide how many files are included based on your settings. This ‘dry run’ capability is a crucial safety feature, allowing you to verify exactly what the node plans to do before committing to moving a single file. It’s the ‘measure twice, cut once’ principle for your digital life. Setting it to true will execute the sorting the next time you queue the node.
Step 2: The Heavy Lifter – Media File Migrator (Creepybits)
Once everything is sorted, you bring in the logistics expert. This node’s job is to move the heavy stuff—the gigabytes of media files—from your prime real estate (your fast C: drive M.2/SSD) to the long-term storage warehouse (your D: drive). This is crucial for maintaining system performance and freeing up space for new projects.

Paste the path to the folder with the media files you want to move as the source folder. The destination folder should be set to the drive you wish to move your media files to. Your files will be moved to a newly created folder named _Moved_media at the specified destination drive, and the file and folder structure will be intact after the move.
Execute move: This works exactly the same as with the sort node. Set to false it will make a dry run and just let you know how many files can be moved as well as the total size of these files. Set it to true and execute the workflow again to actually move the files.
Step 3: The Janitor – Empty Folder Cleaner (Creepybits)
This is the final, satisfying cleanup. After all the sorting and moving, you’re often left with a ghost town of empty folders. This little node sweeps through and tidies everything up, leaving the place pristine. It’s the small detail that makes the whole process feel complete and professional.

After you have run the first two nodes, you might end up with a bunch of empty folders. Just set the target folder in this node to the path where your empty folders are. As with previous nodes, if Execute cleanup is set to false, it will just report its finding. If set to true, it will delete the folders.
Important! It will only ever delete folders that are completely empty.
The “Next Level” Power-Up: The Database
The user MoonMoon82 has created a really useful set of tools, that scans any given folder using Clip Vision and builds a searchable database from them. You can then either input an image and search the database for similar images, or you can connect a text node and search for images using text.
Building The Database

- Load Clip Vision
- Set the path to the folder you want to build a database from
- Name your database.
Search Database By Image

- Load Clip Vision
- Load the image you want to use to find similar images
- Pick your database and the corresponding folder
- Image count: How many similar image should be showing
- Match First: The x number of images that are most similar to input image
- Match Last: The x number of images that are least similar to input image
- Filename: outputs the full path to each of the images
- Score: The higher score (1.0 being the highest) the more similar the image is to the input image
Search Image By Text

- Load SDXL CLIP G
- Pick your database and corresponding folder
- Enter search text
- Advanced result browser, Score and Filename has the same functions as the previous workflows.
The nodes can be installed in ComfyUI manager or:
The workflows can be downloaded here: No_Chaos.zip
If you liked this guide, consider signing up for my newsletter and get the latest news, tips and tricks directly in your inbox!
Sign up on Patreon to get exclusive content for both free and paying members!
