fantaxy commited on
Commit
eaddb99
ยท
verified ยท
1 Parent(s): b81b62a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -34
app.py CHANGED
@@ -155,7 +155,6 @@ def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_ava
155
  offload: bool = False):
156
 
157
  with gr.Blocks(theme="soft") as demo:
158
- # HTML ์ฝ”๋“œ๋Š” with ๋ธ”๋ก ์•ˆ์— ๋“ค์—ฌ์“ฐ๊ธฐ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค
159
  gr.HTML(
160
  """
161
  <div class='container' style='display:flex; justify-content:center; gap:12px;'>
@@ -170,18 +169,12 @@ def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_ava
170
  """
171
  )
172
 
173
- # ์—ฌ๊ธฐ์— ์ถ”๊ฐ€ Gradio ์ปดํฌ๋„ŒํŠธ๋“ค์„ ๋„ฃ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค
174
-
175
- return demo
176
-
177
-
178
  with gr.Row():
179
  with gr.Column():
180
  prompt = gr.Textbox(label="Prompt", value="portrait, color, cinematic")
181
  id_image = gr.Image(label="ID Image")
182
  id_weight = gr.Slider(0.0, 3.0, 1, step=0.05, label="id weight")
183
 
184
-
185
  width = gr.Slider(256, 1536, 896, step=16, label="Width")
186
  height = gr.Slider(256, 1536, 1152, step=16, label="Height")
187
  num_steps = gr.Slider(1, 20, 20, step=1, label="Number of steps")
@@ -204,35 +197,33 @@ def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_ava
204
  output_image = gr.Image(label="Generated Image")
205
  seed_output = gr.Textbox(label="Used Seed")
206
  intermediate_output = gr.Gallery(label='Output', elem_id="gallery", visible=args.dev)
207
- # _CITE_ ๊ด€๋ จ ๋ถ€๋ถ„ ์ œ๊ฑฐ
208
-
209
 
210
  with gr.Row(), gr.Column():
211
- gr.Markdown("## Examples")
212
- example_inps = [
213
- [
214
- 'a woman holding sign with glowing green text \"PuLID for FLUX\"',
215
- 'example_inputs/qw1.webp',
216
- 4, 4, 2680261499100305976, 1
217
- ],
218
- [
219
- 'portrait, pixar',
220
- 'example_inputs/qw2.webp',
221
- 1, 4, 9445036702517583939, 1
222
- ],
223
- ]
224
- gr.Examples(examples=example_inps, inputs=[prompt, id_image, start_step, guidance, seed, true_cfg],
225
- label='fake CFG')
226
-
227
- example_inps = [
228
- [
229
- 'portrait, made of ice sculpture',
230
- 'example_inputs/qw3.webp',
231
- 1, 1, 3811899118709451814, 5
232
- ],
233
- ]
234
- gr.Examples(examples=example_inps, inputs=[prompt, id_image, start_step, guidance, seed, true_cfg],
235
- label='true CFG')
236
 
237
  generate_btn.click(
238
  fn=generate_image,
 
155
  offload: bool = False):
156
 
157
  with gr.Blocks(theme="soft") as demo:
 
158
  gr.HTML(
159
  """
160
  <div class='container' style='display:flex; justify-content:center; gap:12px;'>
 
169
  """
170
  )
171
 
 
 
 
 
 
172
  with gr.Row():
173
  with gr.Column():
174
  prompt = gr.Textbox(label="Prompt", value="portrait, color, cinematic")
175
  id_image = gr.Image(label="ID Image")
176
  id_weight = gr.Slider(0.0, 3.0, 1, step=0.05, label="id weight")
177
 
 
178
  width = gr.Slider(256, 1536, 896, step=16, label="Width")
179
  height = gr.Slider(256, 1536, 1152, step=16, label="Height")
180
  num_steps = gr.Slider(1, 20, 20, step=1, label="Number of steps")
 
197
  output_image = gr.Image(label="Generated Image")
198
  seed_output = gr.Textbox(label="Used Seed")
199
  intermediate_output = gr.Gallery(label='Output', elem_id="gallery", visible=args.dev)
 
 
200
 
201
  with gr.Row(), gr.Column():
202
+ gr.Markdown("## Examples")
203
+ example_inps = [
204
+ [
205
+ 'a woman holding sign with glowing green text \"PuLID for FLUX\"',
206
+ 'example_inputs/qw1.webp',
207
+ 4, 4, 2680261499100305976, 1
208
+ ],
209
+ [
210
+ 'portrait, pixar',
211
+ 'example_inputs/qw2.webp',
212
+ 1, 4, 9445036702517583939, 1
213
+ ],
214
+ ]
215
+ gr.Examples(examples=example_inps, inputs=[prompt, id_image, start_step, guidance, seed, true_cfg],
216
+ label='fake CFG')
217
+
218
+ example_inps = [
219
+ [
220
+ 'portrait, made of ice sculpture',
221
+ 'example_inputs/qw3.webp',
222
+ 1, 1, 3811899118709451814, 5
223
+ ],
224
+ ]
225
+ gr.Examples(examples=example_inps, inputs=[prompt, id_image, start_step, guidance, seed, true_cfg],
226
+ label='true CFG')
227
 
228
  generate_btn.click(
229
  fn=generate_image,