Update app.py
Browse files
app.py
CHANGED
@@ -10,9 +10,6 @@ logging.basicConfig(level=logging.INFO)
|
|
10 |
api_client = Client("http://211.233.58.202:7960/")
|
11 |
|
12 |
def respond(message):
|
13 |
-
if message.endswith('.webp'):
|
14 |
-
return message # ์ด๋ฏธ์ง ํ์ผ๋ช
๋ง ๋ฐํ
|
15 |
-
|
16 |
logging.info("Received message: %s", message)
|
17 |
|
18 |
try:
|
@@ -47,6 +44,8 @@ footer {
|
|
47 |
}
|
48 |
"""
|
49 |
|
|
|
|
|
50 |
# ์ด๋ฏธ์ง ์์ฑ์ ์ํ ์์ ํ๋กฌํํธ
|
51 |
examples = [
|
52 |
["A glamorous young woman with long, wavy blonde hair and smokey eye makeup, posing in a luxury hotel room. Sheโs wearing a sparkly gold cocktail dress and holding up a white card with 'openfree.ai' written on it in elegant calligraphy. Soft, warm lighting creates a luxurious atmosphere. ", "q1.webp"],
|
@@ -70,6 +69,7 @@ examples = [
|
|
70 |
["A fantasy map of a fictional world, with detailed terrain and cities.", "q19.webp"]
|
71 |
]
|
72 |
|
|
|
73 |
demo = gr.Interface(
|
74 |
fn=respond,
|
75 |
inputs=gr.Textbox(label="Enter your prompt for image generation"),
|
@@ -80,5 +80,15 @@ demo = gr.Interface(
|
|
80 |
cache_examples=False # ์์ ์บ์ฑ ๋นํ์ฑํ
|
81 |
)
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
if __name__ == "__main__":
|
84 |
-
demo.launch()
|
|
|
10 |
api_client = Client("http://211.233.58.202:7960/")
|
11 |
|
12 |
def respond(message):
|
|
|
|
|
|
|
13 |
logging.info("Received message: %s", message)
|
14 |
|
15 |
try:
|
|
|
44 |
}
|
45 |
"""
|
46 |
|
47 |
+
|
48 |
+
|
49 |
# ์ด๋ฏธ์ง ์์ฑ์ ์ํ ์์ ํ๋กฌํํธ
|
50 |
examples = [
|
51 |
["A glamorous young woman with long, wavy blonde hair and smokey eye makeup, posing in a luxury hotel room. Sheโs wearing a sparkly gold cocktail dress and holding up a white card with 'openfree.ai' written on it in elegant calligraphy. Soft, warm lighting creates a luxurious atmosphere. ", "q1.webp"],
|
|
|
69 |
["A fantasy map of a fictional world, with detailed terrain and cities.", "q19.webp"]
|
70 |
]
|
71 |
|
72 |
+
|
73 |
demo = gr.Interface(
|
74 |
fn=respond,
|
75 |
inputs=gr.Textbox(label="Enter your prompt for image generation"),
|
|
|
80 |
cache_examples=False # ์์ ์บ์ฑ ๋นํ์ฑํ
|
81 |
)
|
82 |
|
83 |
+
# Examples ์ปดํฌ๋ํธ ์ถ๊ฐ
|
84 |
+
image_examples = gr.Examples(
|
85 |
+
examples=[[ex[0], f"{ex[1]}"] for ex in examples],
|
86 |
+
inputs=demo.input_components[0],
|
87 |
+
outputs=demo.output_components[0],
|
88 |
+
fn=respond,
|
89 |
+
cache_examples=False,
|
90 |
+
label="Image Examples"
|
91 |
+
)
|
92 |
+
|
93 |
if __name__ == "__main__":
|
94 |
+
demo.launch()
|