Ensure LoRA files are only linked to LoRA directories and unify directory names to lower case

This commit is contained in:
Rokurokubi 2023-02-27 15:04:19 +09:00
parent e96e81d956
commit ec33199411
1 changed files with 3 additions and 2 deletions

View File

@ -326,6 +326,7 @@
"# Make sure important directories exists\n",
"!mkdir -p \"{model_storage_dir}/hypernetworks\"\n",
"!mkdir -p \"{model_storage_dir}/vae\"\n",
"!mkdir -p \"{model_storage_dir}/lora\"\n",
"!mkdir -p \"{repo_storage_dir}/stable-diffusion-webui/models/hypernetworks\"\n",
"!mkdir -p \"{repo_storage_dir}/stable-diffusion-webui/models/VAE\"\n",
"!mkdir -p \"{repo_storage_dir}/stable-diffusion-webui/models/Lora\"\n",
@ -1036,7 +1037,7 @@
" print('\\nLinking .ckpt and .safetensor/.safetensors/.st files in', source_path)\n",
" source_path = Path(source_path)\n",
" for file in [p for p in source_path.rglob('*') if p.suffix in ['.ckpt', '.safetensor', '.safetensors', '.st']]:\n",
" if Path(file).parent.parts[-1] not in ['hypernetworks', 'vae'] :\n",
" if Path(file).parent.parts[-1] not in ['hypernetworks', 'vae', 'lora'] :\n",
" if not (webui_sd_model_path / file.name):\n",
" print('New model:', file.name)\n",
" create_symlink(file, webui_sd_model_path)\n",
@ -1068,7 +1069,7 @@
"\n",
"# Link Lora\n",
"print('\\nLinking Loras...')\n",
"lora_source_path = Path(model_storage_dir, 'Lora')\n",
"lora_source_path = Path(model_storage_dir, 'lora')\n",
"if lora_source_path.is_dir():\n",
" for file in lora_source_path.iterdir():\n",
" create_symlink(lora_source_path / file, webui_lora_model_path)\n",