Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,30 +38,28 @@ if not path.exists(gallery_path):
|
|
| 38 |
|
| 39 |
# 샘플 이미지와 프롬프트 정의
|
| 40 |
SAMPLE_IMAGES = {
|
| 41 |
-
|
| 42 |
-
"
|
| 43 |
-
"
|
| 44 |
-
"
|
| 45 |
-
"
|
| 46 |
-
"
|
| 47 |
-
"
|
| 48 |
-
"
|
| 49 |
-
"
|
| 50 |
-
"
|
| 51 |
-
"
|
| 52 |
-
"
|
| 53 |
-
"
|
| 54 |
-
"
|
| 55 |
-
"
|
| 56 |
-
"
|
| 57 |
-
"
|
| 58 |
-
"
|
| 59 |
-
"
|
| 60 |
-
"
|
| 61 |
-
"
|
| 62 |
-
"
|
| 63 |
-
"3d23.webp": "Could I but see your father, and my mind reveal, I have both gold and silver, and houses at my will ",
|
| 64 |
-
|
| 65 |
"3d1.webp": "the most famous hero according to Zhou Qi"
|
| 66 |
}
|
| 67 |
|
|
@@ -286,7 +284,15 @@ with gr.Blocks(
|
|
| 286 |
# Gallery 섹션
|
| 287 |
with gr.Row(elem_classes="gallery-container"):
|
| 288 |
gr.HTML("<h2 class='gallery-title'>Gallery</h2>")
|
| 289 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
|
| 291 |
for img_file, prompt_text in SAMPLE_IMAGES.items():
|
| 292 |
img_path = os.path.abspath(img_file) # 절대 경로로 변환
|
|
@@ -296,7 +302,7 @@ with gr.Blocks(
|
|
| 296 |
with open(img_path, "rb") as img:
|
| 297 |
img_data = base64.b64encode(img.read()).decode()
|
| 298 |
|
| 299 |
-
#
|
| 300 |
gallery_html += f"""
|
| 301 |
<div style='
|
| 302 |
border: 1px solid #ddd;
|
|
|
|
| 38 |
|
| 39 |
# 샘플 이미지와 프롬프트 정의
|
| 40 |
SAMPLE_IMAGES = {
|
| 41 |
+
"3d2.webp": "the most famous hero according to Yuri Milner",
|
| 42 |
+
"3d3.webp": "purple nest",
|
| 43 |
+
"3d4.webp": "Timothy's sabbath",
|
| 44 |
+
"3d5.webp": "A schoolboy friend of Julián Carax, fun-loving and loyal",
|
| 45 |
+
"3d6.webp": "Friend of Daniel and his father",
|
| 46 |
+
"3d7.webp": "WHERE ships of purple gently toss On seas of daffodil",
|
| 47 |
+
"3d8.webp": "Beat the drums of tragedy for me, And let the white violins whir thin and slow",
|
| 48 |
+
"3d9.webp": "And let the choir sing a stormy song To drown the rattle of my dying breath.",
|
| 49 |
+
"3d10.webp": "Beat the drums of tragedy and death",
|
| 50 |
+
"3d11.webp": "Beat the drums of tragedy for me.",
|
| 51 |
+
"3d12.webp": "Touching the infinite, else far and untrod, With oracles divine that speak of God.",
|
| 52 |
+
"3d13.webp": "Night, standing on her starry pulpit, free, Utters them in the dread, the silver roll Of spheres, woods, winds and waves, alternately",
|
| 53 |
+
"3d14.webp": "On sermons deep, fit time to feast the soul.",
|
| 54 |
+
"3d15.webp": "The bee is cradled in the bud; and far, Cold glittering lights, the azure curtain, throng— Planet on beaming planet, star on star.",
|
| 55 |
+
"3d16.webp": "The lark's sweet pipe has ceased its latest song",
|
| 56 |
+
"3d17.webp": "the snake was a roaming dog",
|
| 57 |
+
"3d18.webp": "Antonio Battistella portraying Father of Giulia",
|
| 58 |
+
"3d19.webp": "So straight to her father the brisk young lady went, And said, grant me one favour, do give your consent",
|
| 59 |
+
"3d20.webp": "Before that we are marry’d let me your father see, All fear is, now miscarry’d, my heart is full of glee",
|
| 60 |
+
"3d21.webp": "My heart you now have gained, you are all I prize, So make yourself contented, pray be satisfied.",
|
| 61 |
+
"3d22.webp": "O pray what is the favour that of me you crave? If it lies in my power you the same shall have",
|
| 62 |
+
"3d23.webp": "Could I but see your father, and my mind reveal, I have both gold and silver, and houses at my will",
|
|
|
|
|
|
|
| 63 |
"3d1.webp": "the most famous hero according to Zhou Qi"
|
| 64 |
}
|
| 65 |
|
|
|
|
| 284 |
# Gallery 섹션
|
| 285 |
with gr.Row(elem_classes="gallery-container"):
|
| 286 |
gr.HTML("<h2 class='gallery-title'>Gallery</h2>")
|
| 287 |
+
|
| 288 |
+
# grid-template-columns를 repeat(4, 1fr)로 지정하여 한 줄에 4개씩 이미지
|
| 289 |
+
gallery_html = """
|
| 290 |
+
<div style='
|
| 291 |
+
display: grid;
|
| 292 |
+
grid-template-columns: repeat(4, 1fr);
|
| 293 |
+
gap: 20px;
|
| 294 |
+
'>
|
| 295 |
+
"""
|
| 296 |
|
| 297 |
for img_file, prompt_text in SAMPLE_IMAGES.items():
|
| 298 |
img_path = os.path.abspath(img_file) # 절대 경로로 변환
|
|
|
|
| 302 |
with open(img_path, "rb") as img:
|
| 303 |
img_data = base64.b64encode(img.read()).decode()
|
| 304 |
|
| 305 |
+
# MIME타입(webp)
|
| 306 |
gallery_html += f"""
|
| 307 |
<div style='
|
| 308 |
border: 1px solid #ddd;
|