tam9 commited on
Commit
cad791c
โ€ข
1 Parent(s): a150136

runpod initial setting-contain[ddetailer, dynamicThresholding]

Browse files

https://arca.live/b/aisave/72061143
1. ๋Ÿฐํฌ๋“œ ๊ฐ€์ž…&๋กœ๊ทธ์ธ- ์ขŒ์ธก ํƒญ Billing- Amount $10 (3090_33h)- ์ขŒ์ธก ํƒญ Browse Servers
2. ์šฐ์ธก ์ƒ๋‹จ ์ •๋ ฌ๊ธฐ์ค€ Upload Desc- 1x RTX 3090 Deploy- [Select aTemplate: RunPod Stable Diffusion v1.5, Temporary Disk 5, Persistent Volume 40] Deploy ํด๋ฆญ- My Pods- ๋ณด๋ผ์ƒ‰ v ์•„์ด์ฝ˜ ํด๋ฆญ- ๊ธฐ๋‹ค๋ฆฌ๊ธฐ- Connect
3. Connect to Jupyter Lab(port 8888)- ์ขŒ์ธก workspace ์— ์œ„์—์„œ ๋ฐ›์€ ํŒŒ์ผ ๋“œ๋ž- ํŒŒ์ผ ๋”๋ธ”ํด๋ฆญ[model_urls ๋ชจ๋ธ ์ฃผ์†Œ, vae_urls VAE ์ฃผ์†Œ, config ๋„ ์ฃผ์†Œ๋กœ ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค][huggingFace- Files and versions- ์™ผ์ชฝ ์ƒ๋‹จ ๊ฒŒ์‹œ์ž ID ๋ฐ‘์— ์žˆ๋Š” download ์šฐํด๋ฆญ- ๋งํฌ ์ฃผ์†Œ ๋ณต์‚ฌ][๊ตฌ๊ธ€ ๋“œ๋ผ์ด๋ธŒ ํŒŒ์ผ ์šฐํด๋ฆญ- ๊ณต์œ - ๋งํฌ๊ฐ€ ์žˆ๋Š” ๋ชจ๋“  ์‚ฌ์šฉ์ž- ๋งํฌ๋ณต์‚ฌ- /file/d/ ๋ถ€๋ถ„์„ /uc?id= ๋กœ ๋ฐ”๊พธ๊ณ , /view?usp=sharing ์ œ๊ฑฐ]
4. ๋ŸฐํฌํŠธ ์ขŒ์ธก ์ƒ๋‹จ โ–ถ ํ™”์‚ดํ‘œ ํด๋ฆญ- ์„ธํŒ…์ด ์™„๋ฃŒ๋˜๋ฉด ์ฃผํ”ผํ„ฐ ๋…ธํŠธ๋ถ์„ ๋„๊ณ - Connect via HTTP(port 3000) ํด๋ฆญํ•˜์—ฌ webUI ์‹คํ–‰- webUI ํ•˜๋‹จ์— ์žˆ๋Š” ReloadUI ํด๋ฆญ
5. Bad gateway ๋œจ๋ฉด- Runpod deploy ํ•œ ์ƒํƒœ์ฐฝ ์ขŒ์ธก ํ•˜๋‹จ์—์„œ Logs ํด๋ฆญ- ๊นŒ๋งŒ CUI_container Logs ์šฐ์ธก ํ•˜๋‹จ โ–ท ํด๋ฆญํ•˜๋ฉด ddetailer ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ- Runpod deploy ์ƒํƒœ์ฐฝ ์ขŒ์ธก ํ•˜๋‹จ์—์„œ โ–  ํด๋ฆญํ•˜์—ฌ ์„œ๋ฒ„ ์ •์ง€- โ–ถ ๋ˆŒ๋Ÿฌ์„œ ์žฌ์‹œ์ž‘(ํœด์ง€ํ†ต ๋ˆ„๋ฅด๋ฉด 2~5๋ฒˆ์„ ๋‹ค์‹œ ์„ธํŒ…ํ•ด์•ผ ํ•˜๋‹ˆ ์ฃผ์˜)
6. ๋กœ๋”ฉ ๋๋‚˜๋Š” ๊ฑธ ๊ธฐ๋‹ค๋ ธ๋‹ค๊ฐ€ webUI ์ผœ๊ณ  ๋ชจ๋ธ์„ ๋ณ€๊ฒฝํ•˜๋ฉด ๋กœ์ปฌ๊ณผ ๋™์ผํ•˜๊ฒŒ ์„ธํŒ… ์™„๋ฃŒ

