runpod initial setting-contain[ddetailer, dynamicThresholding]
Browse fileshttps://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 ์ผ๊ณ ๋ชจ๋ธ์ ๋ณ๊ฒฝํ๋ฉด ๋ก์ปฌ๊ณผ ๋์ผํ๊ฒ ์ธํ
์๋ฃ
@@ -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 |
+
}
|