JuyeopDang commited on
Commit
e98f015
ยท
verified ยท
1 Parent(s): 5619a20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -6
app.py CHANGED
@@ -57,12 +57,39 @@ if __name__ == "__main__":
57
  images = np.clip(images / 2 + 0.5, 0, 1)
58
  return im.fromarray((images[0] * 255).astype(np.uint8))
59
 
60
- demo = gr.Interface(
61
- generate_image,
62
- inputs=[gr.Textbox(placeholder="๋ชฝํƒ€์ฃผ๋ฅผ ์„ค๋ช…ํ•˜๋Š” ํ…์ŠคํŠธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”.", label="Text Condition"),
63
- gr.Slider(0, 10, value=2, label="Guidance Scale", info="์ด ์ˆซ์ž๊ฐ€ ํฌ๋ฉด ํด์ˆ˜๋ก ์ž…๋ ฅ ํ…์ŠคํŠธ๋ฅผ ๋” ๊ฐ•ํ•˜๊ฒŒ ์ด์šฉํ•˜์—ฌ ๋ชฝํƒ€์ฃผ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.")],
64
- outputs=["image"],
65
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
  demo.launch()
68
 
 
57
  images = np.clip(images / 2 + 0.5, 0, 1)
58
  return im.fromarray((images[0] * 255).astype(np.uint8))
59
 
60
+ with gr.Blocks() as demo:
61
+ gr.Markdown(
62
+ """
63
+ # KoFace AI - ํ•œ๊ตญ์ธ ๋ชฝํƒ€์ฃผ ์ƒ์„ฑ๊ธฐ
64
+ * ๋ชฝํƒ€์ฃผ๋ฅผ ์„ค๋ช…ํ•˜๋Š” ํ…์ŠคํŠธ๋ฅผ ์ž…๋ ฅํ•˜๊ณ  '์ƒ์„ฑํ•˜๊ธฐ' ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ์ฃผ์„ธ์š”.
65
+
66
+ * **์ฐธ๊ณ **: ํ˜„์žฌ ๋ฌด๋ฃŒ ํ‹ฐ์–ด๋ฅผ ์ด์šฉํ•˜๊ณ  ์žˆ์–ด, **์ƒ์„ฑ์— ์•ฝ 10๋ถ„ ์ •๋„์˜ ์‹œ๊ฐ„**์ด ๊ฑธ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
67
+
68
+ * ์ด AI๋Š” Latent Diffusion Model์„ ์ง์ ‘ ๊ตฌํ˜„ํ•˜์—ฌ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ์ž์„ธํ•œ ์ฝ”๋“œ๋‚˜ ์‹คํ—˜ ๊ฒฐ๊ณผ๋Š” GitHub ์ €์žฅ์†Œ๋ฅผ ์ฐธ๊ณ ํ•ด ์ฃผ์„ธ์š”.
69
+
70
+ ๐Ÿ”— [GitHub ์ €์žฅ์†Œ ๋ฐ”๋กœ๊ฐ€๊ธฐ](https://github.com/Won-Seong/simple-latent-diffusion-model)
71
+
72
+
73
+ """
74
+ )
75
+
76
+ with gr.Row():
77
+ with gr.Column():
78
+ text_input = gr.Textbox(
79
+ placeholder="๋ชฝํƒ€์ฃผ๋ฅผ ์„ค๋ช…ํ•˜๋Š” ํ…์ŠคํŠธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”.",
80
+ label="Text Condition"
81
+ )
82
+ guidance_slider = gr.Slider(
83
+ 0, 10, value=2,
84
+ label="Guidance Scale",
85
+ info="์ด ์ˆซ์ž๊ฐ€ ํฌ๋ฉด ํด์ˆ˜๋ก ์ž…๋ ฅ ํ…์ŠคํŠธ๋ฅผ ๋” ๊ฐ•ํ•˜๊ฒŒ ์ด์šฉํ•˜์—ฌ ๋ชฝํƒ€์ฃผ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค."
86
+ )
87
+ submit_btn = gr.Button("์ƒ์„ฑํ•˜๊ธฐ")
88
+
89
+ with gr.Column():
90
+ image_output = gr.Image(label="์ƒ์„ฑ๋œ ๋ชฝํƒ€์ฃผ")
91
+
92
+ submit_btn.click(fn=greet, inputs=[text_input, guidance_slider], outputs=image_output)
93
 
94
  demo.launch()
95