| { | |
| "nbformat": 4, | |
| "nbformat_minor": 0, | |
| "metadata": { | |
| "colab": { | |
| "private_outputs": true, | |
| "provenance": [], | |
| "authorship_tag": "ABX9TyNTZRdlpItc4KqaREDpG6lW", | |
| "include_colab_link": true | |
| }, | |
| "kernelspec": { | |
| "name": "python3", | |
| "display_name": "Python 3" | |
| }, | |
| "language_info": { | |
| "name": "python" | |
| } | |
| }, | |
| "cells": [ | |
| { | |
| "cell_type": "markdown", | |
| "metadata": { | |
| "id": "view-in-github", | |
| "colab_type": "text" | |
| }, | |
| "source": [ | |
| "<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>" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": { | |
| "id": "DnWtJXAaYgjT" | |
| }, | |
| "outputs": [], | |
| "source": [ | |
| "import os\n", | |
| "\n", | |
| "# 모델 폴더 생성\n", | |
| "dir_path = \"/content/Forge/models/Stable-diffusion/\"\n", | |
| "os.makedirs(dir_path, exist_ok=True)\n", | |
| "dir_path = \"/content/Forge/models/Lora/\"\n", | |
| "os.makedirs(dir_path, exist_ok=True)\n", | |
| "dir_path = \"/content/Forge/models/VAE/\"\n", | |
| "os.makedirs(dir_path, exist_ok=True)\n", | |
| "\n", | |
| "# Google Drive 경로 설정\n", | |
| "sdpath = \"/content/drive/MyDrive/ONECLICK/\"\n", | |
| "outputspath = sdpath + \"outputs\"\n", | |
| "modelpath = sdpath + \"model\"\n", | |
| "lorapath = sdpath + \"lora\"\n", | |
| "vaepath = sdpath + \"vae\"\n", | |
| "\n", | |
| "# outputs 폴더 생성 및 심볼릭 링크\n", | |
| "if not os.path.exists(outputspath):\n", | |
| " !mkdir -p -v \"{outputspath}\"\n", | |
| "\n", | |
| "link_path = \"/content/Forge/outputs\"\n", | |
| "if not os.path.exists(link_path) and not os.path.islink(link_path):\n", | |
| " !ln -s -v \"{outputspath}\" \"{link_path}\"\n", | |
| "\n", | |
| "# model 폴더 생성 및 심볼릭 링크\n", | |
| "if not os.path.exists(modelpath):\n", | |
| " !mkdir -p -v \"{modelpath}\"\n", | |
| "!ln -s -v \"{modelpath}\" \"/content/Forge/models/Stable-diffusion\"\n", | |
| "\n", | |
| "# lora 폴더 생성 및 심볼릭 링크\n", | |
| "if not os.path.exists(lorapath):\n", | |
| " !mkdir -p -v \"{lorapath}\"\n", | |
| "!ln -s -v \"{lorapath}\" \"/content/Forge/models/Lora\"\n", | |
| "\n", | |
| "# vae 폴더 생성 및 심볼릭 링크\n", | |
| "if not os.path.exists(vaepath):\n", | |
| " !mkdir -p -v \"{vaepath}\"\n", | |
| "!ln -s -v \"{vaepath}\" \"/content/Forge/models/VAE\"" | |
| ] | |
| } | |
| ] | |
| } |