setting-runpod-apply[ddetailer_dynamicThresholding]-230318.ipynb ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "id": "41c4f308-b68a-46b3-8ae7-1c7d46c981e4",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "# ------------------------------------------------\n",
11
+ "# Hugging Face์—์„œ ๋‹ค์šด๋กœ๋“œํ•  ๋ชจ๋ธ์˜ URL\n",
12
+ "model_urls = '''\n",
13
+ "https://huggingface.co/nuigurumi/basil_mix/resolve/main/Basil_mix_fixed.safetensors\n",
14
+ "https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/Models/AbyssOrangeMix2/AbyssOrangeMix2_hard.safetensors\n",
15
+ "'''\n",
16
+ "\n",
17
+ "vae_urls = '''\n",
18
+ "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors\n",
19
+ "'''\n",
20
+ "\n",
21
+ "lora_urls = '''\n",
22
+ "\n",
23
+ "'''\n",
24
+ "\n",
25
+ "embedding_urls = '''\n",
26
+ "\n",
27
+ "'''\n",
28
+ "\n",
29
+ "# Google Drive์—์„œ ๋‹ค์šด๋กœ๋“œํ•  ๋ชจ๋ธ์˜ URL\n",
30
+ "g_model_urls = '''\n",
31
+ "https://drive.google.com/uc?id=1MTLIN8xkugpjQuY-gcoRSAnTBOITQLvr\n",
32
+ "'''\n",
33
+ "\n",
34
+ "g_model_names = '''\n",
35
+ "example(do_not_download).safetensors\n",
36
+ "'''\n",
37
+ "\n",
38
+ "g_vae_urls = '''\n",
39
+ "\n",
40
+ "'''\n",
41
+ "\n",
42
+ "g_vae_names = '''\n",
43
+ "\n",
44
+ "'''\n",
45
+ "\n",
46
+ "g_lora_urls = '''\n",
47
+ "\n",
48
+ "'''\n",
49
+ "\n",
50
+ "g_lora_names = '''\n",
51
+ "\n",
52
+ "'''\n",
53
+ "\n",
54
+ "g_embedding_urls = '''\n",
55
+ "\n",
56
+ "'''\n",
57
+ "\n",
58
+ "g_embedding_names = '''\n",
59
+ "\n",
60
+ "'''\n",
61
+ "\n",
62
+ "g_wildcard_urls = '''\n",
63
+ "\n",
64
+ "'''\n",
65
+ "\n",
66
+ "g_wildcard_names = '''\n",
67
+ "\n",
68
+ "'''\n",
69
+ "\n",
70
+ "g_config_urls = '''\n",
71
+ "\n",
72
+ "'''\n",
73
+ "\n",
74
+ "# ๊ธฐ๋ณธ ํ”„๋กฌํ”„ํŠธ\n",
75
+ "positive = 'best quality, ultra high res, (photorealistic:1.4), cinematic film, (depth of field:1.2), (portrait:1.3), (close to face:1.3), beautiful woman, (kpop idol:1.2), (short lower face:1.2), girlish face, (big eyes:0.8), (busty:1.7), (huge breasts), thick thighs, (walking), outdoor, crowded street'\n",
76
+ "negative = 'paintings, sketches, (film grain:1.6), (worst quality:2), (low quality:2), (normal quality:2), lowres, (wrinkles:1.8), ((monochrome)), ((grayscale)), (glossy skin), fat, skin spots, acnes, skin blemishes, age spot, glans, (saggy breasts:1.8)'\n",
77
+ "\n",
78
+ "# ์„ค์น˜ํ•  ํ™•์žฅ ๊ธฐ๋Šฅ\n",
79
+ "extensions = '''\n",
80
+ "https://github.com/36DB/stable-diffusion-webui-localization-ko_KR\n",
81
+ "https://github.com/mcmonkeyprojects/sd-dynamic-thresholding\n",
82
+ "https://github.com/dustysys/ddetailer\n",
83
+ "https://github.com/Mikubill/sd-webui-controlnet\n",
84
+ "https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards\n",
85
+ "https://github.com/fkunn1326/openpose-editor\n",
86
+ "https://github.com/jexom/sd-webui-depth-lib\n",
87
+ "https://github.com/opparco/stable-diffusion-webui-two-shot\n",
88
+ "'''\n",
89
+ "# ------------------------------------------------\n",
90
+ "\n",
91
+ "import os\n",
92
+ "import json\n",
93
+ "import shutil\n",
94
+ "\n",
95
+ "home_dir = os.getcwd()\n",
96
+ "repo_dir = os.path.join(home_dir, 'stable-diffusion-webui')\n",
97
+ "os.chdir(repo_dir)\n",
98
+ "\n",
99
+ "# ์›๋ž˜ ์žˆ๋Š” sd ๋ชจ๋ธ ์‚ญ์ œ\n",
100
+ "for i in [x for x in os.listdir(home_dir) if x.endswith('.ckpt')]:\n",
101
+ " os.remove(os.path.join(home_dir, i))\n",
102
+ "\n",
103
+ "# Hugging Face์—์„œ ๋ชจ๋ธ ๋‹ค์šด๋กœ๋“œ\n",
104
+ "models_dir = os.path.join(repo_dir, 'models', 'Stable-diffusion')\n",
105
+ "for i in [x.strip() for x in model_urls.split('\\n') if x]:\n",
106
+ " ! wget {i} -P {models_dir}\n",
107
+ "\n",
108
+ "# Hugging Face์—์„œ vae ๋‹ค์šด๋กœ๋“œ\n",
109
+ "vae_dir = os.path.join(repo_dir, 'models', 'VAE')\n",
110
+ "for i in [x.strip() for x in vae_urls.split('\\n') if x]:\n",
111
+ " ! wget {i} -P {vae_dir}\n",
112
+ "\n",
113
+ "# Hugging Face์—์„œ lora ๋‹ค์šด๋กœ๋“œ\n",
114
+ "lora_dir = os.path.join(repo_dir, 'models', 'Lora')\n",
115
+ "for i in [x.strip() for x in lora_urls.split('\\n') if x]:\n",
116
+ " ! wget {i} -P {lora_dir}\n",
117
+ "\n",
118
+ "# Hugging Face์—์„œ embedding ๋‹ค์šด๋กœ๋“œ\n",
119
+ "embedding_dir = os.path.join(repo_dir, 'embeddings')\n",
120
+ "for i in [x.strip() for x in embedding_urls.split('\\n') if x]:\n",
121
+ " ! wget {i} -P {embedding_dir}\n",
122
+ "\n",
123
+ "# Goggle Drive์—์„œ ๋ชจ๋ธ ๋‹ค์šด๋กœ๋“œ\n",
124
+ "g_model_dir = os.path.join(repo_dir, 'models', 'Stable-diffusion')\n",
125
+ "for i in [x.strip() for x in g_model_urls.split('\\n') if x]:\n",
126
+ " ! gdown {i}\n",
127
+ "for i in [x.strip() for x in g_model_names.split('\\n') if x]:\n",
128
+ " ! mv {i} {g_model_dir}\n",
129
+ "\n",
130
+ "# Goggle Drive์—์„œ vae ๋‹ค์šด๋กœ๋“œ\n",
131
+ "g_vae_dir = os.path.join(repo_dir, 'models', 'VAE')\n",
132
+ "for i in [x.strip() for x in g_vae_urls.split('\\n') if x]:\n",
133
+ " ! gdown {i}\n",
134
+ "for i in [x.strip() for x in g_vae_names.split('\\n') if x]:\n",
135
+ " ! mv {i} {g_vae_dir}\n",
136
+ "\n",
137
+ "# Goggle Drive์—์„œ lora ๏ฟฝ๏ฟฝ์šด๋กœ๋“œ\n",
138
+ "g_lora_dir = os.path.join(repo_dir, 'models', 'Lora')\n",
139
+ "for i in [x.strip() for x in g_lora_urls.split('\\n') if x]:\n",
140
+ " ! gdown {i}\n",
141
+ "for i in [x.strip() for x in g_lora_names.split('\\n') if x]:\n",
142
+ " ! mv {i} {g_lora_dir}\n",
143
+ "\n",
144
+ "# Goggle Drive์—์„œ embedding ๋‹ค์šด๋กœ๋“œ\n",
145
+ "g_embedding_dir = os.path.join(repo_dir, 'embeddings')\n",
146
+ "for i in [x.strip() for x in g_embedding_urls.split('\\n') if x]:\n",
147
+ " ! gdown {i}\n",
148
+ "for i in [x.strip() for x in g_embedding_names.split('\\n') if x]:\n",
149
+ " ! mv {i} {g_embedding_dir}\n",
150
+ "\n",
151
+ "# ui-config.json ๋ฐฑ์—…\n",
152
+ "ui_conf_path = os.path.join(repo_dir, 'ui-config.json')\n",
153
+ "ui_conf_bk_path = os.path.join(repo_dir, 'ui-config_bk.json')\n",
154
+ "if not os.path.exists(ui_conf_bk_path):\n",
155
+ " shutil.copy(ui_conf_path, ui_conf_bk_path)\n",
156
+ "with open(ui_conf_path, 'r', encoding='utf-8') as f:\n",
157
+ " orig_ui = json.load(f)\n",
158
+ " ur_ui = orig_ui\n",
159
+ "\n",
160
+ "# ui-config.json ์ˆ˜์ •\n",
161
+ "ur_ui['txt2img/Prompt/value'] = positive\n",
162
+ "ur_ui['txt2img/Negative prompt/value'] = negative\n",
163
+ "\n",
164
+ "ur_ui['img2img/Prompt/value'] = positive\n",
165
+ "ur_ui['img2img/Negative prompt/value'] = negative\n",
166
+ "\n",
167
+ "# ํŒŒ์ผ ์ €์žฅ\n",
168
+ "with open(ui_conf_path, 'w', encoding='utf-8') as f:\n",
169
+ " json.dump(ur_ui, f, indent=4)\n",
170
+ "\n",
171
+ "# Goggle Drive์—์„œ config ๋‹ค์šด๋กœ๋“œ\n",
172
+ "for i in [x.strip() for x in g_config_urls.split('\\n') if x]:\n",
173
+ " ! gdown {i}\n",
174
+ "\n",
175
+ "# ํ•„์š”ํ•œ ํ™•์žฅ ๋ชจ๋“ˆ ์„ค์น˜\n",
176
+ "ext_dir = os.path.join(repo_dir, 'extensions')\n",
177
+ "os.chdir(ext_dir)\n",
178
+ "for i in [x.strip() for x in extensions.split('\\n') if x]:\n",
179
+ " ! git clone {i}\n",
180
+ "os.chdir(home_dir)\n",
181
+ "\n",
182
+ "# Goggle Drive์—์„œ wildcard ๋‹ค์šด๋กœ๋“œ\n",
183
+ "g_wildcard_dir = os.path.join(repo_dir, 'extensions', 'stable-diffusion-webui-wildcards', 'wildcards')\n",
184
+ "for i in [x.strip() for x in g_wildcard_urls.split('\\n') if x]:\n",
185
+ " ! gdown {i}\n",
186
+ "for i in [x.strip() for x in g_wildcard_names.split('\\n') if x]:\n",
187
+ " ! mv {i} {g_wildcard_dir}\n",
188
+ "\n",
189
+ "!wget https://civitai.com/api/download/models/11739 -O controlnetPreTrained_openposeV10.safetensors\n",
190
+ "!wget https://civitai.com/api/download/models/11734 -O controlnetPreTrained_depthV10.safetensors\n",
191
+ "!wget https://civitai.com/api/download/models/11724 -O controlnetPreTrained_cannyV10.safetensors\n",
192
+ "!mv controlnetPreTrained_openposeV10.safetensors stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
193
+ "!mv controlnetPreTrained_depthV10.safetensors stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
194
+ "!mv controlnetPreTrained_cannyV10.safetensors stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
195
+ "!apt-get update -y\n",
196
+ "!apt install -y build-essential libgl1 python3-toolz libpython3.10-dev python3-distutils\n",
197
+ "!pip install --upgrade pip setuptools wheel"
198
+ ]
199
+ }
200
+ ],
201
+ "metadata": {
202
+ "kernelspec": {
203
+ "display_name": "Python 3 (ipykernel)",
204
+ "language": "python",
205
+ "name": "python3"
206
+ },
207
+ "language_info": {
208
+ "codemirror_mode": {
209
+ "name": "ipython",
210
+ "version": 3
211
+ },
212
+ "file_extension": ".py",
213
+ "mimetype": "text/x-python",
214
+ "name": "python",
215
+ "nbconvert_exporter": "python",
216
+ "pygments_lexer": "ipython3",
217
+ "version": "3.10.6"
218
+ },
219
+ "vscode": {
220
+ "interpreter": {
221
+ "hash": "c36c8ff63afb68809d72fa6323bde02fb9b90fe01b492d36c13befd021790766"
222
+ }
223
+ }
224
+ },
225
+ "nbformat": 4,
226
+ "nbformat_minor": 5
227
+ }