Skip to content

Instantly share code, notes, and snippets.

@davo
Last active October 30, 2023 16:16
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save davo/4b374f41be657f59bfb60d1ee61d2616 to your computer and use it in GitHub Desktop.
Save davo/4b374f41be657f59bfb60d1ee61d2616 to your computer and use it in GitHub Desktop.
Saving the Stable Diffusion model weights to Google Drive.
# The Stable Diffusion model weights is a bit heavy (+4GB) to download and upload to Google Colab.
# Here the steps you'll need to follow to make clone the repo using Git LFS.
# Install git-lfs on Google Colab and clone the Stable Diffusion repo from the Hugging Face.
# https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/blob/main/sd-v1-4.ckpt
!git lfs install --system --skip-repo
!git clone https://USER:@HUGGINGFACE_TOKEN@huggingface.co/CompVis/stable-diffusion-v-1-4-original
# Copy the model weights to Google Drive
src_path = '/content/stable-diffusion/stable-diffusion-v-1-4-original/sd-v1-4.ckpt'
dest_path = '/content/gdrive/MyDrive/AI/StableDiffusion/models/sd-v1-4.ckpt'
!cp $src_path $dest_path
@maybe9999
Copy link

`src_path = 'stable-diffusion-v-1-4-original/sd-v1-4.ckpt'
dest_path = 'drive/MyDrive/AI/models/sd-v1-4.ckpt'
!cp $src_path $dest_path

from google.colab import drive
drive.mount('/content/drive')`

in google coolab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment