fantaxy commited on
Commit
7a1a45e
โ€ข
1 Parent(s): a80ab56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -11
app.py CHANGED
@@ -44,8 +44,6 @@ footer {
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,15 +67,24 @@ examples = [
69
  ["A fantasy map of a fictional world, with detailed terrain and cities.", "q19.webp"]
70
  ]
71
 
72
- demo = gr.Interface(
73
- fn=respond,
74
- inputs=gr.Textbox(label="Enter your prompt for image generation"),
75
- outputs=gr.Image(label="Generated Image"),
76
- examples=examples,
77
- theme="Nymbo/Nymbo_Theme",
78
- css=css,
79
- cache_examples=False # ์˜ˆ์ œ ์บ์‹ฑ ๋น„ํ™œ์„ฑํ™”
80
- )
 
 
 
 
 
 
 
 
 
81
 
82
  if __name__ == "__main__":
83
  demo.launch()
 
44
  }
45
  """
46
 
 
 
47
  # ์ด๋ฏธ์ง€ ์ƒ์„ฑ์„ ์œ„ํ•œ ์˜ˆ์ œ ํ”„๋กฌํ”„ํŠธ
48
  examples = [
49
  ["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"],
 
67
  ["A fantasy map of a fictional world, with detailed terrain and cities.", "q19.webp"]
68
  ]
69
 
70
+
71
+ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
72
+ gr.Markdown("# Image Generation with Examples")
73
+
74
+ with gr.Row():
75
+ input_text = gr.Textbox(label="Enter your prompt for image generation")
76
+ output_image = gr.Image(label="Generated Image")
77
+
78
+ gr.Examples(
79
+ examples,
80
+ inputs=input_text,
81
+ outputs=output_image,
82
+ fn=respond,
83
+ cache_examples=False,
84
+ label="Example Prompts and Images"
85
+ )
86
+
87
+ input_text.submit(fn=respond, inputs=input_text, outputs=output_image)
88
 
89
  if __name__ == "__main__":
90
  demo.launch()