Linaqruf / sd-notebook-collection

209 stars 42 forks source link

How to link to model + Lora folders in google drive? #14

Open annasophiachristianahahn opened 1 year ago

annasophiachristianahahn commented 1 year ago

hello!

I currently am trying to access these two google drive folders for checkpoints and Loras but neither seems to work

what am I doing wrong?

fuse:/content/drive/MyDrive/sd/stable-diffusion-webui/models/Stable-diffusion

fuse:/content/drive/MyDrive/sd/stable-diffusion-webui/models/Lora

dizzyjung commented 1 year ago

It provides a way to download in bulk, but I couldn't download it every time because I was using a lot of checkpoints and loras. I expect you to add this symlink method as an option as well

Select the Google Drive mount option and add the command cell below to start and execute it to create a symbolic link.


import os def flat_ln(dir, target): paths = []

def helper(dir, target): dir_path = os.path.join(dir) for filename in os.listdir(dir_path): fullpath = os.path.join(dir_path, filename) if os.path.isdir(fullpath): helper(fullpath, target) elif os.path.isfile(fullpath) and not os.path.exists(os.path.join(target, filename)):

ln file to target only when file doesn't exist at target

    paths.append(fullpath)

helper(dir, target)

ln_files = ' '.join(paths)

!ln -s {ln_files} {target}

flat_ln('/content/drive/MyDrive/Backup/models_link', '/content/stable-diffusion-webui/models/Stable-diffusion')

flat_ln('/content/drive/MyDrive/Backup/lora_link', '/content/stable-diffusion-webui/models/Lora')

Linaqruf commented 1 year ago

hello!

I currently am trying to access these two google drive folders for checkpoints and Loras but neither seems to work

what am I doing wrong?

fuse:/content/drive/MyDrive/sd/stable-diffusion-webui/models/Stable-diffusion

fuse:/content/drive/MyDrive/sd/stable-diffusion-webui/models/Lora

You're doing right, the error is in my side. I fixed the error in this commit : https://github.com/Linaqruf/sd-notebook-collection/commit/2a4f0a3b433b35b244421a01bffd4906d1fdcca5

annasophiachristianahahn commented 1 year ago

Awesome thank you! So if I put the folder link in it should have access to all of the models in that folder?On Apr 25, 2023, at 3:52 AM, Linaqruf @.***> wrote:

hello! I currently am trying to access these two google drive folders for checkpoints and Loras but neither seems to work what am I doing wrong? fuse:/content/drive/MyDrive/sd/stable-diffusion-webui/models/Stable-diffusion fuse:/content/drive/MyDrive/sd/stable-diffusion-webui/models/Lora

You're doing right, the error is in my side. I fixed the error in this commit : 2a4f0a3

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>