Spaces:
Running
on
Zero
Running
on
Zero
seawolf2357
commited on
Commit
•
b3d3ef3
1
Parent(s):
15a0cfa
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import random
|
2 |
import os
|
3 |
import uuid
|
@@ -54,15 +55,8 @@ def load_generated_images():
|
|
54 |
return image_files
|
55 |
|
56 |
def load_predefined_images():
|
57 |
-
|
58 |
-
|
59 |
-
"assets/cm2.webp",
|
60 |
-
"assets/cm3.webp",
|
61 |
-
"assets/cm4.webp",
|
62 |
-
"assets/cm5.webp",
|
63 |
-
"assets/cm6.webp",
|
64 |
-
]
|
65 |
-
return predefined_images
|
66 |
|
67 |
@spaces.GPU(duration=120)
|
68 |
def inference(
|
@@ -96,6 +90,20 @@ def inference(
|
|
96 |
# Return the image, seed, and updated gallery
|
97 |
return image, seed, load_generated_images()
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
css = """
|
100 |
footer {
|
101 |
visibility: hidden;
|
@@ -103,7 +111,7 @@ footer {
|
|
103 |
"""
|
104 |
|
105 |
with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css, analytics_enabled=False) as demo:
|
106 |
-
gr.HTML('<div class="title">
|
107 |
gr.HTML('<div class="title">😄Image to Video Explore: <a href="https://huggingface.co/spaces/ginigen/theater" target="_blank">https://huggingface.co/spaces/ginigen/theater</a></div>')
|
108 |
|
109 |
with gr.Tabs() as tabs:
|
@@ -171,7 +179,7 @@ with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css, analytics_enabled=Fa
|
|
171 |
)
|
172 |
|
173 |
gr.Examples(
|
174 |
-
examples=
|
175 |
inputs=[prompt],
|
176 |
outputs=[result, seed],
|
177 |
)
|
@@ -188,15 +196,6 @@ with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css, analytics_enabled=Fa
|
|
188 |
)
|
189 |
refresh_btn = gr.Button("🔄 Refresh Gallery")
|
190 |
|
191 |
-
# Add sample gallery section at the bottom
|
192 |
-
gr.Markdown("### Claude Monet Style Examples")
|
193 |
-
predefined_gallery = gr.Gallery(
|
194 |
-
label="Sample Images",
|
195 |
-
columns=3,
|
196 |
-
rows=2,
|
197 |
-
show_label=False,
|
198 |
-
value=load_predefined_images()
|
199 |
-
)
|
200 |
|
201 |
# Event handlers
|
202 |
def refresh_gallery():
|
|
|
1 |
+
|
2 |
import random
|
3 |
import os
|
4 |
import uuid
|
|
|
55 |
return image_files
|
56 |
|
57 |
def load_predefined_images():
|
58 |
+
# Return empty list since we're not using predefined images
|
59 |
+
return []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
@spaces.GPU(duration=120)
|
62 |
def inference(
|
|
|
90 |
# Return the image, seed, and updated gallery
|
91 |
return image, seed, load_generated_images()
|
92 |
|
93 |
+
examples = [
|
94 |
+
"A young woman in a silk hanbok beneath cherry blossoms, wearing a jeogori in delicate peach silk with white diagonal lines, paired with a flowing chima in jade green. Her carefully wrapped hair is adorned with a silver binyeo catching the spring light. The hanbok's gentle movement mirrors the falling cherry petals, while the contrast between the soft peach top and vibrant green skirt creates a harmonious balance with the spring scenery. [trigger]",
|
95 |
+
|
96 |
+
"A noble lady in traditional hanbok beside a palace pond, dressed in a royal blue jeogori adorned with intricate gold embroidery of phoenixes. Her deep crimson chima sweeps gracefully across the weathered stone steps, its silk surface rippling like water in the autumn breeze. Traditional jewelry including a jade daenggi and gold norigae complete her elegant ensemble, catching the late afternoon sun. [trigger]",
|
97 |
+
|
98 |
+
"A bride in ceremonial wedding hanbok under moonlight, wearing a dynasty red jeogori embellished with golden symmetric patterns. Her voluminous purple chima, adorned with delicate silver-threaded flowers, creates a regal silhouette against the traditional wooden pavilion. The white collar and golden tasseled norigae sway gently as she moves, her face serene beneath the traditional jokduri headdress. [trigger]",
|
99 |
+
|
100 |
+
"A young musician in performance hanbok by a traditional gayageum, dressed in a snow-white jeogori with delicate embroidered plum blossoms. Her flowing indigo chima pools around her as she sits, the fabric's sheen changing with each movement. A single orchid ornament in her classic braid reflects her artistic refinement, while the hanbok's clean lines emphasize her graceful posture. [trigger]",
|
101 |
+
|
102 |
+
"A court lady in winter hanbok amid falling snow, wearing a deep forest green jeogori lined with fur at the cuffs. Her burgundy chima, padded for warmth, creates elegant swirls in the snow as she walks. Delicate golden-threaded patterns at her shoulders catch the winter light, while her carved jade binyeo holds her hair in a traditional style, completing the picture of winter elegance. [trigger]",
|
103 |
+
|
104 |
+
"A dancer in festival hanbok at sunset, wearing a vibrant yellow jeogori that seems to capture the golden hour light. Her twirling sapphire blue chima creates a mesmerizing display of movement and color, its silk surface reflecting the warm evening glow. Silver bangles and a coral daenggi add flashes of brilliance as she moves, the hanbok's traditional silhouette transformed into a dynamic celebration of color and motion. [trigger]"
|
105 |
+
]
|
106 |
+
|
107 |
css = """
|
108 |
footer {
|
109 |
visibility: hidden;
|
|
|
111 |
"""
|
112 |
|
113 |
with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css, analytics_enabled=False) as demo:
|
114 |
+
gr.HTML('<div class="title"> KOREA PALACE STUDIO </div>')
|
115 |
gr.HTML('<div class="title">😄Image to Video Explore: <a href="https://huggingface.co/spaces/ginigen/theater" target="_blank">https://huggingface.co/spaces/ginigen/theater</a></div>')
|
116 |
|
117 |
with gr.Tabs() as tabs:
|
|
|
179 |
)
|
180 |
|
181 |
gr.Examples(
|
182 |
+
examples=examples,
|
183 |
inputs=[prompt],
|
184 |
outputs=[result, seed],
|
185 |
)
|
|
|
196 |
)
|
197 |
refresh_btn = gr.Button("🔄 Refresh Gallery")
|
198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
|
200 |
# Event handlers
|
201 |
def refresh_gallery():
|