multimodalart HF staff commited on
Commit
af37c96
β€’
1 Parent(s): 6d53867

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -92,7 +92,7 @@ def generate(concept_1, concept_2, scale, prompt, seed=42, recalc_directions=Tru
92
  post_generation_slider_update = gr.update(label=comma_concepts_x, value=0, minimum=scale_min, maximum=scale_max, interactive=True)
93
  avg_diff_x = avg_diff.cpu()
94
 
95
- return gr.update(label=comma_concepts_x, interactive=True, value=scale), x_concept_1, x_concept_2, avg_diff_x, export_to_gif(images, "clip.gif", fps=5), canvas, images, images[scale_middle], post_generation_slider_update
96
 
97
  @spaces.GPU
98
  def update_scales(x,prompt,seed, steps, interm_steps, guidance_scale,
@@ -223,7 +223,7 @@ with gr.Blocks(css=css) as demo:
223
  #slider_x = gr.Dropdown(label="Slider concept range", allow_custom_value=True, multiselect=True, max_choices=2)
224
  #slider_y = gr.Dropdown(label="Slider Y concept range", allow_custom_value=True, multiselect=True, max_choices=2)
225
  prompt = gr.Textbox(label="Prompt", placeholder="A dog in the park")
226
- x = gr.Slider(minimum=0, value=1.5, step=0.1, maximum=4.0, label="Strength", info="maximum strength on each direction")
227
  submit = gr.Button("Generate directions")
228
  gr.Examples(
229
  examples=examples,
@@ -310,7 +310,7 @@ with gr.Blocks(css=css) as demo:
310
  # outputs=[x, y, x_concept_1, x_concept_2, y_concept_1, y_concept_2, avg_diff_x, avg_diff_y, output_image])
311
  submit.click(fn=generate,
312
  inputs=[concept_1, concept_2, x, prompt, seed, recalc_directions, iterations, steps, interm_steps, guidance_scale, x_concept_1, x_concept_2, avg_diff_x, total_images],
313
- outputs=[x, x_concept_1, x_concept_2, avg_diff_x, output_image, image_seq, total_images, post_generation_image, post_generation_slider])
314
 
315
  iterations.change(fn=reset_recalc_directions, outputs=[recalc_directions])
316
  seed.change(fn=reset_recalc_directions, outputs=[recalc_directions])
 
92
  post_generation_slider_update = gr.update(label=comma_concepts_x, value=0, minimum=scale_min, maximum=scale_max, interactive=True)
93
  avg_diff_x = avg_diff.cpu()
94
 
95
+ return x_concept_1, x_concept_2, avg_diff_x, export_to_gif(images, "clip.gif", fps=5), canvas, images, images[scale_middle], post_generation_slider_update
96
 
97
  @spaces.GPU
98
  def update_scales(x,prompt,seed, steps, interm_steps, guidance_scale,
 
223
  #slider_x = gr.Dropdown(label="Slider concept range", allow_custom_value=True, multiselect=True, max_choices=2)
224
  #slider_y = gr.Dropdown(label="Slider Y concept range", allow_custom_value=True, multiselect=True, max_choices=2)
225
  prompt = gr.Textbox(label="Prompt", placeholder="A dog in the park")
226
+ x = gr.Slider(minimum=0, value=1.5, step=0.1, maximum=4.0, label="Strength", info="maximum strength on each direction (unstable beyond 2.5)")
227
  submit = gr.Button("Generate directions")
228
  gr.Examples(
229
  examples=examples,
 
310
  # outputs=[x, y, x_concept_1, x_concept_2, y_concept_1, y_concept_2, avg_diff_x, avg_diff_y, output_image])
311
  submit.click(fn=generate,
312
  inputs=[concept_1, concept_2, x, prompt, seed, recalc_directions, iterations, steps, interm_steps, guidance_scale, x_concept_1, x_concept_2, avg_diff_x, total_images],
313
+ outputs=[x_concept_1, x_concept_2, avg_diff_x, output_image, image_seq, total_images, post_generation_image, post_generation_slider])
314
 
315
  iterations.change(fn=reset_recalc_directions, outputs=[recalc_directions])
316
  seed.change(fn=reset_recalc_directions, outputs=[recalc_directions])