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.safetensorsDescription
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.
FAQ
Comments (15)
If you use "use lycoris to handle lora" feature on SDNext it will be irrelevant to split them apart... you can just dump them together and stop worrying
Interesting, might try this
no. Certain lycos outputs an error called - Bad Lora layer name
I've mostly avoided this issue by naming downloads either xxx.lora.safetensors or yyy.lyco.safetensors and even zzz.base.safetensors (ST-format base models) and www.ti.safetensors (ST-format embeddings).
You just have to remember in your prompts to change <lora:xxx:1> to <lora:xxx.lora:1> and so on, such as <lora:add_detail.lora:0.8>.
If you use the tag-complete extension in webui, it will pop up the correct names if you use <l: for LoRAs, <lyco: for LyCORIS, or <e: for embeddings, and a few letters, so you don't even have to remember to add it in your prompt.
This list for loras works fine but I get an error on the actual lycoris list:
-------------------------------------
| Found the following LyCORIS files |
-------------------------------------
Traceback (most recent call last):
File "C:\stable-diffusion-webui\find_lyco.py", line 135, in <module>
main()
File "C:\stable-diffusion-webui\find_lyco.py", line 88, in main
if is_lyco(header):
File "C:\stable-diffusion-webui\find_lyco.py", line 31, in is_lyco
metadata = header.get("__metadata__")
AttributeError: 'NoneType' object has no attribute 'get'
Looks like code blocks don't work on this site, sorry about that
That error means the last it failed to read the last file in the "Looking for .safetensors files" section. The original intention was to skip over broken files but I forgot to implement that. If you add "if header is None:(newline and indent) continue" after line 85, it should fix the issue. Otherwise just move the file it couldn't read out of the directory.
@m99 That seemed to work. It identified 15 lycos and 14 of those were actually just loras
Is there a benefit to separating Lora vs Lyco?
Depends what version and what extensions your using. Others here have commented they put everything in the lora folder or everything in the lycoris folder and it worked fine.
If you specify block weights on your loras, lora and lyco have a different number of weights that need to be specified so that might be an edge case where you'd need to have them in the right directory where they'd otherwise work fine being all together.
I just spent over 5 hours fixing this exact issue, less than 10 tabs left to check I browse your account to find this. fml.
Cool work none the less.
Now it can find them. But could it also.. move them for me? Or I gotta be all manual from here? D:
Edit: Nevermind, it does that. Though, I wouldn't know for sure, I can't get it to work. I lack the braincells.
but what do I do with it? I assume put
python find_lyco.py
in a cmd window from the lora folder but, nothing seems to happen other than
Usage:
python find_lyco.py [path_to_directory_to_scan]
or
python find_lyco.py [path_to_directory_to_scan] [target_lycoris_directory]
If a target directory is supplied, confirmation will be asked before moving files.
If no target directory is supplied, this script will not move any files.
but, that doesn't mean anything to me. Any help?
Details
Files
sortLycorisFromLORA_v30.zip
Mirrors
entpnoonnaaa_Soft.safetensors
Jungt BUS - Weights Model.zip
Betty%20-%20Regina%20Ruiz%20%5BHey%20Duggee%20%2F%20Latino%5D%20-%20Weights%20Model.zip
Pr%C3%ADncipe%20Zuko-Prince-Pablo%20Andr%C3%A9s%20Ausensi%20Mart%C3%ADnez-Avatar%3A%20La%20leyenda%20de%20Aang-%20The%20Last%20Airbender%20(Latin%20Americ-American%20Spanish%20Dub-Espa%C3%B1ol%20latino)%20-%20Weights%20Model.zip
pornmasterProFP32V4_fp32V4.safetensors
mixtapeSalsa_v10FusOBakedVAE.safetensors
28DSTABLEBESTVERSION_28dv5.safetensors
10_v1010.safetensors
sortLycorisFromLORA_v30.zip
sentryBotVoiceSoVits_v10.zip
yinmixreal_v10.safetensors
yuzufinetune_v12.safetensors
Tr1st1n_M4ys.pt
mixRealistic_v10.safetensors
avatarStyle_v15.ckpt
entpnoonnaaa_Soft.safetensors
elegantrpganimemagic_v10.safetensors
kawaiiRealisticAsian_v04.safetensors
analogporn_v20.ckpt
foolkatGODOF_v1.safetensors
superHeroComicStyle_v10.ckpt
envyanimexl_v09.safetensors
entpnoonnaaa_Hard.safetensors
SLD.safetensors
mobaGameEquipment_v10.safetensors
paint_V17.safetensors
pornmasterProFULLV4_fullV4.safetensors
rosedrawnmix_v11.safetensors
sweetMix_v21.safetensors
Available On (1 platform)
Same model published on other platforms. May have additional downloads or version variants.
