linoyts HF staff commited on
Commit
35f48e2
1 Parent(s): b154c9f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -27,10 +27,12 @@ def generate(slider_x, slider_y, prompt, x_concept_1, x_concept_2, y_concept_1,
27
 
28
  return gr.update(label=comma_concepts_x, interactive=True),gr.update(label=comma_concepts_y, interactive=True), x_concept_1, x_concept_2, y_concept_1, y_concept_2, avg_diff_x, avg_diff_y, image
29
 
 
30
  def update_x(x,y,prompt, avg_diff_x, avg_diff_y):
31
  image = clip_slider.generate(prompt, scale=x, scale_2nd=y, num_inference_steps=8, avg_diff=avg_diff_x, avg_diff_2nd=avg_diff_y)
32
  return image
33
 
 
34
  def update_y(x,y,prompt, avg_diff_x, avg_diff_y):
35
  image = clip_slider.generate(prompt, scale=x, scale_2nd=y, num_inference_steps=8, avg_diff=avg_diff_x, avg_diff_2nd=avg_diff_y)
36
  return image
@@ -66,8 +68,8 @@ with gr.Blocks(css=css) as demo:
66
  y_concept_1 = gr.State("")
67
  y_concept_2 = gr.State("")
68
 
69
- avg_diff_x = gr.State()
70
- avg_diff_y = gr.State()
71
 
72
  with gr.Row():
73
  with gr.Column():
 
27
 
28
  return gr.update(label=comma_concepts_x, interactive=True),gr.update(label=comma_concepts_y, interactive=True), x_concept_1, x_concept_2, y_concept_1, y_concept_2, avg_diff_x, avg_diff_y, image
29
 
30
+ @spaces.GPU
31
  def update_x(x,y,prompt, avg_diff_x, avg_diff_y):
32
  image = clip_slider.generate(prompt, scale=x, scale_2nd=y, num_inference_steps=8, avg_diff=avg_diff_x, avg_diff_2nd=avg_diff_y)
33
  return image
34
 
35
+ @spaces.GPU
36
  def update_y(x,y,prompt, avg_diff_x, avg_diff_y):
37
  image = clip_slider.generate(prompt, scale=x, scale_2nd=y, num_inference_steps=8, avg_diff=avg_diff_x, avg_diff_2nd=avg_diff_y)
38
  return image
 
68
  y_concept_1 = gr.State("")
69
  y_concept_2 = gr.State("")
70
 
71
+ avg_diff_x = gr.State(None)
72
+ avg_diff_y = gr.State(None)
73
 
74
  with gr.Row():
75
  with gr.Column():