Spaces:
Runtime error
Runtime error
chenjian
commited on
Commit
·
9b6b695
1
Parent(s):
12c7dc4
fix
Browse files
app.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import numpy as np
|
| 2 |
import gradio as gr
|
| 3 |
import paddlehub as hub
|
| 4 |
-
import datetime
|
| 5 |
|
| 6 |
|
| 7 |
model = hub.Module(name='ernie_vilg')
|
|
@@ -38,16 +37,13 @@ def translate_language(text_prompts):
|
|
| 38 |
|
| 39 |
|
| 40 |
def inference(text_prompts, style_indx):
|
| 41 |
-
print(datetime.datetime.now())
|
| 42 |
try:
|
| 43 |
style = style_list[style_indx]
|
| 44 |
results = model.generate_image(
|
| 45 |
text_prompts=text_prompts, style=style, visualization=False)
|
| 46 |
except Exception as e:
|
| 47 |
error_text = str(e)
|
| 48 |
-
print(datetime.datetime.now())
|
| 49 |
return {status_text:error_text, gallery:None}
|
| 50 |
-
print(datetime.datetime.now())
|
| 51 |
return {status_text:'Success', gallery:results[:6]}
|
| 52 |
|
| 53 |
|
|
@@ -228,14 +224,14 @@ with block:
|
|
| 228 |
<div
|
| 229 |
style="
|
| 230 |
display: inline-flex;
|
| 231 |
-
align-items: center;
|
| 232 |
gap: 0.8rem;
|
| 233 |
font-size: 1.75rem;
|
| 234 |
margin-bottom: 10px;
|
|
|
|
| 235 |
justify-content: center;
|
| 236 |
"
|
| 237 |
>
|
| 238 |
-
<img src="https://user-images.githubusercontent.com/22424850/187387422-f6c9ccab-7fda-416e-a24d-7d6084c46f67.jpg" alt="Paddlehub" width="40%">
|
| 239 |
</div>
|
| 240 |
<div
|
| 241 |
style="
|
|
@@ -246,14 +242,15 @@ with block:
|
|
| 246 |
margin-bottom: 10px;
|
| 247 |
justify-content: center;
|
| 248 |
">
|
| 249 |
-
<h1 style="font-weight: 900; margin-bottom: 7px;">
|
| 250 |
ERNIE-ViLG Demo
|
| 251 |
-
</h1>
|
| 252 |
</div>
|
| 253 |
<p style="margin-bottom: 10px; font-size: 94%">
|
| 254 |
ERNIE-ViLG is a state-of-the-art text-to-image model that generates
|
| 255 |
images from Chinese text.
|
| 256 |
</p>
|
|
|
|
| 257 |
</div>
|
| 258 |
"""
|
| 259 |
)
|
|
@@ -302,7 +299,7 @@ with block:
|
|
| 302 |
<p><h4>Prompt公式</h4>
|
| 303 |
<span> Prompt = [形容词] [主语] ,[细节设定], [修饰语或者艺术家]。 </span>
|
| 304 |
关于各部分的构造方式和效果,可以参考<a href="https://github.com/PaddlePaddle/PaddleHub/blob/develop/modules/image/text_to_image/ernie_vilg/README.md#四-prompt-指南" style="text-decoration: underline;" target="_blank">YouPromptMe指南</a>。
|
| 305 |
-
更多的模型,请关注<a href="https://github.com/PaddlePaddle/PaddleHub" style="text-decoration: underline;" target="_blank"> PaddleHub 官方Repo </a>,
|
| 306 |
<p><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="20"><style>a:hover #llink{fill:url(#b);stroke:#ccc}a:hover #rlink{fill:#4183c4}</style><linearGradient id="a" x2="0" y2="100%"><stop offset="0" stop-color="#fcfcfc" stop-opacity="0"/><stop offset="1" stop-opacity=".1"/></linearGradient><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#ccc" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><g stroke="#d5d5d5"><rect stroke="none" fill="#fcfcfc" x="0.5" y="0.5" width="54" height="19" rx="2"/><rect x="60.5" y="0.5" width="29" height="19" rx="2" fill="#fafafa"/><rect x="60" y="7.5" width="0.5" height="5" stroke="#fafafa"/><path d="M60.5 6.5 l-3 3v1 l3 3" stroke="d5d5d5" fill="#fafafa"/></g><image x="5" y="3" width="14" height="14" xlink:href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMTgxNzE3IiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+R2l0SHViPC90aXRsZT48cGF0aCBkPSJNMTIgLjI5N2MtNi42MyAwLTEyIDUuMzczLTEyIDEyIDAgNS4zMDMgMy40MzggOS44IDguMjA1IDExLjM4NS42LjExMy44Mi0uMjU4LjgyLS41NzcgMC0uMjg1LS4wMS0xLjA0LS4wMTUtMi4wNC0zLjMzOC43MjQtNC4wNDItMS42MS00LjA0Mi0xLjYxQzQuNDIyIDE4LjA3IDMuNjMzIDE3LjcgMy42MzMgMTcuN2MtMS4wODctLjc0NC4wODQtLjcyOS4wODQtLjcyOSAxLjIwNS4wODQgMS44MzggMS4yMzYgMS44MzggMS4yMzYgMS4wNyAxLjgzNSAyLjgwOSAxLjMwNSAzLjQ5NS45OTguMTA4LS43NzYuNDE3LTEuMzA1Ljc2LTEuNjA1LTIuNjY1LS4zLTUuNDY2LTEuMzMyLTUuNDY2LTUuOTMgMC0xLjMxLjQ2NS0yLjM4IDEuMjM1LTMuMjItLjEzNS0uMzAzLS41NC0xLjUyMy4xMDUtMy4xNzYgMCAwIDEuMDA1LS4zMjIgMy4zIDEuMjMuOTYtLjI2NyAxLjk4LS4zOTkgMy0uNDA1IDEuMDIuMDA2IDIuMDQuMTM4IDMgLjQwNSAyLjI4LTEuNTUyIDMuMjg1LTEuMjMgMy4yODUtMS4yMy42NDUgMS42NTMuMjQgMi44NzMuMTIgMy4xNzYuNzY1Ljg0IDEuMjMgMS45MSAxLjIzIDMuMjIgMCA0LjYxLTIuODA1IDUuNjI1LTUuNDc1IDUuOTIuNDIuMzYuODEgMS4wOTYuODEgMi4yMiAwIDEuNjA2LS4wMTUgMi44OTYtLjAxNSAzLjI4NiAwIC4zMTUuMjEuNjkuODI1LjU3QzIwLjU2NSAyMi4wOTIgMjQgMTcuNTkyIDI0IDEyLjI5N2MwLTYuNjI3LTUuMzczLTEyLTEyLTEyIi8+PC9zdmc+"/><g aria-hidden="false" fill="#333" text-anchor="middle" font-family="Helvetica Neue,Helvetica,Arial,sans-serif" text-rendering="geometricPrecision" font-weight="700" font-size="110px" line-height="14px"><a target="_blank" xlink:href="https://github.com/PaddlePaddle/PaddleHub"><text aria-hidden="true" x="355" y="150" fill="#fff" transform="scale(.1)" textLength="270">Stars</text><text x="355" y="140" transform="scale(.1)" textLength="270">Stars</text><rect id="llink" stroke="#d5d5d5" fill="url(#a)" x=".5" y=".5" width="54" height="19" rx="2"/></a><a target="_blank" xlink:href="https://github.com/PaddlePaddle/PaddleHub/stargazers"><rect width="30" x="60" height="20" fill="rgba(0,0,0,0)"/><text aria-hidden="true" x="745" y="150" fill="#fff" transform="scale(.1)" textLength="210">8.4k</text><text id="rlink" x="745" y="140" transform="scale(.1)" textLength="210">8.4k</text></a></g></svg></p>
|
| 307 |
同时,可以在 <a href="https://aistudio.baidu.com/aistudio/projectdetail/4462918", style="text-decoration: underline;" target="_blank"> aistudio </a> 上使用免费的GPU体验更多案例。
|
| 308 |
</p>
|
|
@@ -311,12 +308,12 @@ with block:
|
|
| 311 |
<p><h4>Prompt format</h4>
|
| 312 |
<span> Prompt = [adjective] [object], [details], [styles or artists]. </span>
|
| 313 |
For more details, please refer to <a href="https://github.com/PaddlePaddle/PaddleHub/blob/develop/modules/image/text_to_image/ernie_vilg/README.md#四-prompt-指南" style="text-decoration: underline;" target="_blank">YouPromptMe Guide</a>.
|
| 314 |
-
There are more interesting models in PaddleHub, you
|
| 315 |
<p><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="20"><style>a:hover #llink{fill:url(#b);stroke:#ccc}a:hover #rlink{fill:#4183c4}</style><linearGradient id="a" x2="0" y2="100%"><stop offset="0" stop-color="#fcfcfc" stop-opacity="0"/><stop offset="1" stop-opacity=".1"/></linearGradient><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#ccc" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><g stroke="#d5d5d5"><rect stroke="none" fill="#fcfcfc" x="0.5" y="0.5" width="54" height="19" rx="2"/><rect x="60.5" y="0.5" width="29" height="19" rx="2" fill="#fafafa"/><rect x="60" y="7.5" width="0.5" height="5" stroke="#fafafa"/><path d="M60.5 6.5 l-3 3v1 l3 3" stroke="d5d5d5" fill="#fafafa"/></g><image x="5" y="3" width="14" height="14" xlink:href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMTgxNzE3IiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+R2l0SHViPC90aXRsZT48cGF0aCBkPSJNMTIgLjI5N2MtNi42MyAwLTEyIDUuMzczLTEyIDEyIDAgNS4zMDMgMy40MzggOS44IDguMjA1IDExLjM4NS42LjExMy44Mi0uMjU4LjgyLS41NzcgMC0uMjg1LS4wMS0xLjA0LS4wMTUtMi4wNC0zLjMzOC43MjQtNC4wNDItMS42MS00LjA0Mi0xLjYxQzQuNDIyIDE4LjA3IDMuNjMzIDE3LjcgMy42MzMgMTcuN2MtMS4wODctLjc0NC4wODQtLjcyOS4wODQtLjcyOSAxLjIwNS4wODQgMS44MzggMS4yMzYgMS44MzggMS4yMzYgMS4wNyAxLjgzNSAyLjgwOSAxLjMwNSAzLjQ5NS45OTguMTA4LS43NzYuNDE3LTEuMzA1Ljc2LTEuNjA1LTIuNjY1LS4zLTUuNDY2LTEuMzMyLTUuNDY2LTUuOTMgMC0xLjMxLjQ2NS0yLjM4IDEuMjM1LTMuMjItLjEzNS0uMzAzLS41NC0xLjUyMy4xMDUtMy4xNzYgMCAwIDEuMDA1LS4zMjIgMy4zIDEuMjMuOTYtLjI2NyAxLjk4LS4zOTkgMy0uNDA1IDEuMDIuMDA2IDIuMDQuMTM4IDMgLjQwNSAyLjI4LTEuNTUyIDMuMjg1LTEuMjMgMy4yODUtMS4yMy42NDUgMS42NTMuMjQgMi44NzMuMTIgMy4xNzYuNzY1Ljg0IDEuMjMgMS45MSAxLjIzIDMuMjIgMCA0LjYxLTIuODA1IDUuNjI1LTUuNDc1IDUuOTIuNDIuMzYuODEgMS4wOTYuODEgMi4yMiAwIDEuNjA2LS4wMTUgMi44OTYtLjAxNSAzLjI4NiAwIC4zMTUuMjEuNjkuODI1LjU3QzIwLjU2NSAyMi4wOTIgMjQgMTcuNTkyIDI0IDEyLjI5N2MwLTYuNjI3LTUuMzczLTEyLTEyLTEyIi8+PC9zdmc+"/><g aria-hidden="false" fill="#333" text-anchor="middle" font-family="Helvetica Neue,Helvetica,Arial,sans-serif" text-rendering="geometricPrecision" font-weight="700" font-size="110px" line-height="14px"><a target="_blank" xlink:href="https://github.com/PaddlePaddle/PaddleHub"><text aria-hidden="true" x="355" y="150" fill="#fff" transform="scale(.1)" textLength="270">Stars</text><text x="355" y="140" transform="scale(.1)" textLength="270">Stars</text><rect id="llink" stroke="#d5d5d5" fill="url(#a)" x=".5" y=".5" width="54" height="19" rx="2"/></a><a target="_blank" xlink:href="https://github.com/PaddlePaddle/PaddleHub/stargazers"><rect width="30" x="60" height="20" fill="rgba(0,0,0,0)"/><text aria-hidden="true" x="745" y="150" fill="#fff" transform="scale(.1)" textLength="210">8.4k</text><text id="rlink" x="745" y="140" transform="scale(.1)" textLength="210">8.4k</text></a></g></svg></p>
|
| 316 |
Besides, you can use free GPU resourses in <a href="https://aistudio.baidu.com/aistudio/projectdetail/4462918", style="text-decoration: underline;" target="_blank"> aistudio </a> to enjoy more cases, have fun.
|
| 317 |
</p>
|
| 318 |
</div>
|
| 319 |
-
|
| 320 |
"""
|
| 321 |
)
|
| 322 |
gr.Markdown(
|
|
@@ -362,368 +359,8 @@ In "Explore infinity" style mode, how the image looks like is totally up to your
|
|
| 362 |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 363 |
| 一只猫坐在椅子上,戴着一副墨镜,迷幻风格 | 日落时的城市天际线,迷幻风格 |
|
| 364 |
|
|
|
|
| 365 |
|
| 366 |
-
### 赛博朋克风格
|
| 367 |
-
|
| 368 |
-
|  |  |
|
| 369 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 370 |
-
| 一只猫坐在椅子上,戴着一副墨镜,赛博朋克风格 | 日落时的城市天际线,赛博朋克风格 |
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
### 纸箱风格
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|  |  |
|
| 377 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 378 |
-
| 一只猫坐在椅子上,戴着一副墨镜,纸箱风格 | 日落时的城市天际线,纸箱风格 |
|
| 379 |
-
|
| 380 |
-
### 未来主义风格
|
| 381 |
-
|
| 382 |
-
|  |  |
|
| 383 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 384 |
-
| 一只猫坐在椅子上,戴着一副墨镜,未来主义风格 | 一只猫坐在椅子上,戴着一副墨镜,未来主义风格 |
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
### 抽象技术风格
|
| 389 |
-
|
| 390 |
-
|  |  |
|
| 391 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 392 |
-
| 一只猫坐在椅子上,戴着一副墨镜,抽象技术风格 | 日落时的城市天际线,抽象技术风格 |
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
### 海滩兔风格
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|  |  |
|
| 401 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 402 |
-
| 一只猫坐在椅子上,戴着一副墨镜,海滩兔风格 | 日落时的城市天际线,海滩兔风格 |
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
### 粉红公主风格
|
| 406 |
-
|
| 407 |
-
|  |  |
|
| 408 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 409 |
-
| 一只猫坐在椅子上,戴着一副墨镜,粉红公主风格 | 日落时的城市天际线,粉红公主风格 |
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
### 嬉皮士风格
|
| 413 |
-
|
| 414 |
-
|  |  |
|
| 415 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 416 |
-
| 一只猫坐在椅子上,戴着一副墨镜,嬉皮士风格 | 日落时的城市天际线,嬉皮士风格 |
|
| 417 |
-
|
| 418 |
-
### 幻象之城风格
|
| 419 |
-
|
| 420 |
-
|  |  |
|
| 421 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 422 |
-
| 一只猫坐在椅子上,戴着一副墨镜,幻象之城风格 | 日落时的城市天际线,幻象之城风格 |
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
### 美人鱼风格
|
| 426 |
-
|
| 427 |
-
|  |  |
|
| 428 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 429 |
-
| 一只猫坐在椅子上,戴着一副墨镜,美人鱼风格 | 日落时的城市天际线,美人鱼风格 |
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
### 迷宫物语风格
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|  |  |
|
| 436 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 437 |
-
| 一只猫坐在椅子上,戴着一副墨镜,迷宫物语风格 | 日落时的城市天际线,迷宫物语风格 |
|
| 438 |
-
|
| 439 |
-
### 仙女风格
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|  |  |
|
| 443 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 444 |
-
| 一只猫坐在椅子上,戴着一副墨镜,仙女风格 | 日落时的城市天际线,仙女风格 |
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
### Low Poly 风格
|
| 451 |
-
|
| 452 |
-
|  |  |
|
| 453 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 454 |
-
| 一只猫坐在椅子上,戴着一副墨镜, low poly 风格 | 日落时的城市天际线, low-poly |
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
### 浮世绘风格
|
| 460 |
-
|
| 461 |
-
|  |  |
|
| 462 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 463 |
-
| 一只猫坐在椅子上,戴着一副墨镜,浮世绘风格 | 日落时的城市天际线,浮世绘风格 |
|
| 464 |
-
|
| 465 |
-
### 矢量心风格
|
| 466 |
-
|
| 467 |
-
|  |  |
|
| 468 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 469 |
-
| 一只猫坐在椅子上,戴着一副墨镜,矢量心风格 | 日落时的城市天际线,矢量心风格 |
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
### 摩托车手风格
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|  |  |
|
| 476 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 477 |
-
| 一只猫坐在椅子上,戴着一副墨镜,摩托车手风格 | 日落时的城市天际线,摩托车手风格 |
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
### 孟菲斯公司风格
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|  |  |
|
| 485 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 486 |
-
| 一只猫坐在椅子上,戴着一副墨镜,孟菲斯公司风格 | 日落时的城市天际线,孟菲斯公司风格 |
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
### 泥塑风格
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|  |  |
|
| 493 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 494 |
-
| 一只猫坐在椅子上,戴着一副墨镜, 泥塑风格 | 日落时的城市天际线, 泥塑风格 |
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
### 苔藓风格
|
| 500 |
-
|
| 501 |
-
|  |  |
|
| 502 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 503 |
-
| 一只猫坐在椅子上,戴着一副墨镜,苔藓风格 | 日落时的城市天际线,苔藓风格 |
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
### 新浪潮风格
|
| 508 |
-
|
| 509 |
-
|  |  |
|
| 510 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 511 |
-
| 一只猫坐在椅子上,戴着一副墨镜,新浪潮风格 | 日落时的城市天际线,新浪潮风格 |
|
| 512 |
-
|
| 513 |
-
### 嘻哈风格
|
| 514 |
-
|
| 515 |
-
|  |  |
|
| 516 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 517 |
-
| 一只猫坐在椅子上,戴着一副墨镜,嘻哈风格 | 日落时的城市天际线,嘻哈风格 |
|
| 518 |
-
|
| 519 |
-
### 矢量图
|
| 520 |
-
|
| 521 |
-
|  |  |
|
| 522 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 523 |
-
| 一只猫坐在椅子上,戴着一副墨镜, 矢量图 | 日落时的城市天际线, 矢量图 |
|
| 524 |
-
|
| 525 |
-
### 铅笔艺术
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|  |  |
|
| 529 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 530 |
-
| 一只猫坐在椅子上,戴着一副墨镜, 铅笔艺术 | 日落时的城市天际线, 铅笔艺术 |
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
### 女巫店风格
|
| 534 |
-
|
| 535 |
-
|  |  |
|
| 536 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 537 |
-
| 一只猫坐在椅子上,戴着一副墨镜,女巫店风格 | 日落时的城市天际线,女巫店风格 |
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
### 4D 建模
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|  |  |
|
| 545 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 546 |
-
| 一只猫坐在椅子上,戴着一副墨镜, 4D 建模 | 日落时的城市天际线, 4D 建模 |
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
### 水彩墨风格
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|  |  |
|
| 554 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 555 |
-
| 一只猫坐在椅子上,��着一副墨镜, 水彩墨风格 | 日落时的城市天际线, 水彩墨风格 |
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
### 酸性精灵风格
|
| 560 |
-
|
| 561 |
-
|  |  |
|
| 562 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 563 |
-
| 一只猫坐在椅子上,戴着一副墨镜,酸性精灵风格 | 日落时的城市天际线,酸性精灵风格 |
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
### 海盗风格
|
| 567 |
-
|
| 568 |
-
|  |  |
|
| 569 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 570 |
-
| 日落时的城市天际线,海盗风格 | 一只猫坐在椅子上,戴着一副墨镜,海盗风格 |
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
### 古埃及风格
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|  |  |
|
| 578 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 579 |
-
| 一只猫坐在椅子上,戴着一副墨镜,古埃及风格 | 日落时的城市天际线,古埃及风格 |
|
| 580 |
-
|
| 581 |
-
### 风帽风格
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|  |  |
|
| 585 |
-
| --------------------------------------------------------- | ------------------------------------------------------------ |
|
| 586 |
-
| 一只猫坐在椅子上,戴着一副墨镜,风帽风格 | 日落时的城市天际线,风帽风格 |
|
| 587 |
-
|
| 588 |
-
### 装饰艺术风格
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|  |  |
|
| 592 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 593 |
-
| 一只猫坐在椅子上,戴着一副墨镜,装饰艺术风格 | 日落时的城市天际线,装饰艺术风格 |
|
| 594 |
-
|
| 595 |
-
### 极光风格
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|  |  |
|
| 599 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 600 |
-
| 一只猫坐在椅子上,戴着一副墨镜,极光风格 | 日落时的城市天际线,极光风格 |
|
| 601 |
-
|
| 602 |
-
### 秋天风格
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|  |  |
|
| 606 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 607 |
-
| 日落时的城市天际线,秋天风格 | 一只猫坐在椅子上,戴着一副墨镜,秋天风格 |
|
| 608 |
-
|
| 609 |
-
### 巴洛克风格
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
|  |  |
|
| 613 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 614 |
-
| 一只猫坐在椅子上,戴着一副墨镜,巴洛克风格 | 日落时的城市天际线,巴洛克风格 |
|
| 615 |
-
|
| 616 |
-
### 立体主义风格
|
| 617 |
-
|
| 618 |
-
|  |  |
|
| 619 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 620 |
-
| 一只猫坐在椅子上,戴着一副墨镜,立体主义风格 | 日落时的城市天际线,立体主义风格 |
|
| 621 |
-
|
| 622 |
-
|
| 623 |
-
### 黑暗自然主义风格
|
| 624 |
-
|
| 625 |
-
|  |  |
|
| 626 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 627 |
-
| 一只猫坐在椅子上,戴着一副墨镜,黑暗自然主义风格 | 日落时的城市天际线,黑暗自然主义风格 |
|
| 628 |
-
|
| 629 |
-
### 表现主义风格
|
| 630 |
-
|
| 631 |
-
|  |  |
|
| 632 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 633 |
-
| 一只猫坐在椅子上,戴着一副墨镜,表现主义风格 | 日落时的城市天际线,表现主义风格 |
|
| 634 |
-
|
| 635 |
-
### 野兽派风格
|
| 636 |
-
|
| 637 |
-
|  |  |
|
| 638 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 639 |
-
| 一只猫坐在椅子上,戴着一副墨镜,野兽派风格 | 日落时的城市天际线,野兽派风格 |
|
| 640 |
-
|
| 641 |
-
### 鬼魂风格
|
| 642 |
-
|
| 643 |
-
|  |  |
|
| 644 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 645 |
-
| 一只猫坐在椅子上,戴着一副墨镜,鬼魂风格 | 日落时的城市天际线,鬼魂风格 |
|
| 646 |
-
|
| 647 |
-
### 印象主义风格
|
| 648 |
-
|
| 649 |
-
|  |  |
|
| 650 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 651 |
-
| 一只猫坐在椅子上,戴着一副墨镜,印象主义风格 | 日落时的城市天际线,印象主义风格 |
|
| 652 |
-
|
| 653 |
-
### 卡瓦伊风格
|
| 654 |
-
|
| 655 |
-
|  |  |
|
| 656 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 657 |
-
| 一只猫坐在椅子上,戴着一副墨镜,卡瓦伊风格 | 日落时的城市天际线,卡瓦伊风格 |
|
| 658 |
-
|
| 659 |
-
### 极简主义风格
|
| 660 |
-
|
| 661 |
-
|  |  |
|
| 662 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 663 |
-
| 一只猫坐在椅子上,戴着一副墨镜,极简主义风格 | 日落时的城市天际线,极简主义风格 |
|
| 664 |
-
|
| 665 |
-
### 水井惠郎风格
|
| 666 |
-
|
| 667 |
-
|  |  |
|
| 668 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 669 |
-
| 一只猫坐在椅子上,戴着一副墨镜,水井惠郎风格 | 日落时的城市天际线,水井惠郎风格 |
|
| 670 |
-
|
| 671 |
-
### 照片写实风格
|
| 672 |
-
|
| 673 |
-
|  |  |
|
| 674 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 675 |
-
| 一只猫坐在椅子上,戴着一副墨镜,照片写实风格 | 日落时的城市天际线,照片写实风格 |
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
### 像素可爱风格
|
| 679 |
-
|
| 680 |
-
|  |  |
|
| 681 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 682 |
-
| 一只猫坐在椅子上,戴着一副墨镜,像素可爱风格 | 日落时的城市天际线,像素可爱风格 |
|
| 683 |
-
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
### 雨天风格
|
| 687 |
-
|
| 688 |
-
|  |  |
|
| 689 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 690 |
-
| 日落时的城市天际线,雨天风格 | 一只猫坐在椅子上,戴着一副墨镜,雨天风格 |
|
| 691 |
-
|
| 692 |
-
### 湿漉漉的风格
|
| 693 |
-
|
| 694 |
-
|  |  |
|
| 695 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 696 |
-
| 一只猫坐在椅子上,戴着一副墨镜,湿漉漉的风格 | 日落时的城市天际线,湿漉漉的风格 |
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
### 维京人风格
|
| 700 |
-
|
| 701 |
-
|  |  |
|
| 702 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 703 |
-
| 一只猫坐在椅子上,戴着一副墨镜,维京人风格 | 日落时的城市天际线,维京人风格 |
|
| 704 |
-
|
| 705 |
-
### 后印象主义
|
| 706 |
-
|
| 707 |
-
|
| 708 |
-
|  |  |
|
| 709 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 710 |
-
| 一只猫坐在椅子上,戴着一副墨镜,风格:后印象主义 | 日落时的城市天际线, 风格:后印象主义-v2 |
|
| 711 |
-
|
| 712 |
-
### 素人主义
|
| 713 |
-
|
| 714 |
-
|
| 715 |
-
|  |  |
|
| 716 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 717 |
-
| 一只猫坐在椅子上,戴着一副墨镜,风格:素人主义 | 日落时的城市天际线, 风格:素人艺术 |
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
### 碎核风格
|
| 722 |
-
|
| 723 |
-
|
| 724 |
-
|  |  |
|
| 725 |
-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 726 |
-
| 一只猫坐在椅子上,戴着一副墨镜,碎核风格 | 日落时的城市天际线,碎核风格 |
|
| 727 |
|
| 728 |
"""
|
| 729 |
)
|
|
@@ -734,4 +371,4 @@ In "Explore infinity" style mode, how the image looks like is totally up to your
|
|
| 734 |
</div>
|
| 735 |
''')
|
| 736 |
|
| 737 |
-
block.queue(concurrency_count=
|
|
|
|
| 1 |
import numpy as np
|
| 2 |
import gradio as gr
|
| 3 |
import paddlehub as hub
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
model = hub.Module(name='ernie_vilg')
|
|
|
|
| 37 |
|
| 38 |
|
| 39 |
def inference(text_prompts, style_indx):
|
|
|
|
| 40 |
try:
|
| 41 |
style = style_list[style_indx]
|
| 42 |
results = model.generate_image(
|
| 43 |
text_prompts=text_prompts, style=style, visualization=False)
|
| 44 |
except Exception as e:
|
| 45 |
error_text = str(e)
|
|
|
|
| 46 |
return {status_text:error_text, gallery:None}
|
|
|
|
| 47 |
return {status_text:'Success', gallery:results[:6]}
|
| 48 |
|
| 49 |
|
|
|
|
| 224 |
<div
|
| 225 |
style="
|
| 226 |
display: inline-flex;
|
|
|
|
| 227 |
gap: 0.8rem;
|
| 228 |
font-size: 1.75rem;
|
| 229 |
margin-bottom: 10px;
|
| 230 |
+
margin-left: 220px;
|
| 231 |
justify-content: center;
|
| 232 |
"
|
| 233 |
>
|
| 234 |
+
<a href="https://github.com/PaddlePaddle/PaddleHub"><img src="https://user-images.githubusercontent.com/22424850/187387422-f6c9ccab-7fda-416e-a24d-7d6084c46f67.jpg" alt="Paddlehub" width="40%"></a>
|
| 235 |
</div>
|
| 236 |
<div
|
| 237 |
style="
|
|
|
|
| 242 |
margin-bottom: 10px;
|
| 243 |
justify-content: center;
|
| 244 |
">
|
| 245 |
+
<a href="https://github.com/PaddlePaddle/PaddleHub"><h1 style="font-weight: 900; margin-bottom: 7px;">
|
| 246 |
ERNIE-ViLG Demo
|
| 247 |
+
</h1></a>
|
| 248 |
</div>
|
| 249 |
<p style="margin-bottom: 10px; font-size: 94%">
|
| 250 |
ERNIE-ViLG is a state-of-the-art text-to-image model that generates
|
| 251 |
images from Chinese text.
|
| 252 |
</p>
|
| 253 |
+
<a href="https://github.com/PaddlePaddle/PaddleHub"><img src="https://user-images.githubusercontent.com/22424850/188184795-98605a22-9af2-4106-827b-e58548f8892f.png" alt="star Paddlehub" width="100%"></a>
|
| 254 |
</div>
|
| 255 |
"""
|
| 256 |
)
|
|
|
|
| 299 |
<p><h4>Prompt公式</h4>
|
| 300 |
<span> Prompt = [形容词] [主语] ,[细节设定], [修饰语或者艺术家]。 </span>
|
| 301 |
关于各部分的构造方式和效果,可以参考<a href="https://github.com/PaddlePaddle/PaddleHub/blob/develop/modules/image/text_to_image/ernie_vilg/README.md#四-prompt-指南" style="text-decoration: underline;" target="_blank">YouPromptMe指南</a>。
|
| 302 |
+
更多的模型,请关注<a href="https://github.com/PaddlePaddle/PaddleHub" style="text-decoration: underline;" target="_blank"> PaddleHub 官方Repo </a>, 如果你觉得不错,请star收藏吧。
|
| 303 |
<p><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="20"><style>a:hover #llink{fill:url(#b);stroke:#ccc}a:hover #rlink{fill:#4183c4}</style><linearGradient id="a" x2="0" y2="100%"><stop offset="0" stop-color="#fcfcfc" stop-opacity="0"/><stop offset="1" stop-opacity=".1"/></linearGradient><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#ccc" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><g stroke="#d5d5d5"><rect stroke="none" fill="#fcfcfc" x="0.5" y="0.5" width="54" height="19" rx="2"/><rect x="60.5" y="0.5" width="29" height="19" rx="2" fill="#fafafa"/><rect x="60" y="7.5" width="0.5" height="5" stroke="#fafafa"/><path d="M60.5 6.5 l-3 3v1 l3 3" stroke="d5d5d5" fill="#fafafa"/></g><image x="5" y="3" width="14" height="14" xlink:href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMTgxNzE3IiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+R2l0SHViPC90aXRsZT48cGF0aCBkPSJNMTIgLjI5N2MtNi42MyAwLTEyIDUuMzczLTEyIDEyIDAgNS4zMDMgMy40MzggOS44IDguMjA1IDExLjM4NS42LjExMy44Mi0uMjU4LjgyLS41NzcgMC0uMjg1LS4wMS0xLjA0LS4wMTUtMi4wNC0zLjMzOC43MjQtNC4wNDItMS42MS00LjA0Mi0xLjYxQzQuNDIyIDE4LjA3IDMuNjMzIDE3LjcgMy42MzMgMTcuN2MtMS4wODctLjc0NC4wODQtLjcyOS4wODQtLjcyOSAxLjIwNS4wODQgMS44MzggMS4yMzYgMS44MzggMS4yMzYgMS4wNyAxLjgzNSAyLjgwOSAxLjMwNSAzLjQ5NS45OTguMTA4LS43NzYuNDE3LTEuMzA1Ljc2LTEuNjA1LTIuNjY1LS4zLTUuNDY2LTEuMzMyLTUuNDY2LTUuOTMgMC0xLjMxLjQ2NS0yLjM4IDEuMjM1LTMuMjItLjEzNS0uMzAzLS41NC0xLjUyMy4xMDUtMy4xNzYgMCAwIDEuMDA1LS4zMjIgMy4zIDEuMjMuOTYtLjI2NyAxLjk4LS4zOTkgMy0uNDA1IDEuMDIuMDA2IDIuMDQuMTM4IDMgLjQwNSAyLjI4LTEuNTUyIDMuMjg1LTEuMjMgMy4yODUtMS4yMy42NDUgMS42NTMuMjQgMi44NzMuMTIgMy4xNzYuNzY1Ljg0IDEuMjMgMS45MSAxLjIzIDMuMjIgMCA0LjYxLTIuODA1IDUuNjI1LTUuNDc1IDUuOTIuNDIuMzYuODEgMS4wOTYuODEgMi4yMiAwIDEuNjA2LS4wMTUgMi44OTYtLjAxNSAzLjI4NiAwIC4zMTUuMjEuNjkuODI1LjU3QzIwLjU2NSAyMi4wOTIgMjQgMTcuNTkyIDI0IDEyLjI5N2MwLTYuNjI3LTUuMzczLTEyLTEyLTEyIi8+PC9zdmc+"/><g aria-hidden="false" fill="#333" text-anchor="middle" font-family="Helvetica Neue,Helvetica,Arial,sans-serif" text-rendering="geometricPrecision" font-weight="700" font-size="110px" line-height="14px"><a target="_blank" xlink:href="https://github.com/PaddlePaddle/PaddleHub"><text aria-hidden="true" x="355" y="150" fill="#fff" transform="scale(.1)" textLength="270">Stars</text><text x="355" y="140" transform="scale(.1)" textLength="270">Stars</text><rect id="llink" stroke="#d5d5d5" fill="url(#a)" x=".5" y=".5" width="54" height="19" rx="2"/></a><a target="_blank" xlink:href="https://github.com/PaddlePaddle/PaddleHub/stargazers"><rect width="30" x="60" height="20" fill="rgba(0,0,0,0)"/><text aria-hidden="true" x="745" y="150" fill="#fff" transform="scale(.1)" textLength="210">8.4k</text><text id="rlink" x="745" y="140" transform="scale(.1)" textLength="210">8.4k</text></a></g></svg></p>
|
| 304 |
同时,可以在 <a href="https://aistudio.baidu.com/aistudio/projectdetail/4462918", style="text-decoration: underline;" target="_blank"> aistudio </a> 上使用免费的GPU体验更多案例。
|
| 305 |
</p>
|
|
|
|
| 308 |
<p><h4>Prompt format</h4>
|
| 309 |
<span> Prompt = [adjective] [object], [details], [styles or artists]. </span>
|
| 310 |
For more details, please refer to <a href="https://github.com/PaddlePaddle/PaddleHub/blob/develop/modules/image/text_to_image/ernie_vilg/README.md#四-prompt-指南" style="text-decoration: underline;" target="_blank">YouPromptMe Guide</a>.
|
| 311 |
+
There are more interesting models in PaddleHub, if you think it's great, welcome to star <a href="https://github.com/PaddlePaddle/PaddleHub" style="text-decoration: underline;" target="_blank"> PaddleHub</a>.
|
| 312 |
<p><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="20"><style>a:hover #llink{fill:url(#b);stroke:#ccc}a:hover #rlink{fill:#4183c4}</style><linearGradient id="a" x2="0" y2="100%"><stop offset="0" stop-color="#fcfcfc" stop-opacity="0"/><stop offset="1" stop-opacity=".1"/></linearGradient><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#ccc" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><g stroke="#d5d5d5"><rect stroke="none" fill="#fcfcfc" x="0.5" y="0.5" width="54" height="19" rx="2"/><rect x="60.5" y="0.5" width="29" height="19" rx="2" fill="#fafafa"/><rect x="60" y="7.5" width="0.5" height="5" stroke="#fafafa"/><path d="M60.5 6.5 l-3 3v1 l3 3" stroke="d5d5d5" fill="#fafafa"/></g><image x="5" y="3" width="14" height="14" xlink:href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMTgxNzE3IiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+R2l0SHViPC90aXRsZT48cGF0aCBkPSJNMTIgLjI5N2MtNi42MyAwLTEyIDUuMzczLTEyIDEyIDAgNS4zMDMgMy40MzggOS44IDguMjA1IDExLjM4NS42LjExMy44Mi0uMjU4LjgyLS41NzcgMC0uMjg1LS4wMS0xLjA0LS4wMTUtMi4wNC0zLjMzOC43MjQtNC4wNDItMS42MS00LjA0Mi0xLjYxQzQuNDIyIDE4LjA3IDMuNjMzIDE3LjcgMy42MzMgMTcuN2MtMS4wODctLjc0NC4wODQtLjcyOS4wODQtLjcyOSAxLjIwNS4wODQgMS44MzggMS4yMzYgMS44MzggMS4yMzYgMS4wNyAxLjgzNSAyLjgwOSAxLjMwNSAzLjQ5NS45OTguMTA4LS43NzYuNDE3LTEuMzA1Ljc2LTEuNjA1LTIuNjY1LS4zLTUuNDY2LTEuMzMyLTUuNDY2LTUuOTMgMC0xLjMxLjQ2NS0yLjM4IDEuMjM1LTMuMjItLjEzNS0uMzAzLS41NC0xLjUyMy4xMDUtMy4xNzYgMCAwIDEuMDA1LS4zMjIgMy4zIDEuMjMuOTYtLjI2NyAxLjk4LS4zOTkgMy0uNDA1IDEuMDIuMDA2IDIuMDQuMTM4IDMgLjQwNSAyLjI4LTEuNTUyIDMuMjg1LTEuMjMgMy4yODUtMS4yMy42NDUgMS42NTMuMjQgMi44NzMuMTIgMy4xNzYuNzY1Ljg0IDEuMjMgMS45MSAxLjIzIDMuMjIgMCA0LjYxLTIuODA1IDUuNjI1LTUuNDc1IDUuOTIuNDIuMzYuODEgMS4wOTYuODEgMi4yMiAwIDEuNjA2LS4wMTUgMi44OTYtLjAxNSAzLjI4NiAwIC4zMTUuMjEuNjkuODI1LjU3QzIwLjU2NSAyMi4wOTIgMjQgMTcuNTkyIDI0IDEyLjI5N2MwLTYuNjI3LTUuMzczLTEyLTEyLTEyIi8+PC9zdmc+"/><g aria-hidden="false" fill="#333" text-anchor="middle" font-family="Helvetica Neue,Helvetica,Arial,sans-serif" text-rendering="geometricPrecision" font-weight="700" font-size="110px" line-height="14px"><a target="_blank" xlink:href="https://github.com/PaddlePaddle/PaddleHub"><text aria-hidden="true" x="355" y="150" fill="#fff" transform="scale(.1)" textLength="270">Stars</text><text x="355" y="140" transform="scale(.1)" textLength="270">Stars</text><rect id="llink" stroke="#d5d5d5" fill="url(#a)" x=".5" y=".5" width="54" height="19" rx="2"/></a><a target="_blank" xlink:href="https://github.com/PaddlePaddle/PaddleHub/stargazers"><rect width="30" x="60" height="20" fill="rgba(0,0,0,0)"/><text aria-hidden="true" x="745" y="150" fill="#fff" transform="scale(.1)" textLength="210">8.4k</text><text id="rlink" x="745" y="140" transform="scale(.1)" textLength="210">8.4k</text></a></g></svg></p>
|
| 313 |
Besides, you can use free GPU resourses in <a href="https://aistudio.baidu.com/aistudio/projectdetail/4462918", style="text-decoration: underline;" target="_blank"> aistudio </a> to enjoy more cases, have fun.
|
| 314 |
</p>
|
| 315 |
</div>
|
| 316 |
+
|
| 317 |
"""
|
| 318 |
)
|
| 319 |
gr.Markdown(
|
|
|
|
| 359 |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 360 |
| 一只猫坐在椅子上,戴着一副墨镜,迷幻风格 | 日落时的城市天际线,迷幻风格 |
|
| 361 |
|
| 362 |
+
### <u>[更多内容...](https://github.com/PaddlePaddle/PaddleHub/blob/develop/modules/image/text_to_image/ernie_vilg/README.md#四-prompt-指南)([Explore more...](https://github.com/PaddlePaddle/PaddleHub/blob/develop/modules/image/text_to_image/ernie_vilg/README.md#四-prompt-指南))</u>
|
| 363 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 364 |
|
| 365 |
"""
|
| 366 |
)
|
|
|
|
| 371 |
</div>
|
| 372 |
''')
|
| 373 |
|
| 374 |
+
block.queue(concurrency_count=128).launch()
|