eseutiblog commited on
Commit
104835f
1 Parent(s): 9fedc3f

Upload 3 files

Browse files
기본 확장,로라,모델,vae, 임베딩.ipynb ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 3,
6
+ "id": "41c4f308-b68a-46b3-8ae7-1c7d46c981e4",
7
+ "metadata": {},
8
+ "outputs": [
9
+ {
10
+ "name": "stdout",
11
+ "output_type": "stream",
12
+ "text": [
13
+ "--2023-02-06 09:16:04-- https://huggingface.co/syaimu/7th_Layer/resolve/main/7th_anime_v3/7th_anime_v3_A.safetensors\n",
14
+ "Resolving huggingface.co (huggingface.co)... 3.231.67.228, 54.235.118.239, 2600:1f18:147f:e800:671:b733:ecf3:a585, ...\n",
15
+ "Connecting to huggingface.co (huggingface.co)|3.231.67.228|:443... connected.\n",
16
+ "HTTP request sent, awaiting response... 302 Found\n",
17
+ "Location: https://cdn-lfs.huggingface.co/repos/0c/8c/0c8c3a139a854a317f227f1f1c2f695f4e7f15fa728359e39f1b6085d4c23d36/c330a60ddcb49c61109dbd7c28cf326733dadb77984c6e8d162bdc200a05df9e?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%277th_anime_v3_A.safetensors%3B+filename%3D%227th_anime_v3_A.safetensors%22%3B&Expires=1675933915&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzBjLzhjLzBjOGMzYTEzOWE4NTRhMzE3ZjIyN2YxZjFjMmY2OTVmNGU3ZjE1ZmE3MjgzNTllMzlmMWI2MDg1ZDRjMjNkMzYvYzMzMGE2MGRkY2I0OWM2MTEwOWRiZDdjMjhjZjMyNjczM2RhZGI3Nzk4NGM2ZThkMTYyYmRjMjAwYTA1ZGY5ZT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2NzU5MzM5MTV9fX1dfQ__&Signature=WLQ4Kifv-3QwBHonSdrZOx7Ef0Z0iyV6danwso-DE2jaEj7JckLyYtMjhTLbjAHhULHsx-MZTrqnWFweXxg2%7E0Qg0zKwcA-UNYGcsPisO8jr2CHLkWvEhcB53cBZhSYktnzOKHt75M837DG6-IyDePIYjlSLcYRTQRRPWM3WrQB2GkRGUVdo6tfOW4wOBld%7ELB2FE--NIABzhm0WJoCQ-%7E23QYayFAn%7ELB5yZJvbBTcKiJmljZg8BRhwVrEsIWjVdRrna4yl3TXe6Dv-qCjJvtu%7Eit9BehWAjmhCCN1jsiowo51UcOeElvGuVz9gs-c4XAOv8ZH2GBYzPkNHvsBFAg__&Key-Pair-Id=KVTP0A1DKRTAX [following]\n",
18
+ "--2023-02-06 09:16:05-- https://cdn-lfs.huggingface.co/repos/0c/8c/0c8c3a139a854a317f227f1f1c2f695f4e7f15fa728359e39f1b6085d4c23d36/c330a60ddcb49c61109dbd7c28cf326733dadb77984c6e8d162bdc200a05df9e?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%277th_anime_v3_A.safetensors%3B+filename%3D%227th_anime_v3_A.safetensors%22%3B&Expires=1675933915&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzBjLzhjLzBjOGMzYTEzOWE4NTRhMzE3ZjIyN2YxZjFjMmY2OTVmNGU3ZjE1ZmE3MjgzNTllMzlmMWI2MDg1ZDRjMjNkMzYvYzMzMGE2MGRkY2I0OWM2MTEwOWRiZDdjMjhjZjMyNjczM2RhZGI3Nzk4NGM2ZThkMTYyYmRjMjAwYTA1ZGY5ZT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2NzU5MzM5MTV9fX1dfQ__&Signature=WLQ4Kifv-3QwBHonSdrZOx7Ef0Z0iyV6danwso-DE2jaEj7JckLyYtMjhTLbjAHhULHsx-MZTrqnWFweXxg2%7E0Qg0zKwcA-UNYGcsPisO8jr2CHLkWvEhcB53cBZhSYktnzOKHt75M837DG6-IyDePIYjlSLcYRTQRRPWM3WrQB2GkRGUVdo6tfOW4wOBld%7ELB2FE--NIABzhm0WJoCQ-%7E23QYayFAn%7ELB5yZJvbBTcKiJmljZg8BRhwVrEsIWjVdRrna4yl3TXe6Dv-qCjJvtu%7Eit9BehWAjmhCCN1jsiowo51UcOeElvGuVz9gs-c4XAOv8ZH2GBYzPkNHvsBFAg__&Key-Pair-Id=KVTP0A1DKRTAX\n",
19
+ "Resolving cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)... 99.86.63.67, 99.86.63.91, 99.86.63.37, ...\n",
20
+ "Connecting to cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)|99.86.63.67|:443... connected.\n",
21
+ "HTTP request sent, awaiting response... 200 OK\n",
22
+ "Length: 4265096689 (4.0G) [binary/octet-stream]\n",
23
+ "Saving to: ‘/workspace/stable-diffusion-webui/models/Stable-diffusion/7th_anime_v3_A.safetensors’\n",
24
+ "\n",
25
+ "7th_anime_v3_A.safe 100%[===================>] 3.97G 189MB/s in 23s \n",
26
+ "\n",
27
+ "2023-02-06 09:16:28 (174 MB/s) - ‘/workspace/stable-diffusion-webui/models/Stable-diffusion/7th_anime_v3_A.safetensors’ saved [4265096689/4265096689]\n",
28
+ "\n"
29
+ ]
30
+ }
31
+ ],
32
+ "source": [
33
+ "# ------------------------------------------------\n",
34
+ "# 다운로드할 모델의 URL\n",
35
+ "model_urls = '''\n",
36
+ "https://huggingface.co/BanKaiPls/AsianModel/resolve/main/BRAV5finalfp16.safetensors\n",
37
+ "https://huggingface.co/syaimu/7th_Layer/resolve/main/7th_anime_v3/7th_anime_v3_A.safetensors\n",
38
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/zemihr_v2.safetensors\n",
39
+ "'''\n",
40
+ "\n",
41
+ "vae_urls = '''\n",
42
+ "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors\n",
43
+ "'''\n",
44
+ "\n",
45
+ "lora_urls = '''\n",
46
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/aliceNikke_v30.safetensors\n",
47
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/cuteGirlMix4_v10.safetensors\n",
48
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/epiNoiseoffset_v2.safetensors\n",
49
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/fashionGirl_v52.safetensors\n",
50
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/girlfriendmixV1_v20.safetensors\n",
51
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/gymtastic_v11.safetensors\n",
52
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/shojovibe_v11.safetensors\n",
53
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/spiderwoman_cosplay_outfit.safetensors\n",
54
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/volleyballUniform_v20Lora.safetensors\n",
55
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/hipoly3DModelLora_v20.safetensors\n",
56
+ "'''\n",
57
+ "\n",
58
+ "embeding_urls = '''\n",
59
+ "https://huggingface.co/nancho2/nancho_runpods/resolve/main/NG_DeepNegative_V1_75T.pt\n",
60
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/bad_prompt_version2.pt\n",
61
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/badhandv4.pt\n",
62
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/easynegative.safetensors\n",
63
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/pureerosface_v1.pt\n",
64
+ "https://huggingface.co/eseutiblog/RunPod_database/resolve/main/ulzzang-6500-v1.1.bin\n",
65
+ "'''\n",
66
+ "\n",
67
+ "controlnet_urls = '''\n",
68
+ "'''\n",
69
+ "\n",
70
+ "# 기본 프롬프트\n",
71
+ "positive = 'masterpiece, best quality, highres, 1girl, '\n",
72
+ "negative = '(worst quality:1.9), (low quality:1.9), (normal quality:1.9), lowres, (infant, loli:1.5), '\n",
73
+ "\n",
74
+ "# 설치할 확장 기능\n",
75
+ "extensions = '''\n",
76
+ "https://github.com/nonnonstop/sd-webui-3d-open-pose-editor\n",
77
+ "https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper.git\n",
78
+ "https://github.com/Mikubill/sd-webui-controlnet\n",
79
+ "https://github.com/hnmr293/sd-webui-cutoff\n",
80
+ "https://github.com/DominikDoom/a1111-sd-webui-tagcomplete\n",
81
+ "https://github.com/adieyal/sd-dynamic-prompts.git\n",
82
+ "https://github.com/mcmonkeyprojects/sd-dynamic-thresholding\n",
83
+ "https://github.com/nonnonstop/sd-webui-3d-open-pose-editor\n",
84
+ "https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111\n",
85
+ "https://github.com/NeoGraph-K/sd-webui-ddsd\n",
86
+ "https://github.com/vladmandic/sd-extension-system-info\n",
87
+ "https://github.com/hako-mikan/sd-webui-supermerger\n",
88
+ "https://github.com/toriato/stable-diffusion-webui-wd14-tagger\n",
89
+ "https://github.com/richrobber2/canvas-zoom\n",
90
+ "https://github.com/kousw/stable-diffusion-webui-daam\n",
91
+ "https://github.com/kohya-ss/sd-webui-additional-networks\n",
92
+ "https://github.com/mix1009/model-keyword\n",
93
+ "https://github.com/zanllp/sd-webui-infinite-image-browsing\n",
94
+ "'''\n",
95
+ "# ------------------------------------------------\n",
96
+ "\n",
97
+ "import os\n",
98
+ "import json\n",
99
+ "import shutil\n",
100
+ "\n",
101
+ "home_dir = os.getcwd()\n",
102
+ "repo_dir = os.path.join(home_dir, 'stable-diffusion-webui')\n",
103
+ "os.chdir(repo_dir)\n",
104
+ "\n",
105
+ "# 원래 있는 sd 모델 삭제\n",
106
+ "for i in [x for x in os.listdir(home_dir) if x.endswith('.ckpt')]:\n",
107
+ " os.remove(os.path.join(home_dir, i))\n",
108
+ "\n",
109
+ "# 모델 다운로드\n",
110
+ "models_dir = os.path.join(repo_dir, 'models', 'Stable-diffusion')\n",
111
+ "for i in [x.strip() for x in model_urls.split('\\n') if x]:\n",
112
+ " ! wget {i} -P {models_dir}\n",
113
+ "\n",
114
+ "# vae 다운로드\n",
115
+ "vae_dir = os.path.join(repo_dir, 'models', 'VAE')\n",
116
+ "for i in [x.strip() for x in vae_urls.split('\\n') if x]:\n",
117
+ " ! wget {i} -P {vae_dir}\n",
118
+ "\n",
119
+ "# lora 다운로드\n",
120
+ "lora_dir = os.path.join(repo_dir, 'models', 'Lora')\n",
121
+ "for i in [x.strip() for x in lora_urls.split('\\n') if x]:\n",
122
+ " ! wget {i} -P {lora_dir}\n",
123
+ "\n",
124
+ "# embeding 다운로드\n",
125
+ "embeding_dir = os.path.join(repo_dir, 'embeddings')\n",
126
+ "for i in [x.strip() for x in embeding_urls.split('\\n') if x]:\n",
127
+ " ! wget {i} -P {embeding_dir}\n",
128
+ "\n",
129
+ "# controlnet 다운로드\n",
130
+ "controlnet_dir = os.path.join(repo_dir, 'extensions', 'sd-webui-controlnet', 'models')\n",
131
+ "for i in [x.strip() for x in controlnet_urls.split('\\n') if x]:\n",
132
+ " ! wget {i} -P {controlnet_dir}\n",
133
+ "\n",
134
+ "# ui-config.json 백업\n",
135
+ "ui_conf_path = os.path.join(repo_dir, 'ui-config.json')\n",
136
+ "ui_conf_bk_path = os.path.join(repo_dir, 'ui-config_bk.json')\n",
137
+ "if not os.path.exists(ui_conf_bk_path):\n",
138
+ " shutil.copy(ui_conf_path, ui_conf_bk_path)\n",
139
+ "with open(ui_conf_path, 'r', encoding='utf-8') as f:\n",
140
+ " orig_ui = json.load(f)\n",
141
+ " ur_ui = orig_ui\n",
142
+ "\n",
143
+ "# ui-config.json 수정\n",
144
+ "ur_ui['txt2img/Prompt/value'] = positive\n",
145
+ "ur_ui['txt2img/Negative prompt/value'] = negative\n",
146
+ "\n",
147
+ "ur_ui['img2img/Prompt/value'] = positive\n",
148
+ "ur_ui['img2img/Negative prompt/value'] = negative\n",
149
+ "\n",
150
+ "# 파일 저장\n",
151
+ "with open(ui_conf_path, 'w', encoding='utf-8') as f:\n",
152
+ " json.dump(ur_ui, f, indent=4)\n",
153
+ "\n",
154
+ "# 필요한 확장 모듈 설치\n",
155
+ "ext_dir = os.path.join(repo_dir, 'extensions')\n",
156
+ "os.chdir(ext_dir)\n",
157
+ "for i in [x.strip() for x in extensions.split('\\n') if x]:\n",
158
+ " ! git clone {i}\n",
159
+ "os.chdir(home_dir)"
160
+ ]
161
+ }
162
+ ],
163
+ "metadata": {
164
+ "kernelspec": {
165
+ "display_name": "Python 3",
166
+ "language": "python",
167
+ "name": "python3"
168
+ },
169
+ "language_info": {
170
+ "codemirror_mode": {
171
+ "name": "ipython",
172
+ "version": 3
173
+ },
174
+ "file_extension": ".py",
175
+ "mimetype": "text/x-python",
176
+ "name": "python",
177
+ "nbconvert_exporter": "python",
178
+ "pygments_lexer": "ipython3",
179
+ "version": "3.10.8"
180
+ },
181
+ "vscode": {
182
+ "interpreter": {
183
+ "hash": "c36c8ff63afb68809d72fa6323bde02fb9b90fe01b492d36c13befd021790766"
184
+ }
185
+ }
186
+ },
187
+ "nbformat": 4,
188
+ "nbformat_minor": 5
189
+ }
추가 설치 통합.ipynb ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 3,
6
+ "id": "41c4f308-b68a-46b3-8ae7-1c7d46c981e4",
7
+ "metadata": {},
8
+ "outputs": [
9
+ {
10
+ "name": "stdout",
11
+ "output_type": "stream",
12
+ "text": [
13
+ "--2023-02-06 09:16:04-- https://huggingface.co/syaimu/7th_Layer/resolve/main/7th_anime_v3/7th_anime_v3_A.safetensors\n",
14
+ "Resolving huggingface.co (huggingface.co)... 3.231.67.228, 54.235.118.239, 2600:1f18:147f:e800:671:b733:ecf3:a585, ...\n",
15
+ "Connecting to huggingface.co (huggingface.co)|3.231.67.228|:443... connected.\n",
16
+ "HTTP request sent, awaiting response... 302 Found\n",
17
+ "Location: https://cdn-lfs.huggingface.co/repos/0c/8c/0c8c3a139a854a317f227f1f1c2f695f4e7f15fa728359e39f1b6085d4c23d36/c330a60ddcb49c61109dbd7c28cf326733dadb77984c6e8d162bdc200a05df9e?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%277th_anime_v3_A.safetensors%3B+filename%3D%227th_anime_v3_A.safetensors%22%3B&Expires=1675933915&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzBjLzhjLzBjOGMzYTEzOWE4NTRhMzE3ZjIyN2YxZjFjMmY2OTVmNGU3ZjE1ZmE3MjgzNTllMzlmMWI2MDg1ZDRjMjNkMzYvYzMzMGE2MGRkY2I0OWM2MTEwOWRiZDdjMjhjZjMyNjczM2RhZGI3Nzk4NGM2ZThkMTYyYmRjMjAwYTA1ZGY5ZT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2NzU5MzM5MTV9fX1dfQ__&Signature=WLQ4Kifv-3QwBHonSdrZOx7Ef0Z0iyV6danwso-DE2jaEj7JckLyYtMjhTLbjAHhULHsx-MZTrqnWFweXxg2%7E0Qg0zKwcA-UNYGcsPisO8jr2CHLkWvEhcB53cBZhSYktnzOKHt75M837DG6-IyDePIYjlSLcYRTQRRPWM3WrQB2GkRGUVdo6tfOW4wOBld%7ELB2FE--NIABzhm0WJoCQ-%7E23QYayFAn%7ELB5yZJvbBTcKiJmljZg8BRhwVrEsIWjVdRrna4yl3TXe6Dv-qCjJvtu%7Eit9BehWAjmhCCN1jsiowo51UcOeElvGuVz9gs-c4XAOv8ZH2GBYzPkNHvsBFAg__&Key-Pair-Id=KVTP0A1DKRTAX [following]\n",
18
+ "--2023-02-06 09:16:05-- https://cdn-lfs.huggingface.co/repos/0c/8c/0c8c3a139a854a317f227f1f1c2f695f4e7f15fa728359e39f1b6085d4c23d36/c330a60ddcb49c61109dbd7c28cf326733dadb77984c6e8d162bdc200a05df9e?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%277th_anime_v3_A.safetensors%3B+filename%3D%227th_anime_v3_A.safetensors%22%3B&Expires=1675933915&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzBjLzhjLzBjOGMzYTEzOWE4NTRhMzE3ZjIyN2YxZjFjMmY2OTVmNGU3ZjE1ZmE3MjgzNTllMzlmMWI2MDg1ZDRjMjNkMzYvYzMzMGE2MGRkY2I0OWM2MTEwOWRiZDdjMjhjZjMyNjczM2RhZGI3Nzk4NGM2ZThkMTYyYmRjMjAwYTA1ZGY5ZT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2NzU5MzM5MTV9fX1dfQ__&Signature=WLQ4Kifv-3QwBHonSdrZOx7Ef0Z0iyV6danwso-DE2jaEj7JckLyYtMjhTLbjAHhULHsx-MZTrqnWFweXxg2%7E0Qg0zKwcA-UNYGcsPisO8jr2CHLkWvEhcB53cBZhSYktnzOKHt75M837DG6-IyDePIYjlSLcYRTQRRPWM3WrQB2GkRGUVdo6tfOW4wOBld%7ELB2FE--NIABzhm0WJoCQ-%7E23QYayFAn%7ELB5yZJvbBTcKiJmljZg8BRhwVrEsIWjVdRrna4yl3TXe6Dv-qCjJvtu%7Eit9BehWAjmhCCN1jsiowo51UcOeElvGuVz9gs-c4XAOv8ZH2GBYzPkNHvsBFAg__&Key-Pair-Id=KVTP0A1DKRTAX\n",
19
+ "Resolving cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)... 99.86.63.67, 99.86.63.91, 99.86.63.37, ...\n",
20
+ "Connecting to cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)|99.86.63.67|:443... connected.\n",
21
+ "HTTP request sent, awaiting response... 200 OK\n",
22
+ "Length: 4265096689 (4.0G) [binary/octet-stream]\n",
23
+ "Saving to: ‘/workspace/stable-diffusion-webui/models/Stable-diffusion/7th_anime_v3_A.safetensors’\n",
24
+ "\n",
25
+ "7th_anime_v3_A.safe 100%[===================>] 3.97G 189MB/s in 23s \n",
26
+ "\n",
27
+ "2023-02-06 09:16:28 (174 MB/s) - ‘/workspace/stable-diffusion-webui/models/Stable-diffusion/7th_anime_v3_A.safetensors’ saved [4265096689/4265096689]\n",
28
+ "\n"
29
+ ]
30
+ }
31
+ ],
32
+ "source": [
33
+ "# ------------------------------------------------\n",
34
+ "# 다운로드할 모델의 URL\n",
35
+ "model_urls = '''\n",
36
+ "다운받을 모델 링크를 여기에 넣어주세요.\n",
37
+ "'''\n",
38
+ "\n",
39
+ "vae_urls = '''\n",
40
+ "다운받을 vae 링크를 여기에 넣어주세요.\n",
41
+ "'''\n",
42
+ "\n",
43
+ "lora_urls = '''\n",
44
+ "다운받을 lora링크를 여기에 넣어주세요.\n",
45
+ "'''\n",
46
+ "\n",
47
+ "embeding_urls = '''\n",
48
+ "다운받을 embeding 링크를 여기에 넣어주세요.\n",
49
+ "'''\n",
50
+ "\n",
51
+ "controlnet_urls = '''\n",
52
+ "'''\n",
53
+ "\n",
54
+ "# 기본 프롬프트\n",
55
+ "positive = 'masterpiece, best quality, highres, 1girl, '\n",
56
+ "negative = '(worst quality:1.9), (low quality:1.9), (normal quality:1.9), lowres, (infant, loli:1.5), '\n",
57
+ "\n",
58
+ "# 설치할 확장 기능\n",
59
+ "extensions = '''\n",
60
+ "설치할 확장링크를 넣어주세요. 확장은 WEB UI 내에서 받으시는 것을 추천드립니다.\n",
61
+ "'''\n",
62
+ "# ------------------------------------------------\n",
63
+ "\n",
64
+ "import os\n",
65
+ "import json\n",
66
+ "import shutil\n",
67
+ "\n",
68
+ "home_dir = os.getcwd()\n",
69
+ "repo_dir = os.path.join(home_dir, 'stable-diffusion-webui')\n",
70
+ "os.chdir(repo_dir)\n",
71
+ "\n",
72
+ "# 원래 있는 sd 모델 삭제\n",
73
+ "for i in [x for x in os.listdir(home_dir) if x.endswith('.ckpt')]:\n",
74
+ " os.remove(os.path.join(home_dir, i))\n",
75
+ "\n",
76
+ "# 모델 다운로드\n",
77
+ "models_dir = os.path.join(repo_dir, 'models', 'Stable-diffusion')\n",
78
+ "for i in [x.strip() for x in model_urls.split('\\n') if x]:\n",
79
+ " ! wget {i} -P {models_dir}\n",
80
+ "\n",
81
+ "# vae 다운로드\n",
82
+ "vae_dir = os.path.join(repo_dir, 'models', 'VAE')\n",
83
+ "for i in [x.strip() for x in vae_urls.split('\\n') if x]:\n",
84
+ " ! wget {i} -P {vae_dir}\n",
85
+ "\n",
86
+ "# lora 다운로드\n",
87
+ "lora_dir = os.path.join(repo_dir, 'models', 'Lora')\n",
88
+ "for i in [x.strip() for x in lora_urls.split('\\n') if x]:\n",
89
+ " ! wget {i} -P {lora_dir}\n",
90
+ "\n",
91
+ "# embeding 다운로드\n",
92
+ "embeding_dir = os.path.join(repo_dir, 'embeddings')\n",
93
+ "for i in [x.strip() for x in embeding_urls.split('\\n') if x]:\n",
94
+ " ! wget {i} -P {embeding_dir}\n",
95
+ "\n",
96
+ "# controlnet 다운로드\n",
97
+ "controlnet_dir = os.path.join(repo_dir, 'extensions', 'sd-webui-controlnet', 'models')\n",
98
+ "for i in [x.strip() for x in controlnet_urls.split('\\n') if x]:\n",
99
+ " ! wget {i} -P {controlnet_dir}\n",
100
+ "\n",
101
+ "# ui-config.json 백업\n",
102
+ "ui_conf_path = os.path.join(repo_dir, 'ui-config.json')\n",
103
+ "ui_conf_bk_path = os.path.join(repo_dir, 'ui-config_bk.json')\n",
104
+ "if not os.path.exists(ui_conf_bk_path):\n",
105
+ " shutil.copy(ui_conf_path, ui_conf_bk_path)\n",
106
+ "with open(ui_conf_path, 'r', encoding='utf-8') as f:\n",
107
+ " orig_ui = json.load(f)\n",
108
+ " ur_ui = orig_ui\n",
109
+ "\n",
110
+ "# ui-config.json 수정\n",
111
+ "ur_ui['txt2img/Prompt/value'] = positive\n",
112
+ "ur_ui['txt2img/Negative prompt/value'] = negative\n",
113
+ "\n",
114
+ "ur_ui['img2img/Prompt/value'] = positive\n",
115
+ "ur_ui['img2img/Negative prompt/value'] = negative\n",
116
+ "\n",
117
+ "# 파일 저장\n",
118
+ "with open(ui_conf_path, 'w', encoding='utf-8') as f:\n",
119
+ " json.dump(ur_ui, f, indent=4)\n",
120
+ "\n",
121
+ "# 필요한 확장 모듈 설치\n",
122
+ "ext_dir = os.path.join(repo_dir, 'extensions')\n",
123
+ "os.chdir(ext_dir)\n",
124
+ "for i in [x.strip() for x in extensions.split('\\n') if x]:\n",
125
+ " ! git clone {i}\n",
126
+ "os.chdir(home_dir)"
127
+ ]
128
+ }
129
+ ],
130
+ "metadata": {
131
+ "kernelspec": {
132
+ "display_name": "Python 3",
133
+ "language": "python",
134
+ "name": "python3"
135
+ },
136
+ "language_info": {
137
+ "codemirror_mode": {
138
+ "name": "ipython",
139
+ "version": 3
140
+ },
141
+ "file_extension": ".py",
142
+ "mimetype": "text/x-python",
143
+ "name": "python",
144
+ "nbconvert_exporter": "python",
145
+ "pygments_lexer": "ipython3",
146
+ "version": "3.10.8"
147
+ },
148
+ "vscode": {
149
+ "interpreter": {
150
+ "hash": "c36c8ff63afb68809d72fa6323bde02fb9b90fe01b492d36c13befd021790766"
151
+ }
152
+ }
153
+ },
154
+ "nbformat": 4,
155
+ "nbformat_minor": 5
156
+ }
컨트롤넷all - 오류수정.ipynb ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 3,
6
+ "id": "41c4f308-b68a-46b3-8ae7-1c7d46c981e4",
7
+ "metadata": {},
8
+ "outputs": [
9
+ {
10
+ "name": "stdout",
11
+ "output_type": "stream",
12
+ "text": [
13
+ "--2023-02-06 09:16:04-- https://huggingface.co/syaimu/7th_Layer/resolve/main/7th_anime_v3/7th_anime_v3_A.safetensors\n",
14
+ "Resolving huggingface.co (huggingface.co)... 3.231.67.228, 54.235.118.239, 2600:1f18:147f:e800:671:b733:ecf3:a585, ...\n",
15
+ "Connecting to huggingface.co (huggingface.co)|3.231.67.228|:443... connected.\n",
16
+ "HTTP request sent, awaiting response... 302 Found\n",
17
+ "Location: https://cdn-lfs.huggingface.co/repos/0c/8c/0c8c3a139a854a317f227f1f1c2f695f4e7f15fa728359e39f1b6085d4c23d36/c330a60ddcb49c61109dbd7c28cf326733dadb77984c6e8d162bdc200a05df9e?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%277th_anime_v3_A.safetensors%3B+filename%3D%227th_anime_v3_A.safetensors%22%3B&Expires=1675933915&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzBjLzhjLzBjOGMzYTEzOWE4NTRhMzE3ZjIyN2YxZjFjMmY2OTVmNGU3ZjE1ZmE3MjgzNTllMzlmMWI2MDg1ZDRjMjNkMzYvYzMzMGE2MGRkY2I0OWM2MTEwOWRiZDdjMjhjZjMyNjczM2RhZGI3Nzk4NGM2ZThkMTYyYmRjMjAwYTA1ZGY5ZT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2NzU5MzM5MTV9fX1dfQ__&Signature=WLQ4Kifv-3QwBHonSdrZOx7Ef0Z0iyV6danwso-DE2jaEj7JckLyYtMjhTLbjAHhULHsx-MZTrqnWFweXxg2%7E0Qg0zKwcA-UNYGcsPisO8jr2CHLkWvEhcB53cBZhSYktnzOKHt75M837DG6-IyDePIYjlSLcYRTQRRPWM3WrQB2GkRGUVdo6tfOW4wOBld%7ELB2FE--NIABzhm0WJoCQ-%7E23QYayFAn%7ELB5yZJvbBTcKiJmljZg8BRhwVrEsIWjVdRrna4yl3TXe6Dv-qCjJvtu%7Eit9BehWAjmhCCN1jsiowo51UcOeElvGuVz9gs-c4XAOv8ZH2GBYzPkNHvsBFAg__&Key-Pair-Id=KVTP0A1DKRTAX [following]\n",
18
+ "--2023-02-06 09:16:05-- https://cdn-lfs.huggingface.co/repos/0c/8c/0c8c3a139a854a317f227f1f1c2f695f4e7f15fa728359e39f1b6085d4c23d36/c330a60ddcb49c61109dbd7c28cf326733dadb77984c6e8d162bdc200a05df9e?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%277th_anime_v3_A.safetensors%3B+filename%3D%227th_anime_v3_A.safetensors%22%3B&Expires=1675933915&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzBjLzhjLzBjOGMzYTEzOWE4NTRhMzE3ZjIyN2YxZjFjMmY2OTVmNGU3ZjE1ZmE3MjgzNTllMzlmMWI2MDg1ZDRjMjNkMzYvYzMzMGE2MGRkY2I0OWM2MTEwOWRiZDdjMjhjZjMyNjczM2RhZGI3Nzk4NGM2ZThkMTYyYmRjMjAwYTA1ZGY5ZT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2NzU5MzM5MTV9fX1dfQ__&Signature=WLQ4Kifv-3QwBHonSdrZOx7Ef0Z0iyV6danwso-DE2jaEj7JckLyYtMjhTLbjAHhULHsx-MZTrqnWFweXxg2%7E0Qg0zKwcA-UNYGcsPisO8jr2CHLkWvEhcB53cBZhSYktnzOKHt75M837DG6-IyDePIYjlSLcYRTQRRPWM3WrQB2GkRGUVdo6tfOW4wOBld%7ELB2FE--NIABzhm0WJoCQ-%7E23QYayFAn%7ELB5yZJvbBTcKiJmljZg8BRhwVrEsIWjVdRrna4yl3TXe6Dv-qCjJvtu%7Eit9BehWAjmhCCN1jsiowo51UcOeElvGuVz9gs-c4XAOv8ZH2GBYzPkNHvsBFAg__&Key-Pair-Id=KVTP0A1DKRTAX\n",
19
+ "Resolving cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)... 99.86.63.67, 99.86.63.91, 99.86.63.37, ...\n",
20
+ "Connecting to cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)|99.86.63.67|:443... connected.\n",
21
+ "HTTP request sent, awaiting response... 200 OK\n",
22
+ "Length: 4265096689 (4.0G) [binary/octet-stream]\n",
23
+ "Saving to: ‘/workspace/stable-diffusion-webui/models/Stable-diffusion/7th_anime_v3_A.safetensors’\n",
24
+ "\n",
25
+ "7th_anime_v3_A.safe 100%[===================>] 3.97G 189MB/s in 23s \n",
26
+ "\n",
27
+ "2023-02-06 09:16:28 (174 MB/s) - ‘/workspace/stable-diffusion-webui/models/Stable-diffusion/7th_anime_v3_A.safetensors’ saved [4265096689/4265096689]\n",
28
+ "\n"
29
+ ]
30
+ }
31
+ ],
32
+ "source": [
33
+ "# ------------------------------------------------\n",
34
+ "# 다운로드할 모델의 URL\n",
35
+ "model_urls = '''\n",
36
+ "'''\n",
37
+ "\n",
38
+ "vae_urls = '''\n",
39
+ "'''\n",
40
+ "\n",
41
+ "lora_urls = '''\n",
42
+ "'''\n",
43
+ "\n",
44
+ "controlnet_urls = '''\n",
45
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11f1p_sd15_depth_fp16.safetensors\n",
46
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_canny_fp16.safetensors\n",
47
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_lineart_fp16.safetensors\n",
48
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_inpaint_fp16.safetensors\n",
49
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_normalbae_fp16.safetensors\n",
50
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_mlsd_fp16.safetensors\n",
51
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_openpose_fp16.safetensors\n",
52
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_seg_fp16.safetensors\n",
53
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_scribble_fp16.safetensors\n",
54
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_softedge_fp16.safetensors\n",
55
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15s2_lineart_anime_fp16.safetensors\n",
56
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11e_sd15_shuffle_fp16.safetensors\n",
57
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11e_sd15_ip2p_fp16.safetensors\n",
58
+ "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11f1e_sd15_tile_fp16.safetensors\n",
59
+ "'''\n",
60
+ "\n",
61
+ "# 기본 프롬프트\n",
62
+ "positive = 'masterpiece, best quality, highres, 1girl, '\n",
63
+ "negative = '(worst quality:1.9), (low quality:1.9), (normal quality:1.9), lowres, (infant, loli:1.5), '\n",
64
+ "\n",
65
+ "# 설치할 확장 기능\n",
66
+ "extensions = '''\n",
67
+ "'''\n",
68
+ "# ------------------------------------------------\n",
69
+ "\n",
70
+ "import os\n",
71
+ "import json\n",
72
+ "import shutil\n",
73
+ "\n",
74
+ "home_dir = os.getcwd()\n",
75
+ "repo_dir = os.path.join(home_dir, 'stable-diffusion-webui')\n",
76
+ "os.chdir(repo_dir)\n",
77
+ "\n",
78
+ "# 모델 다운로드\n",
79
+ "models_dir = os.path.join(repo_dir, 'models', 'Stable-diffusion')\n",
80
+ "for i in [x.strip() for x in model_urls.split('\\n') if x]:\n",
81
+ " ! wget {i} -P {models_dir}\n",
82
+ "\n",
83
+ "# vae 다운로드\n",
84
+ "vae_dir = os.path.join(repo_dir, 'models', 'VAE')\n",
85
+ "for i in [x.strip() for x in vae_urls.split('\\n') if x]:\n",
86
+ " ! wget {i} -P {vae_dir}\n",
87
+ "\n",
88
+ "# lora 다운로드\n",
89
+ "lora_dir = os.path.join(repo_dir, 'models', 'Lora')\n",
90
+ "for i in [x.strip() for x in lora_urls.split('\\n') if x]:\n",
91
+ " ! wget {i} -P {lora_dir}\n",
92
+ "\n",
93
+ "# controlnet 다운로드\n",
94
+ "controlnet_dir = os.path.join(repo_dir, 'extensions', 'sd-webui-controlnet', 'models')\n",
95
+ "for i in [x.strip() for x in controlnet_urls.split('\\n') if x]:\n",
96
+ " ! wget {i} -P {controlnet_dir}\n",
97
+ "\n",
98
+ "# ui-config.json 백업\n",
99
+ "ui_conf_path = os.path.join(repo_dir, 'ui-config.json')\n",
100
+ "ui_conf_bk_path = os.path.join(repo_dir, 'ui-config_bk.json')\n",
101
+ "if not os.path.exists(ui_conf_bk_path):\n",
102
+ " shutil.copy(ui_conf_path, ui_conf_bk_path)\n",
103
+ "with open(ui_conf_path, 'r', encoding='utf-8') as f:\n",
104
+ " orig_ui = json.load(f)\n",
105
+ " ur_ui = orig_ui\n",
106
+ "\n",
107
+ "# ui-config.json 수정\n",
108
+ "ur_ui['txt2img/Prompt/value'] = positive\n",
109
+ "ur_ui['txt2img/Negative prompt/value'] = negative\n",
110
+ "\n",
111
+ "ur_ui['img2img/Prompt/value'] = positive\n",
112
+ "ur_ui['img2img/Negative prompt/value'] = negative\n",
113
+ "\n",
114
+ "# 파일 저장\n",
115
+ "with open(ui_conf_path, 'w', encoding='utf-8') as f:\n",
116
+ " json.dump(ur_ui, f, indent=4)\n",
117
+ "\n",
118
+ "# 필요한 확장 모듈 설치\n",
119
+ "ext_dir = os.path.join(repo_dir, 'extensions')\n",
120
+ "os.chdir(ext_dir)\n",
121
+ "for i in [x.strip() for x in extensions.split('\\n') if x]:\n",
122
+ " ! git clone {i}\n",
123
+ "os.chdir(home_dir)"
124
+ ]
125
+ }
126
+ ],
127
+ "metadata": {
128
+ "kernelspec": {
129
+ "display_name": "Python 3",
130
+ "language": "python",
131
+ "name": "python3"
132
+ },
133
+ "language_info": {
134
+ "codemirror_mode": {
135
+ "name": "ipython",
136
+ "version": 3
137
+ },
138
+ "file_extension": ".py",
139
+ "mimetype": "text/x-python",
140
+ "name": "python",
141
+ "nbconvert_exporter": "python",
142
+ "pygments_lexer": "ipython3",
143
+ "version": "3.10.8"
144
+ },
145
+ "vscode": {
146
+ "interpreter": {
147
+ "hash": "c36c8ff63afb68809d72fa6323bde02fb9b90fe01b492d36c13befd021790766"
148
+ }
149
+ }
150
+ },
151
+ "nbformat": 4,
152
+ "nbformat_minor": 5
153
+ }