multimodalart HF Staff commited on
Commit
09862e9
·
verified ·
1 Parent(s): b766640

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -49,12 +49,12 @@ def infer(prompt, seed, randomize_seed, num_inference_steps, progress=gr.Progres
49
  num_inference_steps=num_inference_steps,
50
  num_images_per_prompt=1,
51
  generator=torch.Generator(device).manual_seed(seed),
52
- height=height,
53
- width=width
54
  ).images[0]
55
  gif_name = f"{uuid.uuid4().hex}-flux.gif"
56
  export_to_gif(split_image(image, 4), gif_name, fps=4)
57
- return gif_name, seed
58
 
59
  examples = [
60
  "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
@@ -73,8 +73,8 @@ with gr.Blocks(css=css) as demo:
73
 
74
  with gr.Column(elem_id="col-container"):
75
  gr.Markdown(f"""
76
- # FLUX.1 Schnell Animations
77
- Generate gifs with
78
  """)
79
 
80
  with gr.Row():
@@ -90,7 +90,7 @@ with gr.Blocks(css=css) as demo:
90
  run_button = gr.Button("Run", scale=0)
91
 
92
  result = gr.Image(label="Result", show_label=False)
93
-
94
  with gr.Accordion("Advanced Settings", open=False):
95
 
96
  seed = gr.Slider(
@@ -120,7 +120,7 @@ with gr.Blocks(css=css) as demo:
120
  triggers=[run_button.click, prompt.submit],
121
  fn = infer,
122
  inputs = [prompt, seed, randomize_seed, num_inference_steps],
123
- outputs = [result, seed]
124
  )
125
 
126
  demo.queue().launch()
 
49
  num_inference_steps=num_inference_steps,
50
  num_images_per_prompt=1,
51
  generator=torch.Generator(device).manual_seed(seed),
52
+ height=256,
53
+ width=1024
54
  ).images[0]
55
  gif_name = f"{uuid.uuid4().hex}-flux.gif"
56
  export_to_gif(split_image(image, 4), gif_name, fps=4)
57
+ return gif_name, image, seed
58
 
59
  examples = [
60
  "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
 
73
 
74
  with gr.Column(elem_id="col-container"):
75
  gr.Markdown(f"""
76
+ # FLUX Animations
77
+ Generate gifs with FLUX Schnell
78
  """)
79
 
80
  with gr.Row():
 
90
  run_button = gr.Button("Run", scale=0)
91
 
92
  result = gr.Image(label="Result", show_label=False)
93
+ result_full = gr.Image(label="Gif Strip")
94
  with gr.Accordion("Advanced Settings", open=False):
95
 
96
  seed = gr.Slider(
 
120
  triggers=[run_button.click, prompt.submit],
121
  fn = infer,
122
  inputs = [prompt, seed, randomize_seed, num_inference_steps],
123
+ outputs = [result, result_full, seed]
124
  )
125
 
126
  demo.queue().launch()