From 3faccc5afdabe2814e227d39cdc90b54bbd2aef5 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Sun, 18 Sep 2022 13:13:28 -0600 Subject: [PATCH] check if model file already exists when symlinking --- StableDiffusionUI_Voldemort_paperspace.ipynb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/StableDiffusionUI_Voldemort_paperspace.ipynb b/StableDiffusionUI_Voldemort_paperspace.ipynb index c5c0cd1..9ecfdd6 100644 --- a/StableDiffusionUI_Voldemort_paperspace.ipynb +++ b/StableDiffusionUI_Voldemort_paperspace.ipynb @@ -11,7 +11,9 @@ "\n", "Adapted from: https://colab.research.google.com/drive/1Iy-xW9t1-OQWhb0hNxueGij8phCyluOh\n", "\n", - "In the Tools section at the bottom of the notebook there is a block to download the latest version of this notebook from Github.\n", + "**Updating the Notebook**\n", + "\n", + "In the Tools section at the bottom of the notebook there is a block to download the latest version from Github.\n", "\n", "**Guides**\n", "- [Getting started on Paperspace](https://github.com/Engineer-of-Stuff/stable-diffusion-paperspace/blob/main/Docs/Paperspace%20Guide%20for%20Retards.md)\n", @@ -353,7 +355,7 @@ "source": [ "### Link the models directory\n", "\n", - "If it says `failed to create symbolic link: File exists` that's fine. It means you've already ran this block." + "Create symlinks. The file will be stored in the models storage directory and linked to where the WebUI expects the files to be." ] }, { @@ -366,7 +368,8 @@ "import os\n", "for file in os.listdir(model_storage_dir):\n", " if file.endswith(\"ckpt\"):\n", - " !ln -s $model_storage_dir/$file /notebooks/stable-diffusion-webui/models/$file\n", + " if not os.path.exists(f'/notebooks/stable-diffusion-webui/models/{file}'):\n", + " !ln -s $model_storage_dir/$file /notebooks/stable-diffusion-webui/models/$file\n", " !ls -la --block-size=GB /notebooks/stable-diffusion-webui/models/$file" ] },