Nodes/ComfyUI-Creepy_nodes/File Sorter (Creepybits)
ComfyUI Node

File Sorter (Creepybits)

Declutter your output folder without breaking a sweat

By Creepybits·Created about a year ago·Updated 2 months ago· 32
File Sorter (Creepybits)
    • status
    • files_moved_count
    target_folderC:\ComfyUI\output\
    image_extensions.png, .jpg, .jpeg, .webp, .gif, .bmp
    video_extensions.mp4, .mov, .avi, .mkv, .webm
    execute_sortfalse
    other_mappingsAudio:.mp3,.wav,.flac Docs:.txt,.md

    Every heavy ComfyUI user has the same dirt: an output folder with 3,000 PNGs, a dozen videos, and no system whatsoever. File Sorter is the housekeeping node that fixes it. Point it at a folder, and it moves files into subfolders based on their extension - images to Images, videos to Videos, whatever you define. It's not clever, but it's exactly the tool you reach for when the clutter is finally too much.

    The design is deliberately safety-first. The whole thing defaults to a dry run: it scans the folder and reports what it would move, without touching a single file. You only pull the trigger when you flip execute_sort to true.

    How it works

    You give it a target_folder and three configuration boxes. The two defaults handle the common cases:

    • image_extensions: .png, .jpg, .jpeg, .webp, .gif, .bmp → moves to Images
    • video_extensions: .mp4, .mov, .avi, .mkv, .webm → moves to Videos

    other_mappings is where the real power is - a multiline list of FolderName:ext,ext rules. The default ships with Audio:.mp3,.wav,.flac and Docs:.txt,.md, and you can add your own lines. Anything that matches a rule goes to a subfolder named after the rule; anything with an extension that matches no rule still gets sorted, into a folder named after the extension (so a .blend file becomes a BLEND folder).

    It scans only the top level of the folder - no recursion. It won't descend into subfolders, which is usually what you want for an output directory.

    The outputs

    Two of them, both boring and both useful:

    • status - a STRING report. In dry-run mode it lists each category and how many files would move. In real mode it confirms "Moved N file(s)."
    • files_moved_count - an INT you can feed into logic nodes if you want a workflow to react to whether anything was actually sorted.

    The one knob that matters

    execute_sort. It's a boolean, default false. Leave it false and you get a preview. Flip it true and files actually move. Do not skip the dry run - the node's own documentation begs you to verify the report first, and it's right, because this is a move, not a copy. Files that go into Images are gone from the root.

    Installing it

    It's part of ComfyUI-Creepy_nodes:

    • ComfyUI Manager: search "Creepy_nodes" and install.
    • Manual:
      cd ComfyUI/custom_nodes
      git clone https://github.com/Creepybits/ComfyUI-Creepy_nodes.git
      

    Restart, and it's in the menu under FileIO. No dependencies beyond Python's stdlib - no models, no API keys.

    Troubleshooting

    If your dry run says "No files found that matched the sorting criteria," check the folder path - a trailing backslash on Windows is fine, a nonexistent path returns an error. And if you're wondering why a file went into a weirdly-named folder, that's the extension-fallback behavior above, not a bug. One more: the node moves files at the time you run the workflow, so it's best used as a deliberate one-shot, not as a permanent fixture in every queue. Run it, enjoy your tidy folder, remove it.

    CategoryCreepybits/FileIO

    Inputs (5)

    NameTypeDefaultDescription
    target_folderSTRINGC:\ComfyUI\output\
    image_extensionsSTRING.png, .jpg, .jpeg, .webp, .gif, .bmp
    video_extensionsSTRING.mp4, .mov, .avi, .mkv, .webm
    execute_sortBOOLEANfalse
    other_mappingsoptSTRINGAudio:.mp3,.wav,.flac Docs:.txt,.md

    Outputs (2)

    NameTypeDescription
    statusSTRING
    files_moved_countINT