arcacolab commited on
Commit
f69753d
·
verified ·
1 Parent(s): ed8b023

Upload 4 files

Browse files
a1111_drive_link.py ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ """a1111_drive_link.ipynb
3
+
4
+ Automatically generated by Colab.
5
+
6
+ Original file is located at
7
+ https://colab.research.google.com/#fileId=https%3A//huggingface.co/arcacolab/drive_link/blob/main/a1111_drive_link.ipynb
8
+
9
+ <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>
10
+ """
11
+
12
+ import os
13
+
14
+ # 모델 폴더 생성
15
+ dir_path = "/content/A1111/models/Stable-diffusion/"
16
+ os.makedirs(dir_path, exist_ok=True)
17
+ dir_path = "/content/A1111/models/Lora/"
18
+ os.makedirs(dir_path, exist_ok=True)
19
+ dir_path = "/content/A1111/models/VAE/"
20
+ os.makedirs(dir_path, exist_ok=True)
21
+ dir_path = "/content/A1111/embeddings"
22
+ os.makedirs(dir_path, exist_ok=True)
23
+
24
+ # Google Drive 경로 설정
25
+ sdpath = "/content/drive/MyDrive/ONECLICK/"
26
+ outputspath = sdpath + "outputs"
27
+ modelpath = sdpath + "model"
28
+ lorapath = sdpath + "lora"
29
+ vaepath = sdpath + "vae"
30
+ embeddingspath = sdpath + "embedding"
31
+
32
+ # outputs 폴더 생성 및 심볼릭 링크
33
+ if not os.path.exists(outputspath):
34
+ !mkdir -p -v "{outputspath}"
35
+
36
+ link_path = "/content/A1111/outputs"
37
+ if not os.path.exists(link_path) and not os.path.islink(link_path):
38
+ !ln -s -v "{outputspath}" "{link_path}"
39
+
40
+ # model 폴더 생성 및 심볼릭 링크
41
+ if not os.path.exists(modelpath):
42
+ !mkdir -p -v "{modelpath}"
43
+ !ln -s -v "{modelpath}" "/content/A1111/models/Stable-diffusion"
44
+
45
+ # lora 폴더 생성 및 심볼릭 링크
46
+ if not os.path.exists(lorapath):
47
+ !mkdir -p -v "{lorapath}"
48
+ !ln -s -v "{lorapath}" "/content/A1111/models/Lora"
49
+
50
+ # vae 폴더 생성 및 심볼릭 링크
51
+ if not os.path.exists(vaepath):
52
+ !mkdir -p -v "{vaepath}"
53
+ !ln -s -v "{vaepath}" "/content/A1111/models/VAE"
54
+
55
+ # embeddings 폴더 생성 및 심볼릭 링크
56
+ if not os.path.exists(embeddingspath):
57
+ !mkdir -p -v "{embeddingspath}"
58
+ !ln -s -v "{embeddingspath}" "/content/A1111/embeddings"
comfyui_drive_link.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ """comfyui_drive_link.ipynb
3
+
4
+ Automatically generated by Colab.
5
+
6
+ Original file is located at
7
+ https://colab.research.google.com/#fileId=https%3A//huggingface.co/arcacolab/drive_link/blob/main/comfyui_drive_link.ipynb
8
+
9
+ <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>
10
+ """
11
+
12
+ import os
13
+ source_checkpoints = "/content/ComfyUI/models/checkpoints"
14
+ target_checkpoints = "/content/drive/MyDrive/ONECLICK/model"
15
+ source_loras = "/content/ComfyUI/models/loras"
16
+ target_loras = "/content/drive/MyDrive/ONECLICK/lora"
17
+ source_vae = "/content/ComfyUI/models/vae"
18
+ target_vae = "/content/drive/MyDrive/ONECLICK/vae"
19
+ source_embeddings = "/content/ComfyUI/models/embeddings"
20
+ target_embeddings = "/content/drive/MyDrive/ONECLICK/embedding"
21
+
22
+ os.makedirs(target_checkpoints, exist_ok=True)
23
+ os.makedirs(target_loras, exist_ok=True)
24
+ os.makedirs(target_vae, exist_ok=True)
25
+ os.makedirs(target_embeddings, exist_ok=True)
26
+
27
+ !ln -sf "{target_checkpoints}" "{source_checkpoints}"
28
+ !ln -sf "{target_loras}" "{source_loras}"
29
+ !ln -sf "{target_vae}" "{source_vae}"
30
+ !ln -sf "{target_embeddings}" "{source_embeddings}"
31
+
32
+ #출력물 경로 관련
33
+ import shutil
34
+
35
+ def delete_output_folder_if_file_exists():
36
+ """
37
+ /content/ComfyUI/output 폴더 내부에 _output_images_will_be_put_here 파일이 있는 경우 폴더를 삭제합니다.
38
+ 파일이 없는 경우 폴더를 유지합니다.
39
+ """
40
+ folder_path = "/content/ComfyUI/output"
41
+ file_path = os.path.join(folder_path, "_output_images_will_be_put_here")
42
+
43
+ if os.path.exists(file_path):
44
+ shutil.rmtree(folder_path, ignore_errors=True)
45
+ print(f"{folder_path} 폴더를 삭제했습니다. (_output_images_will_be_put_here 파일이 존재합니다.)")
46
+ else:
47
+ print(f"{folder_path} 폴더를 유지합니다. (_output_images_will_be_put_here 파일이 존재하지 않습니다.)")
48
+
49
+ # 함수 호출
50
+ delete_output_folder_if_file_exists()
51
+
52
+
53
+ import os
54
+ sdpath = "/content/drive/MyDrive/ONECLICK/"
55
+
56
+ outputspath = sdpath + "output"
57
+
58
+
59
+ if not os.path.exists(outputspath):
60
+ !mkdir -p -v "{outputspath}"
61
+
62
+ link_path = "/content/ComfyUI/output"
63
+ if not os.path.exists(link_path) and not os.path.islink(link_path):
64
+ !ln -s -v "{outputspath}" "{link_path}"
forge_drive_link.py ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ """forge_drive_link.ipynb
3
+
4
+ Automatically generated by Colab.
5
+
6
+ Original file is located at
7
+ https://colab.research.google.com/#fileId=https%3A//huggingface.co/arcacolab/drive_link/blob/main/forge_drive_link.ipynb
8
+
9
+ <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>
10
+ """
11
+
12
+ import os
13
+
14
+ # 모델 폴더 생성
15
+ dir_path = "/content/Forge/models/Stable-diffusion/"
16
+ os.makedirs(dir_path, exist_ok=True)
17
+ dir_path = "/content/Forge/models/Lora/"
18
+ os.makedirs(dir_path, exist_ok=True)
19
+ dir_path = "/content/Forge/models/VAE/"
20
+ os.makedirs(dir_path, exist_ok=True)
21
+ dir_path = "/content/Forge/embeddings"
22
+ os.makedirs(dir_path, exist_ok=True)
23
+
24
+ # Google Drive 경로 설정
25
+ sdpath = "/content/drive/MyDrive/ONECLICK/"
26
+ outputspath = sdpath + "outputs"
27
+ modelpath = sdpath + "model"
28
+ lorapath = sdpath + "lora"
29
+ vaepath = sdpath + "vae"
30
+ embeddingspath = sdpath + "embedding"
31
+
32
+ # outputs 폴더 생성 및 심볼릭 링크
33
+ if not os.path.exists(outputspath):
34
+ !mkdir -p -v "{outputspath}"
35
+
36
+ link_path = "/content/Forge/outputs"
37
+ if not os.path.exists(link_path) and not os.path.islink(link_path):
38
+ !ln -s -v "{outputspath}" "{link_path}"
39
+
40
+ # model 폴더 생성 및 심볼릭 링크
41
+ if not os.path.exists(modelpath):
42
+ !mkdir -p -v "{modelpath}"
43
+ !ln -s -v "{modelpath}" "/content/Forge/models/Stable-diffusion"
44
+
45
+ # lora 폴더 생성 및 심볼릭 링크
46
+ if not os.path.exists(lorapath):
47
+ !mkdir -p -v "{lorapath}"
48
+ !ln -s -v "{lorapath}" "/content/Forge/models/Lora"
49
+
50
+ # vae 폴더 생성 및 심볼릭 링크
51
+ if not os.path.exists(vaepath):
52
+ !mkdir -p -v "{vaepath}"
53
+ !ln -s -v "{vaepath}" "/content/Forge/models/VAE"
54
+
55
+ # embeddings 폴더 생성 및 그시기
56
+ if not os.path.exists(embeddingspath):
57
+ !mkdir -p -v "{embeddingspath}"
58
+ !ln -s -v "{embeddingspath}" "/content/Forge/embeddings"
reforge_drive_link.py ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ """reforge_drive_link.ipynb
3
+
4
+ Automatically generated by Colab.
5
+
6
+ Original file is located at
7
+ https://colab.research.google.com/#fileId=https%3A//huggingface.co/arcacolab/drive_link/blob/main/reforge_drive_link.ipynb
8
+
9
+ <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>
10
+ """
11
+
12
+ import os
13
+
14
+ # 모델 폴더 생성
15
+ dir_path = "/content/ReForge/models/Stable-diffusion/"
16
+ os.makedirs(dir_path, exist_ok=True)
17
+ dir_path = "/content/ReForge/models/Lora/"
18
+ os.makedirs(dir_path, exist_ok=True)
19
+ dir_path = "/content/ReForge/models/VAE/"
20
+ os.makedirs(dir_path, exist_ok=True)
21
+ dir_path = "/content/ReForge/embeddings/"
22
+ os.makedirs(dir_path, exist_ok=True)
23
+
24
+
25
+ # Google Drive 경로 설정
26
+ sdpath = "/content/drive/MyDrive/ONECLICK/"
27
+ outputspath = sdpath + "outputs"
28
+ modelpath = sdpath + "model"
29
+ lorapath = sdpath + "lora"
30
+ vaepath = sdpath + "vae"
31
+ embeddingspath = sdpath + "embedding"
32
+
33
+ # outputs 폴더 생성 및 심볼릭 링크
34
+ if not os.path.exists(outputspath):
35
+ !mkdir -p -v "{outputspath}"
36
+
37
+ link_path = "/content/ReForge/outputs"
38
+ if not os.path.exists(link_path) and not os.path.islink(link_path):
39
+ !ln -s -v "{outputspath}" "{link_path}"
40
+
41
+ # model 폴더 생성 및 심볼릭 링크
42
+ if not os.path.exists(modelpath):
43
+ !mkdir -p -v "{modelpath}"
44
+ !ln -s -v "{modelpath}" "/content/ReForge/models/Stable-diffusion"
45
+
46
+ # lora 폴더 생성 및 심볼릭 링크
47
+ if not os.path.exists(lorapath):
48
+ !mkdir -p -v "{lorapath}"
49
+ !ln -s -v "{lorapath}" "/content/ReForge/models/Lora"
50
+
51
+ # vae 폴더 생성 및 심볼릭 링크
52
+ if not os.path.exists(vaepath):
53
+ !mkdir -p -v "{vaepath}"
54
+ !ln -s -v "{vaepath}" "/content/ReForge/models/VAE"
55
+
56
+ # embeddings 폴더 생성 및 그시기
57
+ if not os.path.exists(embeddingspath):
58
+ !mkdir -p -v "{embeddingspath}"
59
+ !ln -s -v "{embeddingspath}" "/content/ReForge/embeddings"