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
find_lyco_v3.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
ENTP_NoonNaaa_Soft.safetensors
Avatar style V1.5.ckpt
EnvyAnimeXL_v09.safetensors
ElegantRPGAnimeMagick.safetensors
my_check_point.safetensors
PornMaster-Pro-FULL-V4.safetensors
find_lyco_v3.zip
SentryBot.zip
SLD.safetensors
ENTPNoonNaaa_Hard.safetensors
Paint V1.73.safetensors
yinmixreal_v10.safetensors
Tr1st1n_M4ys.pt
YuzuFTmixV1.2.safetensors
analogPorn_2_0.3.ckpt
MyComic_Mid-half.ckpt
FoolKat_GOD-OF-SEDUCTION_V1.safetensors
PornMaster-Pro-FP32-V4.safetensors
3.14柠檬树-fp16.safetensors
Moba Game icon.safetensors
Sweet mix.safetensors
0.7(gy010_v10) + 0.3(aniverse_V11Pruned) Baked VAE.safetensors
2.8Dv554.safetensors
RoseDrawnMix1.1.safetensors
KawaiiRealisticAsianMix_v0.4.safetensors
Available On (1 platform)
Same model published on other platforms. May have additional downloads or version variants.
