CivArchive
    Sort LyCORIS from LORA script - v3.0
    Preview 1509260

    I often dump everything I download in the lora folder. Turns out the LyCORIS models are supposed to go in a different folder.

    I wrote this python script to find all the LyCORIS that were placed in the wrong folder.

    e.g.

    > python.exe find_lyco.py D:\\stable-diffusion-webui\\models\\lora
    ----------------------------------
    | Looking for .safetensors files |
    ----------------------------------
    D:\stable-diffusion-webui\models\lora\a.safetensors
    D:\stable-diffusion-webui\models\lora\subdir\b.safetensors
    D:\stable-diffusion-webui\models\lora\c.safetensors
    ----------------------------------
    | Found the following LORA files |
    ----------------------------------
    D:\stable-diffusion-webui\models\lora\a.safetensors
    D:\stable-diffusion-webui\models\lora\subdir\b.safetensors
    -------------------------------------
    | Found the following LyCORIS files |
    -------------------------------------
    D:\stable-diffusion-webui\models\lora\c.safetensors

    Description

    • Now always checks model as the metadata sometimes lies and says lora when the file is lycoris.

    • Added feature to have the script move LyCORIS models to a target directory. It also moves related preview and info files and maintains the directory structure. The script prompts for confirmation before moving any files.