Skip to content

Commit c15a902

Browse files
ChloeL19lstein
authored andcommitted
Update Stable_Diffusion_AI_Notebook.ipynb
Making Stable_Diffusion_AI_Notebook.ipynb work smoothly on Google Colab
1 parent 101cac6 commit c15a902

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

notebooks/Stable_Diffusion_AI_Notebook.ipynb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"from os.path import exists\n",
5959
"\n",
6060
"!git clone --quiet https://github.com/invoke-ai/InvokeAI.git # Original repo\n",
61-
"%cd /content/stable-diffusion/\n",
61+
"%cd /content/InvokeAI/\n",
6262
"!git checkout --quiet tags/release-1.14.1"
6363
]
6464
},
@@ -79,6 +79,7 @@
7979
"!pip install colab-xterm\n",
8080
"!pip install -r requirements-lin-win-colab-CUDA.txt\n",
8181
"!pip install clean-fid torchtext\n",
82+
"!pip install transformers\n",
8283
"gc.collect()"
8384
]
8485
},
@@ -106,7 +107,7 @@
106107
"source": [
107108
"#@title 5. Load small ML models required\n",
108109
"import gc\n",
109-
"%cd /content/stable-diffusion/\n",
110+
"%cd /content/InvokeAI/\n",
110111
"!python scripts/preload_models.py\n",
111112
"gc.collect()"
112113
]
@@ -171,18 +172,18 @@
171172
"import os \n",
172173
"\n",
173174
"# Folder creation if it doesn't exist\n",
174-
"if exists(\"/content/stable-diffusion/models/ldm/stable-diffusion-v1\"):\n",
175+
"if exists(\"/content/InvokeAI/models/ldm/stable-diffusion-v1\"):\n",
175176
" print(\"❗ Dir stable-diffusion-v1 already exists\")\n",
176177
"else:\n",
177-
" %mkdir /content/stable-diffusion/models/ldm/stable-diffusion-v1\n",
178+
" %mkdir /content/InvokeAI/models/ldm/stable-diffusion-v1\n",
178179
" print(\"✅ Dir stable-diffusion-v1 created\")\n",
179180
"\n",
180181
"# Symbolic link if it doesn't exist\n",
181-
"if exists(\"/content/stable-diffusion/models/ldm/stable-diffusion-v1/model.ckpt\"):\n",
182+
"if exists(\"/content/InvokeAI/models/ldm/stable-diffusion-v1/model.ckpt\"):\n",
182183
" print(\"❗ Symlink already created\")\n",
183184
"else: \n",
184185
" src = model_path\n",
185-
" dst = '/content/stable-diffusion/models/ldm/stable-diffusion-v1/model.ckpt'\n",
186+
" dst = '/content/InvokeAI/models/ldm/stable-diffusion-v1/model.ckpt'\n",
186187
" os.symlink(src, dst) \n",
187188
" print(\"✅ Symbolic link created successfully\")"
188189
]
@@ -233,7 +234,7 @@
233234
"%matplotlib inline\n",
234235
"\n",
235236
"images = []\n",
236-
"for img_path in sorted(glob.glob('/content/stable-diffusion/outputs/img-samples/*.png'), reverse=True):\n",
237+
"for img_path in sorted(glob.glob('/content/InvokeAI/outputs/img-samples/*.png'), reverse=True):\n",
237238
" images.append(mpimg.imread(img_path))\n",
238239
"\n",
239240
"images = images[:15] \n",

0 commit comments

Comments
 (0)