arcacolab commited on
Commit
2518665
·
verified ·
1 Parent(s): 640a38d

Upload 4 files

Browse files
a1111_drive_link.ipynb ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "private_outputs": true,
7
+ "provenance": [],
8
+ "authorship_tag": "ABX9TyNdi6Jwpa95aho3n2p8zCzF",
9
+ "include_colab_link": true
10
+ },
11
+ "kernelspec": {
12
+ "name": "python3",
13
+ "display_name": "Python 3"
14
+ },
15
+ "language_info": {
16
+ "name": "python"
17
+ }
18
+ },
19
+ "cells": [
20
+ {
21
+ "cell_type": "markdown",
22
+ "metadata": {
23
+ "id": "view-in-github",
24
+ "colab_type": "text"
25
+ },
26
+ "source": [
27
+ "<a href=\"https://colab.research.google.com/github/arcacolab/oneclick/blob/main/a1111_drive_link.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
28
+ ]
29
+ },
30
+ {
31
+ "cell_type": "code",
32
+ "execution_count": null,
33
+ "metadata": {
34
+ "id": "FYmudgnrX8Gp"
35
+ },
36
+ "outputs": [],
37
+ "source": [
38
+ "import os\n",
39
+ "\n",
40
+ "# 모델 폴더 생성\n",
41
+ "dir_path = \"/content/A1111/models/Stable-diffusion/\"\n",
42
+ "os.makedirs(dir_path, exist_ok=True)\n",
43
+ "dir_path = \"/content/A1111/models/Lora/\"\n",
44
+ "os.makedirs(dir_path, exist_ok=True)\n",
45
+ "dir_path = \"/content/A1111/models/VAE/\"\n",
46
+ "os.makedirs(dir_path, exist_ok=True)\n",
47
+ "\n",
48
+ "# Google Drive 경로 설정\n",
49
+ "sdpath = \"/content/drive/MyDrive/ONECLICK/\"\n",
50
+ "outputspath = sdpath + \"outputs\"\n",
51
+ "modelpath = sdpath + \"model\"\n",
52
+ "lorapath = sdpath + \"lora\"\n",
53
+ "vaepath = sdpath + \"vae\"\n",
54
+ "\n",
55
+ "# outputs 폴더 생성 및 심볼릭 링크\n",
56
+ "if not os.path.exists(outputspath):\n",
57
+ " !mkdir -p -v \"{outputspath}\"\n",
58
+ "\n",
59
+ "link_path = \"/content/A1111/outputs\"\n",
60
+ "if not os.path.exists(link_path) and not os.path.islink(link_path):\n",
61
+ " !ln -s -v \"{outputspath}\" \"{link_path}\"\n",
62
+ "\n",
63
+ "# model 폴더 생성 및 심볼릭 링크\n",
64
+ "if not os.path.exists(modelpath):\n",
65
+ " !mkdir -p -v \"{modelpath}\"\n",
66
+ "!ln -s -v \"{modelpath}\" \"/content/A1111/models/Stable-diffusion\"\n",
67
+ "\n",
68
+ "# lora 폴더 생성 및 심볼릭 링크\n",
69
+ "if not os.path.exists(lorapath):\n",
70
+ " !mkdir -p -v \"{lorapath}\"\n",
71
+ "!ln -s -v \"{lorapath}\" \"/content/A1111/models/Lora\"\n",
72
+ "\n",
73
+ "# vae 폴더 생성 및 심볼릭 링크\n",
74
+ "if not os.path.exists(vaepath):\n",
75
+ " !mkdir -p -v \"{vaepath}\"\n",
76
+ "!ln -s -v \"{vaepath}\" \"/content/A1111/models/VAE\""
77
+ ]
78
+ }
79
+ ]
80
+ }
comfyui_drive_link.ipynb ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "private_outputs": true,
7
+ "provenance": [],
8
+ "authorship_tag": "ABX9TyPp9/Q8FYO0+vyv1rl1+Hkj",
9
+ "include_colab_link": true
10
+ },
11
+ "kernelspec": {
12
+ "name": "python3",
13
+ "display_name": "Python 3"
14
+ },
15
+ "language_info": {
16
+ "name": "python"
17
+ }
18
+ },
19
+ "cells": [
20
+ {
21
+ "cell_type": "markdown",
22
+ "metadata": {
23
+ "id": "view-in-github",
24
+ "colab_type": "text"
25
+ },
26
+ "source": [
27
+ "<a href=\"https://colab.research.google.com/github/arcacolab/oneclick/blob/main/comfyui_drive_link.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
28
+ ]
29
+ },
30
+ {
31
+ "cell_type": "code",
32
+ "execution_count": null,
33
+ "metadata": {
34
+ "id": "6jzUVWNxKZl4"
35
+ },
36
+ "outputs": [],
37
+ "source": [
38
+ "import os\n",
39
+ "source_checkpoints = \"/content/ComfyUI/models/checkpoints\"\n",
40
+ "target_checkpoints = \"/content/drive/MyDrive/ONECLICK/model\"\n",
41
+ "source_loras = \"/content/ComfyUI/models/loras\"\n",
42
+ "target_loras = \"/content/drive/MyDrive/ONECLICK/lora\"\n",
43
+ "source_vae = \"/content/ComfyUI/models/vae\"\n",
44
+ "target_vae = \"/content/drive/MyDrive/ONECLICK/vae\"\n",
45
+ "\n",
46
+ "os.makedirs(target_checkpoints, exist_ok=True)\n",
47
+ "os.makedirs(target_loras, exist_ok=True)\n",
48
+ "os.makedirs(target_vae, exist_ok=True)\n",
49
+ "\n",
50
+ "!ln -sf \"{target_checkpoints}\" \"{source_checkpoints}\"\n",
51
+ "!ln -sf \"{target_loras}\" \"{source_loras}\"\n",
52
+ "!ln -sf \"{target_vae}\" \"{source_vae}\"\n",
53
+ "\n",
54
+ "#출력물 경로 관련\n",
55
+ "import shutil\n",
56
+ "\n",
57
+ "def delete_output_folder_if_file_exists():\n",
58
+ " \"\"\"\n",
59
+ " /content/ComfyUI/output 폴더 내부에 _output_images_will_be_put_here 파일이 있는 경우 폴더를 삭제합니다.\n",
60
+ " 파일이 없는 경우 폴더를 유지합니다.\n",
61
+ " \"\"\"\n",
62
+ " folder_path = \"/content/ComfyUI/output\"\n",
63
+ " file_path = os.path.join(folder_path, \"_output_images_will_be_put_here\")\n",
64
+ "\n",
65
+ " if os.path.exists(file_path):\n",
66
+ " shutil.rmtree(folder_path, ignore_errors=True)\n",
67
+ " print(f\"{folder_path} 폴더를 삭제했습니다. (_output_images_will_be_put_here 파일이 존재합니다.)\")\n",
68
+ " else:\n",
69
+ " print(f\"{folder_path} 폴더를 유지합니다. (_output_images_will_be_put_here 파일이 존재하지 않습니다.)\")\n",
70
+ "\n",
71
+ "# 함수 호출\n",
72
+ "delete_output_folder_if_file_exists()\n",
73
+ "\n",
74
+ "\n",
75
+ "import os\n",
76
+ "sdpath = \"/content/drive/MyDrive/ONECLICK/\"\n",
77
+ "\n",
78
+ "outputspath = sdpath + \"output\"\n",
79
+ "\n",
80
+ "\n",
81
+ "if not os.path.exists(outputspath):\n",
82
+ " !mkdir -p -v \"{outputspath}\"\n",
83
+ "\n",
84
+ "link_path = \"/content/ComfyUI/output\"\n",
85
+ "if not os.path.exists(link_path) and not os.path.islink(link_path):\n",
86
+ " !ln -s -v \"{outputspath}\" \"{link_path}\""
87
+ ]
88
+ }
89
+ ]
90
+ }
forge_drive_link.ipynb ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "private_outputs": true,
7
+ "provenance": [],
8
+ "authorship_tag": "ABX9TyNTZRdlpItc4KqaREDpG6lW",
9
+ "include_colab_link": true
10
+ },
11
+ "kernelspec": {
12
+ "name": "python3",
13
+ "display_name": "Python 3"
14
+ },
15
+ "language_info": {
16
+ "name": "python"
17
+ }
18
+ },
19
+ "cells": [
20
+ {
21
+ "cell_type": "markdown",
22
+ "metadata": {
23
+ "id": "view-in-github",
24
+ "colab_type": "text"
25
+ },
26
+ "source": [
27
+ "<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>"
28
+ ]
29
+ },
30
+ {
31
+ "cell_type": "code",
32
+ "execution_count": null,
33
+ "metadata": {
34
+ "id": "DnWtJXAaYgjT"
35
+ },
36
+ "outputs": [],
37
+ "source": [
38
+ "import os\n",
39
+ "\n",
40
+ "# 모델 폴더 생성\n",
41
+ "dir_path = \"/content/Forge/models/Stable-diffusion/\"\n",
42
+ "os.makedirs(dir_path, exist_ok=True)\n",
43
+ "dir_path = \"/content/Forge/models/Lora/\"\n",
44
+ "os.makedirs(dir_path, exist_ok=True)\n",
45
+ "dir_path = \"/content/Forge/models/VAE/\"\n",
46
+ "os.makedirs(dir_path, exist_ok=True)\n",
47
+ "\n",
48
+ "# Google Drive 경로 설정\n",
49
+ "sdpath = \"/content/drive/MyDrive/ONECLICK/\"\n",
50
+ "outputspath = sdpath + \"outputs\"\n",
51
+ "modelpath = sdpath + \"model\"\n",
52
+ "lorapath = sdpath + \"lora\"\n",
53
+ "vaepath = sdpath + \"vae\"\n",
54
+ "\n",
55
+ "# outputs 폴더 생성 및 심볼릭 링크\n",
56
+ "if not os.path.exists(outputspath):\n",
57
+ " !mkdir -p -v \"{outputspath}\"\n",
58
+ "\n",
59
+ "link_path = \"/content/Forge/outputs\"\n",
60
+ "if not os.path.exists(link_path) and not os.path.islink(link_path):\n",
61
+ " !ln -s -v \"{outputspath}\" \"{link_path}\"\n",
62
+ "\n",
63
+ "# model 폴더 생성 및 심볼릭 링크\n",
64
+ "if not os.path.exists(modelpath):\n",
65
+ " !mkdir -p -v \"{modelpath}\"\n",
66
+ "!ln -s -v \"{modelpath}\" \"/content/Forge/models/Stable-diffusion\"\n",
67
+ "\n",
68
+ "# lora 폴더 생성 및 심볼릭 링크\n",
69
+ "if not os.path.exists(lorapath):\n",
70
+ " !mkdir -p -v \"{lorapath}\"\n",
71
+ "!ln -s -v \"{lorapath}\" \"/content/Forge/models/Lora\"\n",
72
+ "\n",
73
+ "# vae 폴더 생성 및 심볼릭 링크\n",
74
+ "if not os.path.exists(vaepath):\n",
75
+ " !mkdir -p -v \"{vaepath}\"\n",
76
+ "!ln -s -v \"{vaepath}\" \"/content/Forge/models/VAE\""
77
+ ]
78
+ }
79
+ ]
80
+ }
reforge_drive_link.ipynb ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "private_outputs": true,
7
+ "provenance": [],
8
+ "authorship_tag": "ABX9TyNIyy6fbEqWHYPXl4Je2s/5",
9
+ "include_colab_link": true
10
+ },
11
+ "kernelspec": {
12
+ "name": "python3",
13
+ "display_name": "Python 3"
14
+ },
15
+ "language_info": {
16
+ "name": "python"
17
+ }
18
+ },
19
+ "cells": [
20
+ {
21
+ "cell_type": "markdown",
22
+ "metadata": {
23
+ "id": "view-in-github",
24
+ "colab_type": "text"
25
+ },
26
+ "source": [
27
+ "<a href=\"https://colab.research.google.com/github/arcacolab/oneclick/blob/main/reforge_drive_link.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
28
+ ]
29
+ },
30
+ {
31
+ "cell_type": "code",
32
+ "execution_count": null,
33
+ "metadata": {
34
+ "id": "aWxdMYQkMqvT"
35
+ },
36
+ "outputs": [],
37
+ "source": [
38
+ "import os\n",
39
+ "\n",
40
+ "# 모델 폴더 생성\n",
41
+ "dir_path = \"/content/ReForge/models/Stable-diffusion/\"\n",
42
+ "os.makedirs(dir_path, exist_ok=True)\n",
43
+ "dir_path = \"/content/ReForge/models/Lora/\"\n",
44
+ "os.makedirs(dir_path, exist_ok=True)\n",
45
+ "dir_path = \"/content/ReForge/models/VAE/\"\n",
46
+ "os.makedirs(dir_path, exist_ok=True)\n",
47
+ "\n",
48
+ "# Google Drive 경로 설정\n",
49
+ "sdpath = \"/content/drive/MyDrive/ONECLICK/\"\n",
50
+ "outputspath = sdpath + \"outputs\"\n",
51
+ "modelpath = sdpath + \"model\"\n",
52
+ "lorapath = sdpath + \"lora\"\n",
53
+ "vaepath = sdpath + \"vae\"\n",
54
+ "\n",
55
+ "# outputs 폴더 생성 및 심볼릭 링크\n",
56
+ "if not os.path.exists(outputspath):\n",
57
+ " !mkdir -p -v \"{outputspath}\"\n",
58
+ "\n",
59
+ "link_path = \"/content/ReForge/outputs\"\n",
60
+ "if not os.path.exists(link_path) and not os.path.islink(link_path):\n",
61
+ " !ln -s -v \"{outputspath}\" \"{link_path}\"\n",
62
+ "\n",
63
+ "# model 폴더 생성 및 심볼릭 링크\n",
64
+ "if not os.path.exists(modelpath):\n",
65
+ " !mkdir -p -v \"{modelpath}\"\n",
66
+ "!ln -s -v \"{modelpath}\" \"/content/ReForge/models/Stable-diffusion\"\n",
67
+ "\n",
68
+ "# lora 폴더 생성 및 심볼릭 링크\n",
69
+ "if not os.path.exists(lorapath):\n",
70
+ " !mkdir -p -v \"{lorapath}\"\n",
71
+ "!ln -s -v \"{lorapath}\" \"/content/ReForge/models/Lora\"\n",
72
+ "\n",
73
+ "# vae 폴더 생성 및 심볼릭 링크\n",
74
+ "if not os.path.exists(vaepath):\n",
75
+ " !mkdir -p -v \"{vaepath}\"\n",
76
+ "!ln -s -v \"{vaepath}\" \"/content/ReForge/models/VAE\""
77
+ ]
78
+ }
79
+ ]
80
+ }