Skip to content

Instantly share code, notes, and snippets.

@null-hax
null-hax / organize.py
Created June 6, 2024 06:36
Organize your ComfyUI outputs directory by creation date.
import os
import shutil
from datetime import datetime
def organize_files_by_date(directory, script_name):
for item in os.listdir(directory):
if item == script_name:
continue
item_path = os.path.join(directory, item)
if os.path.isfile(item_path) or (os.path.isdir(item_path) and not is_date_format(item)):