Skip to content

Commit f459132

Browse files
committed
Merge branch 'main' of github.com:LeslieZhoa/Simple-Lora into main
2 parents 63b8065 + 040dd53 commit f459132

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

demo.ipynb

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"private_outputs": true,
77
"provenance": [],
88
"gpuType": "T4",
9-
"authorship_tag": "ABX9TyMHArnj2eZWRGGmqrDSgjTk",
9+
"authorship_tag": "ABX9TyPLopvW87TjfPqa4k8fkEwa",
1010
"include_colab_link": true
1111
},
1212
"kernelspec": {
@@ -139,6 +139,18 @@
139139
"execution_count": null,
140140
"outputs": []
141141
},
142+
{
143+
"cell_type": "code",
144+
"source": [
145+
"txt_path = '.'.join(img_path.split('.')[:-1])+'.txt'\n",
146+
"print(open(txt_path).read())"
147+
],
148+
"metadata": {
149+
"id": "CsqZvDYihMeZ"
150+
},
151+
"execution_count": null,
152+
"outputs": []
153+
},
142154
{
143155
"cell_type": "markdown",
144156
"source": [
@@ -152,8 +164,8 @@
152164
"cell_type": "code",
153165
"source": [
154166
"#@markdown ####**替换文本设置:**\n",
155-
"ori_text = \"an asian woman\" #@param {type: 'string'}\n",
156-
"new_text = \"<lyf>\" #@param {type: 'string'}\n",
167+
"ori_text = \"a woman\" #@param {type: 'string'}\n",
168+
"new_text = \"\\u003Clyf>\" #@param {type: 'string'}\n",
157169
"with open('1.txt','w') as f:\n",
158170
" f.write(ori_text)\n",
159171
"with open('2.txt','w') as f:\n",
@@ -166,6 +178,18 @@
166178
"execution_count": null,
167179
"outputs": []
168180
},
181+
{
182+
"cell_type": "code",
183+
"source": [
184+
"txt_path = '.'.join(img_path.split('.')[:-1])+'.txt'\n",
185+
"print(open(txt_path).read())"
186+
],
187+
"metadata": {
188+
"id": "mM6l7M68h4Hh"
189+
},
190+
"execution_count": null,
191+
"outputs": []
192+
},
169193
{
170194
"cell_type": "code",
171195
"source": [
@@ -194,7 +218,7 @@
194218
"cell_type": "code",
195219
"source": [
196220
"#@markdown ####**输入文本设置:**\n",
197-
"prompt = \"<dlrb>,solo, long hair, black hair, choker, breasts, earrings, blue eyes, jewelry, lipstick, makeup, dark, bare shoulders, mountain, night, upper body, dress, large breasts, ((masterpiece))\" #@param {type: 'string'}\n",
221+
"prompt = \"<lyf>,solo, long hair, black hair, choker, breasts, earrings, blue eyes, jewelry, lipstick, makeup, dark, bare shoulders, mountain, night, upper body, dress, large breasts, ((masterpiece))\" #@param {type: 'string'}\n",
198222
"with open('1.txt','w') as f:\n",
199223
" f.write(prompt)\n",
200224
"!python inference.py \\\n",
@@ -221,7 +245,8 @@
221245
" checkpoint/Lora/000-00000000.pth checkpoint/Lora/000-00000300.pth"
222246
],
223247
"metadata": {
224-
"id": "PIcVI5exCkp4"
248+
"id": "PIcVI5exCkp4",
249+
"cellView": "form"
225250
},
226251
"execution_count": null,
227252
"outputs": []
@@ -236,7 +261,8 @@
236261
"!wget https://github.com/LeslieZhoa/LVT/releases/download/v0.0/face_parsing.pt -P pretrained_models"
237262
],
238263
"metadata": {
239-
"id": "52oqmBZRDi_m"
264+
"id": "52oqmBZRDi_m",
265+
"cellView": "form"
240266
},
241267
"execution_count": null,
242268
"outputs": []

0 commit comments

Comments
 (0)