From ae57c5b137c71f8e179f1ed55bf3643e21ea1b58 Mon Sep 17 00:00:00 2001 From: Drake Panzer <64224601+Cyberes@users.noreply.github.com> Date: Mon, 30 Jan 2023 10:38:17 -0700 Subject: [PATCH] init repo in empty dir --- StableDiffusionUI_Voldemort_paperspace.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/StableDiffusionUI_Voldemort_paperspace.ipynb b/StableDiffusionUI_Voldemort_paperspace.ipynb index 97c046b..3acc2bb 100644 --- a/StableDiffusionUI_Voldemort_paperspace.ipynb +++ b/StableDiffusionUI_Voldemort_paperspace.ipynb @@ -176,9 +176,16 @@ "repo_storage_dir = Path(repo_storage_dir)\n", "stable_diffusion_webui_path = repo_storage_dir / 'stable-diffusion-webui'\n", "\n", - "if not (stable_diffusion_webui_path / '.git').exists():\n", + "if not (stable_diffusion_webui_path / '.git').exists(): \n", + " # It's possible that the stable_diffusion_webui_path already exists but the repo has not been downloaded.\n", + " # We will init the repo manually.\n", " !mkdir -p \"{stable_diffusion_webui_path}\"\n", - " !git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui \"{stable_diffusion_webui_path}\"\n", + " %cd \"{stable_diffusion_webui_path}\"\n", + " !git init\n", + " !git remote add origin https://github.com/AUTOMATIC1111/stable-diffusion-webui\n", + " !git fetch\n", + " !git checkout -t origin/master -f\n", + " # !git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui \"{stable_diffusion_webui_path}\"\n", "else:\n", " print('stable-diffusion-webui already downloaded, updating...')\n", " !cd \"{stable_diffusion_webui_path}\" && git pull # no % so we don't interfere with the main process\n",