File size: 1,953 Bytes
f69753d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | # -*- coding: utf-8 -*-
"""forge_drive_link.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/#fileId=https%3A//huggingface.co/arcacolab/drive_link/blob/main/forge_drive_link.ipynb
<a href="https://colab.research.google.com/github/arcacolab/oneclick/blob/main/forge_drive_link.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
"""
import os
# 모델 폴더 생성
dir_path = "/content/Forge/models/Stable-diffusion/"
os.makedirs(dir_path, exist_ok=True)
dir_path = "/content/Forge/models/Lora/"
os.makedirs(dir_path, exist_ok=True)
dir_path = "/content/Forge/models/VAE/"
os.makedirs(dir_path, exist_ok=True)
dir_path = "/content/Forge/embeddings"
os.makedirs(dir_path, exist_ok=True)
# Google Drive 경로 설정
sdpath = "/content/drive/MyDrive/ONECLICK/"
outputspath = sdpath + "outputs"
modelpath = sdpath + "model"
lorapath = sdpath + "lora"
vaepath = sdpath + "vae"
embeddingspath = sdpath + "embedding"
# outputs 폴더 생성 및 심볼릭 링크
if not os.path.exists(outputspath):
!mkdir -p -v "{outputspath}"
link_path = "/content/Forge/outputs"
if not os.path.exists(link_path) and not os.path.islink(link_path):
!ln -s -v "{outputspath}" "{link_path}"
# model 폴더 생성 및 심볼릭 링크
if not os.path.exists(modelpath):
!mkdir -p -v "{modelpath}"
!ln -s -v "{modelpath}" "/content/Forge/models/Stable-diffusion"
# lora 폴더 생성 및 심볼릭 링크
if not os.path.exists(lorapath):
!mkdir -p -v "{lorapath}"
!ln -s -v "{lorapath}" "/content/Forge/models/Lora"
# vae 폴더 생성 및 심볼릭 링크
if not os.path.exists(vaepath):
!mkdir -p -v "{vaepath}"
!ln -s -v "{vaepath}" "/content/Forge/models/VAE"
# embeddings 폴더 생성 및 그시기
if not os.path.exists(embeddingspath):
!mkdir -p -v "{embeddingspath}"
!ln -s -v "{embeddingspath}" "/content/Forge/embeddings" |