ginipick commited on
Commit
7c1b710
ยท
verified ยท
1 Parent(s): 909b0c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -10
app.py CHANGED
@@ -148,7 +148,6 @@ examples = [
148
  ["A calm ocean evolves into a stormy seascape as time passes", "Calm", "Stormy", 3.0]
149
  ]
150
 
151
- # CSS for a bright and modern UI with a background image
152
  css = """
153
  /* Bright and modern UI with background image */
154
  body {
@@ -194,8 +193,8 @@ footer {
194
  }
195
  """
196
 
197
- # ์—ฌ๊ธฐ์—์„œ show_api=False๋ฅผ ์ถ”๊ฐ€ํ•ด Gradio์˜ OpenAPI ์Šคํ‚ค๋งˆ ์ƒ์„ฑ์„ ๋น„ํ™œ์„ฑํ™”ํ•ฉ๋‹ˆ๋‹ค.
198
- with gr.Blocks(css=css, title="Time Stream", show_api=False) as demo:
199
  gr.Markdown("# Time Stream")
200
 
201
  x_concept_1 = gr.State("")
@@ -205,7 +204,6 @@ with gr.Blocks(css=css, title="Time Stream", show_api=False) as demo:
205
  recalc_directions = gr.State(False)
206
 
207
  with gr.Row(elem_classes="container"):
208
- # Left Column - Controls
209
  with gr.Column(scale=4):
210
  with gr.Group(elem_classes="main-panel"):
211
  gr.Markdown("### Image Generation Controls")
@@ -293,7 +291,6 @@ with gr.Blocks(css=css, title="Time Stream", show_api=False) as demo:
293
  with gr.Column(scale=8):
294
  with gr.Group(elem_classes="main-panel"):
295
  gr.Markdown("### Generated Results")
296
- # Swapped order: Image strip on top, video below (video is larger)
297
  image_strip = gr.Image(label="Image Strip", type="filepath", elem_id="strip", height=200)
298
  output_video = gr.Video(label=english_labels["Looping video"], elem_id="video", loop=True, autoplay=True, height=600)
299
  with gr.Row():
@@ -311,13 +308,11 @@ with gr.Blocks(css=css, title="Time Stream", show_api=False) as demo:
311
  label=english_labels["From 1st to 2nd direction"]
312
  )
313
 
314
- # Examples
315
  gr.Examples(
316
  examples=examples,
317
  inputs=[prompt, concept_1, concept_2, x]
318
  )
319
 
320
- # Event Handlers
321
  submit.click(
322
  fn=generate,
323
  inputs=[
@@ -327,8 +322,8 @@ with gr.Blocks(css=css, title="Time Stream", show_api=False) as demo:
327
  ],
328
  outputs=[
329
  x_concept_1, x_concept_2, avg_diff_x,
330
- output_video, # video output
331
- image_strip, # canvas (image strip)
332
  total_images,
333
  post_generation_image,
334
  post_generation_slider,
@@ -347,6 +342,6 @@ with gr.Blocks(css=css, title="Time Stream", show_api=False) as demo:
347
  concurrency_limit=None
348
  )
349
 
 
350
  if __name__ == "__main__":
351
- # Gradio API ์Šคํ‚ค๋งˆ๋ฅผ ํ‘œ์‹œํ•˜์ง€ ์•Š์œผ๋ ค๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด show_api=False ์˜ต์…˜์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
352
  demo.launch(server_name="0.0.0.0", server_port=7860, show_api=False)
 
148
  ["A calm ocean evolves into a stormy seascape as time passes", "Calm", "Stormy", 3.0]
149
  ]
150
 
 
151
  css = """
152
  /* Bright and modern UI with background image */
153
  body {
 
193
  }
194
  """
195
 
196
+ # ์—ฌ๊ธฐ์„œ๋Š” show_api=False๋ฅผ Blocks(...)์— ๋„ฃ์ง€ ์•Š์Œ
197
+ with gr.Blocks(css=css, title="Time Stream") as demo:
198
  gr.Markdown("# Time Stream")
199
 
200
  x_concept_1 = gr.State("")
 
204
  recalc_directions = gr.State(False)
205
 
206
  with gr.Row(elem_classes="container"):
 
207
  with gr.Column(scale=4):
208
  with gr.Group(elem_classes="main-panel"):
209
  gr.Markdown("### Image Generation Controls")
 
291
  with gr.Column(scale=8):
292
  with gr.Group(elem_classes="main-panel"):
293
  gr.Markdown("### Generated Results")
 
294
  image_strip = gr.Image(label="Image Strip", type="filepath", elem_id="strip", height=200)
295
  output_video = gr.Video(label=english_labels["Looping video"], elem_id="video", loop=True, autoplay=True, height=600)
296
  with gr.Row():
 
308
  label=english_labels["From 1st to 2nd direction"]
309
  )
310
 
 
311
  gr.Examples(
312
  examples=examples,
313
  inputs=[prompt, concept_1, concept_2, x]
314
  )
315
 
 
316
  submit.click(
317
  fn=generate,
318
  inputs=[
 
322
  ],
323
  outputs=[
324
  x_concept_1, x_concept_2, avg_diff_x,
325
+ output_video,
326
+ image_strip,
327
  total_images,
328
  post_generation_image,
329
  post_generation_slider,
 
342
  concurrency_limit=None
343
  )
344
 
345
+ # demo.launch(...)์—์„œ๋งŒ show_api=False ์„ค์ •
346
  if __name__ == "__main__":
 
347
  demo.launch(server_name="0.0.0.0", server_port=7860, show_api=False)