fantaxy commited on
Commit
5843541
โ€ข
1 Parent(s): b8e1aa4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -2
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()