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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
},
|
11 |
-
|
12 |
-
|
13 |
-
"id": "813d4d10-e6d1-42b1-ae37-ae41ad47e595",
|
14 |
-
"metadata": {},
|
15 |
-
"source": [
|
16 |
-
"# Установка зависимостей"
|
17 |
-
]
|
18 |
-
},
|
19 |
-
{
|
20 |
-
"cell_type": "code",
|
21 |
-
"execution_count": null,
|
22 |
-
"id": "bfd51417-bba8-41fb-ae56-c6555e2a0465",
|
23 |
-
"metadata": {
|
24 |
-
"tags": []
|
25 |
-
},
|
26 |
-
"outputs": [],
|
27 |
-
"source": [
|
28 |
-
"# Install the dependencies\n",
|
29 |
-
"\n",
|
30 |
-
"force_reinstall= False\n",
|
31 |
-
"\n",
|
32 |
-
"# Set to true only if you want to install the dependencies again.\n",
|
33 |
-
"\n",
|
34 |
-
"#--------------------\n",
|
35 |
-
"with open('/dev/null', 'w') as devnull:import requests, os, time, importlib;open('/workspace/mainrunpodA1111.py', 'wb').write(requests.get('https://huggingface.co/spaces/stlaurentjr/RNPD/raw/main/scripts/mainrunpodA1111.py').content);os.chdir('/workspace');time.sleep(2);import mainrunpodA1111;importlib.reload(mainrunpodA1111);from mainrunpodA1111 import *;Deps(force_reinstall)"
|
36 |
-
]
|
37 |
-
},
|
38 |
-
{
|
39 |
-
"cell_type": "markdown",
|
40 |
-
"id": "76ae705b-15e3-47b9-b226-52e71ef1737d",
|
41 |
-
"metadata": {},
|
42 |
-
"source": [
|
43 |
-
"# Установка/Обновление AUTOMATIC1111 repo"
|
44 |
-
]
|
45 |
-
},
|
46 |
-
{
|
47 |
-
"cell_type": "code",
|
48 |
-
"execution_count": null,
|
49 |
-
"id": "652afdee-64a4-483b-926a-094c884dd260",
|
50 |
-
"metadata": {
|
51 |
-
"tags": []
|
52 |
-
},
|
53 |
-
"outputs": [],
|
54 |
-
"source": [
|
55 |
-
"Huggingface_token_optional=\"\"\n",
|
56 |
-
"\n",
|
57 |
-
"# Restore your backed-up SD folder by entering your huggingface token, leave it empty to start fresh or continue with the existing sd folder (if any).\n",
|
58 |
-
"\n",
|
59 |
-
"#--------------------\n",
|
60 |
-
"repo(Huggingface_token_optional)"
|
61 |
-
]
|
62 |
-
},
|
63 |
-
{
|
64 |
-
"cell_type": "markdown",
|
65 |
-
"id": "ca3a26bb-8625-42b9-9e2f-e55939a536ef",
|
66 |
-
"metadata": {},
|
67 |
-
"source": [
|
68 |
-
"# Установка моделей"
|
69 |
-
]
|
70 |
-
},
|
71 |
-
{
|
72 |
-
"cell_type": "code",
|
73 |
-
"execution_count": null,
|
74 |
-
"id": "1e5dbca1-5ee2-41db-be94-9d2919dc3aef",
|
75 |
-
"metadata": {
|
76 |
-
"tags": []
|
77 |
-
},
|
78 |
-
"outputs": [],
|
79 |
-
"source": [
|
80 |
-
"Original_Model_Version = \"SDXL\"\n",
|
81 |
-
"\n",
|
82 |
-
"# Choices are \"SDXL\", \"v1.5\", \"v2-512\", \"v2-768\"\n",
|
83 |
-
"\n",
|
84 |
-
"#-------------- Or\n",
|
85 |
-
"\n",
|
86 |
-
"Path_to_MODEL = \"\"\n",
|
87 |
-
"\n",
|
88 |
-
"# Insert the full path of your trained model or to a folder containing multiple models.\n",
|
89 |
-
"\n",
|
90 |
-
"\n",
|
91 |
-
"MODEL_LINK = \"cyberrealistic_v32.safetensors\"\n",
|
92 |
-
"\n",
|
93 |
-
"# A direct link to a Model or a shared gdrive link.\n",
|
94 |
-
"\n",
|
95 |
-
"\n",
|
96 |
-
"#--------------------\n",
|
97 |
-
"model=mdl(Original_Model_Version, Path_to_MODEL, MODEL_LINK)"
|
98 |
-
]
|
99 |
-
},
|
100 |
-
{
|
101 |
-
"cell_type": "markdown",
|
102 |
-
"id": "9c578da4-3164-411c-9255-226ce8157545",
|
103 |
-
"metadata": {},
|
104 |
-
"source": [
|
105 |
-
"# Загрузка Checkpoints"
|
106 |
-
]
|
107 |
-
},
|
108 |
-
{
|
109 |
-
"cell_type": "code",
|
110 |
-
"execution_count": null,
|
111 |
-
"id": "a0f3dfba-4127-4619-8bb1-4589e84a5fe4",
|
112 |
-
"metadata": {
|
113 |
-
"tags": []
|
114 |
-
},
|
115 |
-
"outputs": [],
|
116 |
-
"source": [
|
117 |
-
"model_LINK = \"\"\n",
|
118 |
-
"\n",
|
119 |
-
"# Downlad the Checkpoints model directly to A1111 Checkpoints folder\n",
|
120 |
-
"\n",
|
121 |
-
"#--------------------\n",
|
122 |
-
"# modeldwn(\"https://drive.google.com/file/d/1O0ez3jYp_u0DLcdsQ9EsIHSQZciOakWn\")\n",
|
123 |
-
"# modeldwn(\"https://drive.google.com/file/d/1ldaJzlooJ9CYm96s9FOirpiUH4GU8_jd\")\n",
|
124 |
-
"# modeldwn(\"https://drive.google.com/file/d/1nNERcpaW09L4HlqEnsN9JpDpQXU9EOfB\")\n"
|
125 |
-
]
|
126 |
-
},
|
127 |
-
{
|
128 |
-
"cell_type": "markdown",
|
129 |
-
"id": "9c578da4-3164-411c-9255-226ce8157545",
|
130 |
-
"metadata": {},
|
131 |
-
"source": [
|
132 |
-
"# Загрузка LoRA"
|
133 |
-
]
|
134 |
-
},
|
135 |
-
{
|
136 |
-
"cell_type": "code",
|
137 |
-
"execution_count": null,
|
138 |
-
"id": "a0f3dfba-4127-4619-8bb1-4589e84a5fe4",
|
139 |
-
"metadata": {
|
140 |
-
"tags": []
|
141 |
-
},
|
142 |
-
"outputs": [],
|
143 |
-
"source": [
|
144 |
-
"LoRA_LINK = \"\"\n",
|
145 |
-
"\n",
|
146 |
-
"# Downlad the LoRA model directly to A1111 LoRA folder\n",
|
147 |
-
"\n",
|
148 |
-
"#--------------------\n",
|
149 |
-
"# loradwn(\"https://drive.google.com/file/d/1kkhb7J8nlJMI7GPd4QCrKxVh6emv94at\")\n",
|
150 |
-
"# loradwn(\"https://drive.google.com/file/d/1lqJOnwnPu6IqrkvQEFM1TPW8osG-J5kK\")\n",
|
151 |
-
"# loradwn(\"https://drive.google.com/file/d/1g8dJX-5XlvHZJGJ_Ys_xyfbuQnb6T7oz\")\n"
|
152 |
-
]
|
153 |
-
},
|
154 |
-
{
|
155 |
-
"cell_type": "markdown",
|
156 |
-
"id": "02706779-fec8-4661-8589-0e28f0d4fb3b",
|
157 |
-
"metadata": {},
|
158 |
-
"source": [
|
159 |
-
"# ControlNet"
|
160 |
-
]
|
161 |
-
},
|
162 |
-
{
|
163 |
-
"cell_type": "code",
|
164 |
-
"execution_count": null,
|
165 |
-
"id": "222cdfd7-38f1-422b-81a2-963a2a8d504b",
|
166 |
-
"metadata": {
|
167 |
-
"tags": []
|
168 |
-
},
|
169 |
-
"outputs": [],
|
170 |
-
"source": [
|
171 |
-
"# Загрузка/обнолвение ControlNet и моделей.\n",
|
172 |
-
"\n",
|
173 |
-
"ControlNet_v1_Model = \"none\"\n",
|
174 |
-
"\n",
|
175 |
-
"# Choices are : none; all; 1: Canny; 2: Depth; 3: Lineart; 4: MLSD; 5: Normal; 6: OpenPose; 7: Scribble; 8: Seg; 9: ip2p; 10:Shuffle; 11: Inpaint; 12: Softedge; 13: Lineart_Anime; 14: Tile; 15: T2iadapter_Models\n",
|
176 |
-
"\n",
|
177 |
-
"ControlNet_XL_Model = \"none\"\n",
|
178 |
-
"\n",
|
179 |
-
"# Choices are : none; all; 1: Canny; 2: Depth; 3: Sketch; 4: OpenPose; 5: Recolor\n",
|
180 |
-
"\n",
|
181 |
-
"#--------------------\n",
|
182 |
-
"CNet(ControlNet_v1_Model, ControlNet_XL_Model)\n",
|
183 |
-
"#CNet(\"1\", ControlNet_XL_Model)\n",
|
184 |
-
"#CNet(\"2\", ControlNet_XL_Model)\n",
|
185 |
-
"#CNet(\"3\", ControlNet_XL_Model)\n",
|
186 |
-
"#CNet(\"6\", ControlNet_XL_Model)\n",
|
187 |
-
"#CNet(\"11\", ControlNet_XL_Model)\n",
|
188 |
-
"#CNet(\"14\", ControlNet_XL_Model)\n",
|
189 |
-
"#CNet(\"15\", ControlNet_XL_Model)\n"
|
190 |
-
]
|
191 |
-
},
|
192 |
-
{
|
193 |
-
"cell_type": "markdown",
|
194 |
-
"id": "48184b7b-9cd0-4f04-9c85-4464031d6596",
|
195 |
-
"metadata": {
|
196 |
-
"tags": []
|
197 |
-
},
|
198 |
-
"source": [
|
199 |
-
"# Старт Stable-Diffusion"
|
200 |
-
]
|
201 |
-
},
|
202 |
-
{
|
203 |
-
"cell_type": "code",
|
204 |
-
"execution_count": null,
|
205 |
-
"id": "e73f76a6-01a4-44d0-87a7-77fed9c9b77c",
|
206 |
-
"metadata": {
|
207 |
-
"tags": []
|
208 |
-
},
|
209 |
-
"outputs": [],
|
210 |
-
"source": [
|
211 |
-
"User = \"\"\n",
|
212 |
-
"\n",
|
213 |
-
"Password= \"\"\n",
|
214 |
-
"\n",
|
215 |
-
"# Add credentials to your Gradio interface (optional).\n",
|
216 |
-
"\n",
|
217 |
-
"#-----------------\n",
|
218 |
-
"configf=sd(User, Password, model) if 'model' in locals() else sd(User, Password, \"\");import gradio;gradio.close_all()\n",
|
219 |
-
"!python /workspace/sd/stable-diffusion-webui/webui.py $configf"
|
220 |
-
]
|
221 |
-
}
|
222 |
-
],
|
223 |
-
"metadata": {
|
224 |
-
"kernelspec": {
|
225 |
-
"display_name": "Python 3 (ipykernel)",
|
226 |
-
"language": "python",
|
227 |
-
"name": "python3"
|
228 |
-
},
|
229 |
-
"language_info": {
|
230 |
-
"codemirror_mode": {
|
231 |
-
"name": "ipython",
|
232 |
-
"version": 3
|
233 |
-
},
|
234 |
-
"file_extension": ".py",
|
235 |
-
"mimetype": "text/x-python",
|
236 |
-
"name": "python",
|
237 |
-
"nbconvert_exporter": "python",
|
238 |
-
"pygments_lexer": "ipython3",
|
239 |
-
"version": "3.10.6"
|
240 |
-
}
|
241 |
-
},
|
242 |
-
"nbformat": 4,
|
243 |
-
"nbformat_minor": 5
|
244 |
}
|
|
|
1 |
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"id": "9e42bc1e-9825-4587-b533-c74607b1a377",
|
6 |
+
"metadata": {
|
7 |
+
"id": "9e42bc1e-9825-4587-b533-c74607b1a377"
|
8 |
+
},
|
9 |
+
"source": [
|
10 |
+
"**Добро пожаловать в Stable Diffusion!**\n",
|
11 |
+
"\n",
|
12 |
+
"Этот блокнот предоставляет мощные и удобные инструменты для создания потрясающих изображений с помощью искусственного интеллекта. Мы подготовили набор предустановленных моделей, чтобы вы могли как можно скорее начать творить.\n",
|
13 |
+
"\n",
|
14 |
+
"Освойте искусство с помощью **ControlNet**:\n",
|
15 |
+
"- **Canny**: Идеально подходит для выявления контуров и улучшения резкости деталей в изображениях.\n",
|
16 |
+
"- **OpenPose**: Экспериментируйте с позами персонажей, добавляя динамичность и выразительность ваших работ.\n",
|
17 |
+
"- **Depth**: Обогащайте ваши креативы реалистичной глубиной и объёмом, создавая более трехмерное восприятие.\n",
|
18 |
+
"- **Lineart**: Упрощает процесс создания линейных рисунков, делая их чистыми и готовыми к дальнейшей доработке.\n",
|
19 |
+
"- **Inpaint**: Уникальный инструмент для редактирования и дополнения деталей ваших изображений, позволяющий точно корректировать и вносить изменения там, где это необходимо.\n",
|
20 |
+
"\n",
|
21 |
+
"**Чекпоинты** для стилизации:\n",
|
22 |
+
"- Cyberrealistic: модель для создания реалистичных и захватывающих картин.\n",
|
23 |
+
"- Ghostmix: особая модель для фанатов аниме, чтобы вдохнуть жизнь в ваши анимационные фантазии.\n",
|
24 |
+
"\n",
|
25 |
+
"**LoRA**: Это уникальный инструмент, который позволяет внедрять адаптивные изменения в модель, тонко корректируя и уточняя результаты без необходимости переобучения всей сети, что экономит время и ресурсы при сохранении высококачественного результата."
|
26 |
+
]
|
27 |
+
},
|
28 |
+
{
|
29 |
+
"cell_type": "markdown",
|
30 |
+
"id": "813d4d10-e6d1-42b1-ae37-ae41ad47e595",
|
31 |
+
"metadata": {
|
32 |
+
"id": "813d4d10-e6d1-42b1-ae37-ae41ad47e595"
|
33 |
+
},
|
34 |
+
"source": [
|
35 |
+
"# Установка зависимостей\n",
|
36 |
+
"Данный раздел блокнота загружает основные библиотеки для работы Stable Diffusion"
|
37 |
+
]
|
38 |
+
},
|
39 |
+
{
|
40 |
+
"cell_type": "code",
|
41 |
+
"execution_count": null,
|
42 |
+
"id": "bfd51417-bba8-41fb-ae56-c6555e2a0465",
|
43 |
+
"metadata": {
|
44 |
+
"tags": [],
|
45 |
+
"id": "bfd51417-bba8-41fb-ae56-c6555e2a0465"
|
46 |
+
},
|
47 |
+
"outputs": [],
|
48 |
+
"source": [
|
49 |
+
"# Install the dependencies\n",
|
50 |
+
"\n",
|
51 |
+
"force_reinstall= False\n",
|
52 |
+
"\n",
|
53 |
+
"# Set to true only if you want to install the dependencies again.\n",
|
54 |
+
"\n",
|
55 |
+
"#--------------------\n",
|
56 |
+
"with open('/dev/null', 'w') as devnull:import requests, os, time, importlib;open('/workspace/mainrunpodA1111.py', 'wb').write(requests.get('https://huggingface.co/spaces/stlaurentjr/RNPD/raw/main/scripts/mainrunpodA1111.py').content);os.chdir('/workspace');time.sleep(2);import mainrunpodA1111;importlib.reload(mainrunpodA1111);from mainrunpodA1111 import *;Deps(force_reinstall)"
|
57 |
+
]
|
58 |
+
},
|
59 |
+
{
|
60 |
+
"cell_type": "markdown",
|
61 |
+
"id": "76ae705b-15e3-47b9-b226-52e71ef1737d",
|
62 |
+
"metadata": {
|
63 |
+
"id": "76ae705b-15e3-47b9-b226-52e71ef1737d"
|
64 |
+
},
|
65 |
+
"source": [
|
66 |
+
"# Установка/Обновление AUTOMATIC1111\n",
|
67 |
+
"Этот раздел блокнота посвящён установке и обновлению Automatic1111, популярного графического интерфейса для работы с Stable Diffusion.\n",
|
68 |
+
"\n",
|
69 |
+
"Automatic1111 облегчает использование функционала Stable Diffusion, предоставляя удобный и интуитивно понятный графический интерфейс."
|
70 |
+
]
|
71 |
+
},
|
72 |
+
{
|
73 |
+
"cell_type": "code",
|
74 |
+
"execution_count": null,
|
75 |
+
"id": "652afdee-64a4-483b-926a-094c884dd260",
|
76 |
+
"metadata": {
|
77 |
+
"tags": [],
|
78 |
+
"id": "652afdee-64a4-483b-926a-094c884dd260"
|
79 |
+
},
|
80 |
+
"outputs": [],
|
81 |
+
"source": [
|
82 |
+
"Huggingface_token_optional=\"\"\n",
|
83 |
+
"\n",
|
84 |
+
"# Restore your backed-up SD folder by entering your huggingface token, leave it empty to start fresh or continue with the existing sd folder (if any).\n",
|
85 |
+
"\n",
|
86 |
+
"#--------------------\n",
|
87 |
+
"repo(Huggingface_token_optional)"
|
88 |
+
]
|
89 |
+
},
|
90 |
+
{
|
91 |
+
"cell_type": "markdown",
|
92 |
+
"id": "ca3a26bb-8625-42b9-9e2f-e55939a536ef",
|
93 |
+
"metadata": {
|
94 |
+
"id": "ca3a26bb-8625-42b9-9e2f-e55939a536ef"
|
95 |
+
},
|
96 |
+
"source": [
|
97 |
+
"# Установка моделей\n",
|
98 |
+
"Для того чтобы настроить модель, которая будет использоваться при первом запуске интерфейса Automatic1111, необходимо сконфигурировать переменную MODEL_LINK. Эта переменная задаёт конкретную модель, которая будет загружена и инициализирована.\n",
|
99 |
+
"\n",
|
100 |
+
"Вы можете выбрать одну из предустановленных моделей или указать путь к собственной обученной модели."
|
101 |
+
]
|
102 |
+
},
|
103 |
+
{
|
104 |
+
"cell_type": "code",
|
105 |
+
"execution_count": null,
|
106 |
+
"id": "1e5dbca1-5ee2-41db-be94-9d2919dc3aef",
|
107 |
+
"metadata": {
|
108 |
+
"tags": [],
|
109 |
+
"id": "1e5dbca1-5ee2-41db-be94-9d2919dc3aef"
|
110 |
+
},
|
111 |
+
"outputs": [],
|
112 |
+
"source": [
|
113 |
+
"Original_Model_Version = \"SDXL\" # Опции: \"SDXL\", \"v1.5\", \"v2-512\", \"v2-768\"\n",
|
114 |
+
"\n",
|
115 |
+
"MODEL_LINK = \"cyberrealistic_v32.safetensors\" # Выбранная модель\n",
|
116 |
+
"\n",
|
117 |
+
"Path_to_MODEL = \"\" # Вставьте полный путь к вашей обученной модели или к папке с моделями.\n",
|
118 |
+
"\n",
|
119 |
+
"# Инициализация модели\n",
|
120 |
+
"model = mdl(Original_Model_Version, Path_to_MODEL, MODEL_LINK)\n"
|
121 |
+
]
|
122 |
+
},
|
123 |
+
{
|
124 |
+
"cell_type": "markdown",
|
125 |
+
"id": "9c578da4-3164-411c-9255-226ce8157545",
|
126 |
+
"metadata": {
|
127 |
+
"id": "9c578da4-3164-411c-9255-226ce8157545"
|
128 |
+
},
|
129 |
+
"source": [
|
130 |
+
"# Загрузка Checkpoints\n",
|
131 |
+
"Этот блок отвечает за загрзуку checkoints\n",
|
132 |
+
"\n",
|
133 |
+
"modeldwn(<link>)\n",
|
134 |
+
"\n",
|
135 |
+
"С помощью этой функции можно загружать сторонние чекпоинтс\n",
|
136 |
+
"\n",
|
137 |
+
"\n",
|
138 |
+
"Чекпоинт - это натренированная модель для визуализации промпта, например, в стиле реализм или в стиле наивного рисунка.\n",
|
139 |
+
"\n",
|
140 |
+
"Ссылка на иструкцию: <link>\n",
|
141 |
+
"ССылка на модели: <link>"
|
142 |
+
]
|
143 |
+
},
|
144 |
+
{
|
145 |
+
"cell_type": "code",
|
146 |
+
"execution_count": null,
|
147 |
+
"id": "a0f3dfba-4127-4619-8bb1-4589e84a5fe4",
|
148 |
+
"metadata": {
|
149 |
+
"tags": [],
|
150 |
+
"id": "a0f3dfba-4127-4619-8bb1-4589e84a5fe4"
|
151 |
+
},
|
152 |
+
"outputs": [],
|
153 |
+
"source": [
|
154 |
+
"model_LINK = \"\"\n",
|
155 |
+
"\n",
|
156 |
+
"# Downlad the Checkpoints model directly to A1111 Checkpoints folder\n",
|
157 |
+
"\n",
|
158 |
+
"#--------------------\n",
|
159 |
+
"# modeldwn(\"https://drive.google.com/file/d/1O0ez3jYp_u0DLcdsQ9EsIHSQZciOakWn\")\n",
|
160 |
+
"# modeldwn(\"https://drive.google.com/file/d/1ldaJzlooJ9CYm96s9FOirpiUH4GU8_jd\")\n",
|
161 |
+
"# modeldwn(\"https://drive.google.com/file/d/1nNERcpaW09L4HlqEnsN9JpDpQXU9EOfB\")\n"
|
162 |
+
]
|
163 |
+
},
|
164 |
+
{
|
165 |
+
"cell_type": "markdown",
|
166 |
+
"metadata": {
|
167 |
+
"id": "jLvr3BBe9i9I"
|
168 |
+
},
|
169 |
+
"source": [
|
170 |
+
"# Загрузка LoRA\n",
|
171 |
+
"\n",
|
172 |
+
"Этот блок отвечает за загрзуку Lora\n",
|
173 |
+
"\n",
|
174 |
+
"loradwn(<link>)\n",
|
175 |
+
"\n",
|
176 |
+
"С помощью этой функции можно загружать сторонние чекпоинтс\n",
|
177 |
+
"\n",
|
178 |
+
"\n",
|
179 |
+
"Lora - это визуальная надстройка, чтобы добавить какой-то эффект для вашей генерации, например, создавать платья из цветов или сделать пиксельартовый стиль.\n",
|
180 |
+
"\n",
|
181 |
+
"Ссылка на иструкцию: <link>\n",
|
182 |
+
"ССылка на модели: <link>"
|
183 |
+
],
|
184 |
+
"id": "jLvr3BBe9i9I"
|
185 |
+
},
|
186 |
+
{
|
187 |
+
"cell_type": "code",
|
188 |
+
"execution_count": null,
|
189 |
+
"metadata": {
|
190 |
+
"tags": [],
|
191 |
+
"id": "tevd9cVK9i9J"
|
192 |
+
},
|
193 |
+
"outputs": [],
|
194 |
+
"source": [
|
195 |
+
"LoRA_LINK = \"\"\n",
|
196 |
+
"\n",
|
197 |
+
"# Downlad the LoRA model directly to A1111 LoRA folder\n",
|
198 |
+
"\n",
|
199 |
+
"#--------------------\n",
|
200 |
+
"# loradwn(\"https://drive.google.com/file/d/1kkhb7J8nlJMI7GPd4QCrKxVh6emv94at\")\n",
|
201 |
+
"# loradwn(\"https://drive.google.com/file/d/1lqJOnwnPu6IqrkvQEFM1TPW8osG-J5kK\")\n",
|
202 |
+
"# loradwn(\"https://drive.google.com/file/d/1g8dJX-5XlvHZJGJ_Ys_xyfbuQnb6T7oz\")\n"
|
203 |
+
],
|
204 |
+
"id": "tevd9cVK9i9J"
|
205 |
+
},
|
206 |
+
{
|
207 |
+
"cell_type": "markdown",
|
208 |
+
"id": "02706779-fec8-4661-8589-0e28f0d4fb3b",
|
209 |
+
"metadata": {
|
210 |
+
"id": "02706779-fec8-4661-8589-0e28f0d4fb3b"
|
211 |
+
},
|
212 |
+
"source": [
|
213 |
+
"# ControlNet\n",
|
214 |
+
"Этот блок отвечает за загрзуку модолей для ControlNet\n",
|
215 |
+
"\n",
|
216 |
+
"CNet(<номер>)\n",
|
217 |
+
"С помощью этой функции можно загружать модели для controlnet\n",
|
218 |
+
"\n",
|
219 |
+
"Ссылка о ControlNet: <link>\n",
|
220 |
+
"\n",
|
221 |
+
"Загруженные модели:\n",
|
222 |
+
" Openpose - ляля\n",
|
223 |
+
" Canny - нана\n",
|
224 |
+
" и тд."
|
225 |
+
]
|
226 |
+
},
|
227 |
+
{
|
228 |
+
"cell_type": "code",
|
229 |
+
"execution_count": null,
|
230 |
+
"id": "222cdfd7-38f1-422b-81a2-963a2a8d504b",
|
231 |
+
"metadata": {
|
232 |
+
"tags": [],
|
233 |
+
"id": "222cdfd7-38f1-422b-81a2-963a2a8d504b"
|
234 |
+
},
|
235 |
+
"outputs": [],
|
236 |
+
"source": [
|
237 |
+
"# Загрузка/обнолвение ControlNet и моделей.\n",
|
238 |
+
"\n",
|
239 |
+
"ControlNet_v1_Model = \"none\"\n",
|
240 |
+
"\n",
|
241 |
+
"# Choices are : none; all; 1: Canny; 2: Depth; 3: Lineart; 4: MLSD; 5: Normal; 6: OpenPose; 7: Scribble; 8: Seg; 9: ip2p; 10:Shuffle; 11: Inpaint; 12: Softedge; 13: Lineart_Anime; 14: Tile; 15: T2iadapter_Models\n",
|
242 |
+
"\n",
|
243 |
+
"ControlNet_XL_Model = \"none\"\n",
|
244 |
+
"\n",
|
245 |
+
"# Choices are : none; all; 1: Canny; 2: Depth; 3: Sketch; 4: OpenPose; 5: Recolor\n",
|
246 |
+
"\n",
|
247 |
+
"#--------------------\n",
|
248 |
+
"CNet(ControlNet_v1_Model, ControlNet_XL_Model)\n",
|
249 |
+
"#CNet(\"1\", ControlNet_XL_Model)\n",
|
250 |
+
"#CNet(\"2\", ControlNet_XL_Model)\n",
|
251 |
+
"#CNet(\"3\", ControlNet_XL_Model)\n",
|
252 |
+
"#CNet(\"6\", ControlNet_XL_Model)\n",
|
253 |
+
"#CNet(\"11\", ControlNet_XL_Model)\n",
|
254 |
+
"#CNet(\"14\", ControlNet_XL_Model)\n",
|
255 |
+
"#CNet(\"15\", ControlNet_XL_Model)\n"
|
256 |
+
]
|
257 |
+
},
|
258 |
+
{
|
259 |
+
"cell_type": "markdown",
|
260 |
+
"id": "48184b7b-9cd0-4f04-9c85-4464031d6596",
|
261 |
+
"metadata": {
|
262 |
+
"tags": [],
|
263 |
+
"id": "48184b7b-9cd0-4f04-9c85-4464031d6596"
|
264 |
+
},
|
265 |
+
"source": [
|
266 |
+
"# Старт Stable-Diffusion\n",
|
267 |
+
"Этот блок отвечате за запуск интерфейса для работы.\n",
|
268 |
+
"\n",
|
269 |
+
"Для того, чтобы перезагрузить интефейс не нужно запускать все блоки выше, если они уже один раз были запущены."
|
270 |
+
]
|
271 |
+
},
|
272 |
+
{
|
273 |
+
"cell_type": "code",
|
274 |
+
"execution_count": null,
|
275 |
+
"id": "e73f76a6-01a4-44d0-87a7-77fed9c9b77c",
|
276 |
+
"metadata": {
|
277 |
+
"tags": [],
|
278 |
+
"id": "e73f76a6-01a4-44d0-87a7-77fed9c9b77c"
|
279 |
+
},
|
280 |
+
"outputs": [],
|
281 |
+
"source": [
|
282 |
+
"User = \"\"\n",
|
283 |
+
"\n",
|
284 |
+
"Password= \"\"\n",
|
285 |
+
"\n",
|
286 |
+
"# Add credentials to your Gradio interface (optional).\n",
|
287 |
+
"\n",
|
288 |
+
"#-----------------\n",
|
289 |
+
"configf=sd(User, Password, model) if 'model' in locals() else sd(User, Password, \"\");import gradio;gradio.close_all()\n",
|
290 |
+
"!python /workspace/sd/stable-diffusion-webui/webui.py $configf"
|
291 |
+
]
|
292 |
+
}
|
293 |
+
],
|
294 |
+
"metadata": {
|
295 |
+
"kernelspec": {
|
296 |
+
"display_name": "Python 3 (ipykernel)",
|
297 |
+
"language": "python",
|
298 |
+
"name": "python3"
|
299 |
+
},
|
300 |
+
"language_info": {
|
301 |
+
"codemirror_mode": {
|
302 |
+
"name": "ipython",
|
303 |
+
"version": 3
|
304 |
+
},
|
305 |
+
"file_extension": ".py",
|
306 |
+
"mimetype": "text/x-python",
|
307 |
+
"name": "python",
|
308 |
+
"nbconvert_exporter": "python",
|
309 |
+
"pygments_lexer": "ipython3",
|
310 |
+
"version": "3.10.6"
|
311 |
+
},
|
312 |
+
"colab": {
|
313 |
+
"provenance": []
|
314 |
+
}
|
315 |
},
|
316 |
+
"nbformat": 4,
|
317 |
+
"nbformat_minor": 5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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