aiqcamp commited on
Commit
c6f549c
Β·
verified Β·
1 Parent(s): 5cca9bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -14
app.py CHANGED
@@ -207,12 +207,8 @@ footer {
207
  }
208
  """
209
 
210
-
211
-
212
  with gr.Blocks(css=css) as demo:
213
  with gr.Column():
214
-
215
-
216
  with gr.Row():
217
  with gr.Column():
218
  input_image = gr.Image(
@@ -248,14 +244,14 @@ with gr.Blocks(css=css) as demo:
248
  minimum=256,
249
  maximum=1536,
250
  step=8,
251
- value=720, # Set a default value
252
  )
253
  height_slider = gr.Slider(
254
  label="Height",
255
  minimum=256,
256
  maximum=1536,
257
  step=8,
258
- value=480, # Set a default value
259
  )
260
  with gr.Row():
261
  num_inference_steps = gr.Slider(label="Steps", minimum=4, maximum=12, step=1, value=8)
@@ -275,15 +271,12 @@ with gr.Blocks(css=css) as demo:
275
 
276
  custom_resize_size = gr.Slider(
277
  label="Custom resize size",
278
- minimum=256, # μ΄μ „μ—λŠ” 720μ΄μ—ˆμŠ΅λ‹ˆλ‹€.
279
  maximum=1024,
280
  step=8,
281
- value=512, # 초기 κ°’μ΄λ―€λ‘œ 이 값도 적절히 μ‘°μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
282
- visible=False # 기본적으둜 이 μŠ¬λΌμ΄λ”λŠ” 숨겨져 있으며, 'Custom'이 선택될 λ•Œλ§Œ λ³΄μž…λ‹ˆλ‹€.
283
  )
284
-
285
-
286
-
287
  gr.Examples(
288
  examples=[
289
  ["./examples/example_2.jpg", 1440, 810, "Middle"],
@@ -347,6 +340,7 @@ with gr.Blocks(css=css) as demo:
347
  inputs=[input_image, width_slider, height_slider, overlap_width, num_inference_steps,
348
  resize_option, custom_resize_size, prompt_input, alignment_dropdown],
349
  outputs=result,
 
350
  ).then(
351
  fn=lambda: gr.update(visible=True),
352
  inputs=None,
@@ -362,11 +356,11 @@ with gr.Blocks(css=css) as demo:
362
  inputs=[input_image, width_slider, height_slider, overlap_width, num_inference_steps,
363
  resize_option, custom_resize_size, prompt_input, alignment_dropdown],
364
  outputs=result,
 
365
  ).then(
366
  fn=lambda: gr.update(visible=True),
367
  inputs=None,
368
  outputs=use_as_input_button,
369
  )
370
 
371
-
372
- demo.queue(max_size=12).launch(share=False)
 
207
  }
208
  """
209
 
 
 
210
  with gr.Blocks(css=css) as demo:
211
  with gr.Column():
 
 
212
  with gr.Row():
213
  with gr.Column():
214
  input_image = gr.Image(
 
244
  minimum=256,
245
  maximum=1536,
246
  step=8,
247
+ value=720,
248
  )
249
  height_slider = gr.Slider(
250
  label="Height",
251
  minimum=256,
252
  maximum=1536,
253
  step=8,
254
+ value=480,
255
  )
256
  with gr.Row():
257
  num_inference_steps = gr.Slider(label="Steps", minimum=4, maximum=12, step=1, value=8)
 
271
 
272
  custom_resize_size = gr.Slider(
273
  label="Custom resize size",
274
+ minimum=256,
275
  maximum=1024,
276
  step=8,
277
+ value=512,
278
+ visible=False
279
  )
 
 
 
280
  gr.Examples(
281
  examples=[
282
  ["./examples/example_2.jpg", 1440, 810, "Middle"],
 
340
  inputs=[input_image, width_slider, height_slider, overlap_width, num_inference_steps,
341
  resize_option, custom_resize_size, prompt_input, alignment_dropdown],
342
  outputs=result,
343
+ stream=True # μΆ”κ°€: infer ν•¨μˆ˜κ°€ μ œλ„ˆλ ˆμ΄ν„°μ΄λ―€λ‘œ 슀트리밍 ν™œμ„±ν™”
344
  ).then(
345
  fn=lambda: gr.update(visible=True),
346
  inputs=None,
 
356
  inputs=[input_image, width_slider, height_slider, overlap_width, num_inference_steps,
357
  resize_option, custom_resize_size, prompt_input, alignment_dropdown],
358
  outputs=result,
359
+ stream=True # μΆ”κ°€: μ œλ„ˆλ ˆμ΄ν„° ν•¨μˆ˜μ΄λ―€λ‘œ 슀트리밍 ν™œμ„±ν™”
360
  ).then(
361
  fn=lambda: gr.update(visible=True),
362
  inputs=None,
363
  outputs=use_as_input_button,
364
  )
365
 
366
+ demo.queue(max_size=12).launch(share=False)