/sd-file-manager

A small script to help sort downloaded models.

Primary LanguagePython

Stable Diffusion File Manager

A small script to help sort downloaded models. This script will sort files into their proper folders, based on given parameters. It them uses the same parameters to generate a json compatible with Automatic1111's Extra Networks GUI. Stores slightly more information than the json generated by Automatic1111. For people who want a bit more customization outside of downloader extensions available, or not using the webui.

Screenshot

Main

Installation

Requirements

Current build on Python 3.9.13 Uses PyQt5

Run

Linux

linux_launcher.sh

Windows

windows_launcher.bat

Manual

python sd-file-manager.py

Usage

Drag and drop each file into the window. Fill in the information you want, and clicking save will do the transfer/create the json file. Changing the name will update the name of the file. Path at the bottom shows a preview of final destination. It can be manually changed as needed.

There is a very primitive safetensor file type check in place, but it is not comprehensive. Currently does a basic metadata check for Lora and Lycoris files.

Known Bugs

  • On larger files, the program will freeze a bit before saving. It's taking time to process/move the file and I haven't implemented a more efficient pipeline.
  • Sometimes, windows preview path will show a mix of both / and \. This is a visual bug, the path gets sanitized through os.path.join. Not the best, but it works for now.

Configuration

Rename config-template.json to config.json, and change your root path. First launch of one of the launch scripts will create the config file for you using config-template.json.

Config template can be modified to add/remove options in the various fields (ex: add more model types, more categories, etc).

In the case of this example:

ai
 |-stable-diffusion
 | |-lora
 | |-checkpoints

The link path would be

/ai/stable-diffusion

Todo

  • Add configuration for different naming formats (ex. id-name.safetensor)
  • Add configuration for default data
  • [-] Add feature to auto populate fields
    • file type (checkpoint, lora, etc)
    • sd version
  • Add feature to auto move a preview image with the same name if exists
  • Add feature to have config determine possible :
    • Model Types (radio buttons)
    • Categories (dropdown)
    • SD Version (dropdown)
    • Preferred Weight (slider)
  • Logging
  • Launcher

License

GPLv3.