Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,6 @@ def respond(message):
|
|
31 |
return result['url']
|
32 |
elif isinstance(result, tuple):
|
33 |
logging.error("Unexpected tuple response: %s", result)
|
34 |
-
# ํํ ์๋ต ์ฒ๋ฆฌ, ์๋ฅผ ๋ค์ด result[0] ์ด url์ ํฌํจํ๊ณ ์๋ค๊ณ ๊ฐ์
|
35 |
return result[0]
|
36 |
else:
|
37 |
raise ValueError("Unexpected API response format")
|
@@ -45,14 +44,29 @@ footer {
|
|
45 |
}
|
46 |
"""
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
# Gradio ์ธํฐํ์ด์ค ์ค์
|
49 |
demo = gr.Interface(
|
50 |
fn=respond,
|
51 |
inputs=gr.Textbox(label="Enter your prompt for image generation"),
|
52 |
outputs=gr.Image(label="Generated Image"),
|
|
|
53 |
theme="Nymbo/Nymbo_Theme",
|
54 |
css=css
|
55 |
)
|
56 |
|
57 |
if __name__ == "__main__":
|
58 |
-
demo.launch()
|
|
|
31 |
return result['url']
|
32 |
elif isinstance(result, tuple):
|
33 |
logging.error("Unexpected tuple response: %s", result)
|
|
|
34 |
return result[0]
|
35 |
else:
|
36 |
raise ValueError("Unexpected API response format")
|
|
|
44 |
}
|
45 |
"""
|
46 |
|
47 |
+
# ์ด๋ฏธ์ง ์์ฑ์ ์ํ ์์ ํ๋กฌํํธ
|
48 |
+
examples = [
|
49 |
+
["A futuristic cityscape at sunset."],
|
50 |
+
["A portrait of a cat wearing a monocle."],
|
51 |
+
["A serene landscape with mountains in the background and a clear lake in the foreground."],
|
52 |
+
["A street scene from Tokyo at night, vibrant and full of lights."],
|
53 |
+
["An astronaut riding a horse on Mars."],
|
54 |
+
["A surreal painting of a tree growing books."],
|
55 |
+
["A cottage in a snowy forest, lit by warm lights."],
|
56 |
+
["A still life of various fruits and a wine glass on a table."],
|
57 |
+
["A digital artwork of a neon-lit alley in a cyberpunk city."],
|
58 |
+
["A fantasy map of a fictional world, with detailed terrain and cities."]
|
59 |
+
]
|
60 |
+
|
61 |
# Gradio ์ธํฐํ์ด์ค ์ค์
|
62 |
demo = gr.Interface(
|
63 |
fn=respond,
|
64 |
inputs=gr.Textbox(label="Enter your prompt for image generation"),
|
65 |
outputs=gr.Image(label="Generated Image"),
|
66 |
+
examples=examples,
|
67 |
theme="Nymbo/Nymbo_Theme",
|
68 |
css=css
|
69 |
)
|
70 |
|
71 |
if __name__ == "__main__":
|
72 |
+
demo.launch()
|