cwhuh commited on
Commit
ea14e74
Β·
1 Parent(s): c23e991

chore : update ui

Browse files
__pycache__/live_preview_helpers.cpython-310.pyc CHANGED
Binary files a/__pycache__/live_preview_helpers.cpython-310.pyc and b/__pycache__/live_preview_helpers.cpython-310.pyc differ
 
__pycache__/llm_wrapper.cpython-310.pyc CHANGED
Binary files a/__pycache__/llm_wrapper.cpython-310.pyc and b/__pycache__/llm_wrapper.cpython-310.pyc differ
 
app.py CHANGED
@@ -69,86 +69,98 @@ examples = [
69
  css="""
70
  #col-container {
71
  margin: 0 auto;
72
- max-width: 520px;
 
 
 
 
 
 
 
73
  }
74
  """
75
 
76
- with gr.Blocks(css=css) as demo:
77
 
78
  with gr.Column(elem_id="col-container"):
79
- gr.Markdown(f"""# [POSTECH] PONIX Generator 🌊
80
  [[based on FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md)]
81
  """)
82
 
83
- with gr.Row():
84
-
 
 
 
 
 
 
 
85
  prompt = gr.Text(
86
- label="Prompt",
87
- show_label=False,
88
  max_lines=1,
89
- placeholder="Enter your prompt",
90
- container=False,
91
  )
92
 
93
- run_button = gr.Button("Run", scale=0)
94
 
95
- result = gr.Image(label="Result", show_label=False)
96
 
97
- with gr.Accordion("Advanced Settings", open=False):
98
-
99
- use_prompt_refinement = gr.Checkbox(
100
- label="Use prompt refinement",
101
- value=True,
102
- info="AIκ°€ μž…λ ₯ν•œ ν”„λ‘¬ν”„νŠΈλ₯Ό μžλ™μœΌλ‘œ κ°œμ„ ν•©λ‹ˆλ‹€. "
103
- )
104
-
105
-
106
- seed = gr.Slider(
107
- label="Seed",
108
- minimum=0,
109
- maximum=MAX_SEED,
110
- step=1,
111
- value=0,
112
- )
113
-
114
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
115
-
116
- with gr.Row():
117
-
118
- width = gr.Slider(
119
- label="Width",
120
- minimum=256,
121
- maximum=MAX_IMAGE_SIZE,
122
- step=32,
123
- value=1024,
124
  )
125
 
126
- height = gr.Slider(
127
- label="Height",
128
- minimum=256,
129
- maximum=MAX_IMAGE_SIZE,
130
- step=32,
131
- value=1024,
132
- )
133
-
134
- with gr.Row():
135
-
136
- guidance_scale = gr.Slider(
137
- label="Guidance Scale",
138
- minimum=1,
139
- maximum=15,
140
- step=0.1,
141
- value=3.5,
142
- )
143
-
144
- num_inference_steps = gr.Slider(
145
- label="Number of inference steps",
146
- minimum=1,
147
- maximum=50,
148
- step=1,
149
- value=28,
150
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
 
 
152
  gr.Examples(
153
  examples = examples,
154
  fn = infer,
@@ -156,6 +168,12 @@ with gr.Blocks(css=css) as demo:
156
  outputs = [result, seed],
157
  cache_examples="lazy"
158
  )
 
 
 
 
 
 
159
 
160
  gr.on(
161
  triggers=[run_button.click, prompt.submit],
 
69
  css="""
70
  #col-container {
71
  margin: 0 auto;
72
+ max-width: 580px;
73
+ }
74
+
75
+ .footer {
76
+ text-align: center;
77
+ margin-top: 20px;
78
+ font-size: 0.8em;
79
+ color: #666;
80
  }
81
  """
82
 
83
+ with gr.Blocks(css=css, theme="soft") as demo:
84
 
85
  with gr.Column(elem_id="col-container"):
86
+ gr.Markdown(f"""# 🌊 [POSTECH] PONIX Generator
87
  [[based on FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md)]
88
  """)
89
 
90
+ with gr.Box():
91
+ gr.Markdown("""
92
+ ### πŸ” μ‚¬μš© κ°€μ΄λ“œ
93
+ - μƒμ„±ν•˜κ³  싢은 이미지λ₯Ό ν•œκΈ€λ‘œ κ°„λ‹¨ν•˜κ²Œ μž‘μ„±ν•΄μ£Όμ„Έμš”.
94
+ - μ΄λ―Έμ§€λŠ” λ…Έμ΄μ¦ˆμ—μ„œ 점차적으둜 μƒμ„±λ©λ‹ˆλ‹€. (40~50초 μ†Œμš”)
95
+ - λ¬Έμ˜λŠ” μ΄λ©”μΌλ‘œ λΆ€νƒλ“œλ¦½λ‹ˆλ‹€: [email protected]
96
+ """)
97
+
98
+ with gr.Group():
99
  prompt = gr.Text(
100
+ label="ν”„λ‘¬ν”„νŠΈ μž…λ ₯",
 
101
  max_lines=1,
102
+ placeholder="μ›ν•˜λŠ” ν¬λ‹‰μŠ€ 이미지λ₯Ό ν•œκΈ€λ‘œ μ„€λͺ…ν•΄μ£Όμ„Έμš”",
103
+ container=True,
104
  )
105
 
106
+ run_button = gr.Button("πŸš€ μƒμ„±ν•˜κΈ°", variant="primary")
107
 
108
+ result = gr.Image(label="μƒμ„±λœ 이미지")
109
 
110
+ with gr.Accordion("πŸ› οΈ κ³ κΈ‰ μ„€μ •", open=False):
111
+ with gr.Group():
112
+ use_prompt_refinement = gr.Checkbox(
113
+ label="ν”„λ‘¬ν”„νŠΈ μžλ™ κ°œμ„ ",
114
+ value=True,
115
+ info="AIκ°€ μž…λ ₯ν•œ ν”„λ‘¬ν”„νŠΈλ₯Ό μžλ™μœΌλ‘œ κ°œμ„ ν•©λ‹ˆλ‹€."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  )
117
 
118
+ with gr.Row():
119
+ seed = gr.Slider(
120
+ label="μ‹œλ“œ κ°’",
121
+ minimum=0,
122
+ maximum=MAX_SEED,
123
+ step=1,
124
+ value=0,
125
+ )
126
+
127
+ randomize_seed = gr.Checkbox(label="랜덀 μ‹œλ“œ μ‚¬μš©", value=True)
128
+
129
+ with gr.Row():
130
+ width = gr.Slider(
131
+ label="λ„ˆλΉ„",
132
+ minimum=256,
133
+ maximum=MAX_IMAGE_SIZE,
134
+ step=32,
135
+ value=1024,
136
+ )
137
+
138
+ height = gr.Slider(
139
+ label="높이",
140
+ minimum=256,
141
+ maximum=MAX_IMAGE_SIZE,
142
+ step=32,
143
+ value=1024,
144
+ )
145
+
146
+ with gr.Row():
147
+ guidance_scale = gr.Slider(
148
+ label="κ°€μ΄λ˜μŠ€ μŠ€μΌ€μΌ",
149
+ minimum=1,
150
+ maximum=15,
151
+ step=0.1,
152
+ value=3.5,
153
+ )
154
+
155
+ num_inference_steps = gr.Slider(
156
+ label="μΆ”λ‘  단계 수",
157
+ minimum=1,
158
+ maximum=50,
159
+ step=1,
160
+ value=28,
161
+ )
162
 
163
+ gr.Markdown("### μ˜ˆμ‹œ ν”„λ‘¬ν”„νŠΈ")
164
  gr.Examples(
165
  examples = examples,
166
  fn = infer,
 
168
  outputs = [result, seed],
169
  cache_examples="lazy"
170
  )
171
+
172
+ gr.HTML("""
173
+ <div class="footer">
174
+ PONIX Generator by ν—ˆμ±„μ› | POSTECH
175
+ </div>
176
+ """)
177
 
178
  gr.on(
179
  triggers=[run_button.click, prompt.submit],