Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -73,7 +73,7 @@ def generate(slider_x, prompt, seed, recalc_directions, iterations, steps, guida
|
|
73 |
|
74 |
avg_diff_x = avg_diff.cpu()
|
75 |
|
76 |
-
return gr.update(label=comma_concepts_x, interactive=True, value=0), x_concept_1, x_concept_2, avg_diff_x
|
77 |
|
78 |
@spaces.GPU
|
79 |
def update_scales(x,prompt,seed, steps, guidance_scale,
|
@@ -183,7 +183,7 @@ with gr.Blocks(css=css) as demo:
|
|
183 |
submit = gr.Button("find directions")
|
184 |
with gr.Column():
|
185 |
with gr.Group(elem_id="group"):
|
186 |
-
x = gr.Slider(minimum=0, value=
|
187 |
#y = gr.Slider(minimum=-10, value=0, maximum=10, elem_id="y", interactive=False)
|
188 |
output_image = gr.Image(elem_id="image_out")
|
189 |
image_seq = gr.Image()
|
@@ -259,7 +259,7 @@ with gr.Blocks(css=css) as demo:
|
|
259 |
# outputs=[x, y, x_concept_1, x_concept_2, y_concept_1, y_concept_2, avg_diff_x, avg_diff_y, output_image])
|
260 |
submit.click(fn=generate,
|
261 |
inputs=[slider_x, prompt, seed, recalc_directions, iterations, steps, guidance_scale, x_concept_1, x_concept_2, avg_diff_x],
|
262 |
-
outputs=[x, x_concept_1, x_concept_2, avg_diff_x, output_image])
|
263 |
|
264 |
iterations.change(fn=reset_recalc_directions, outputs=[recalc_directions])
|
265 |
seed.change(fn=reset_recalc_directions, outputs=[recalc_directions])
|
|
|
73 |
|
74 |
avg_diff_x = avg_diff.cpu()
|
75 |
|
76 |
+
return gr.update(label=comma_concepts_x, interactive=True, value=0), x_concept_1, x_concept_2, avg_diff_x
|
77 |
|
78 |
@spaces.GPU
|
79 |
def update_scales(x,prompt,seed, steps, guidance_scale,
|
|
|
183 |
submit = gr.Button("find directions")
|
184 |
with gr.Column():
|
185 |
with gr.Group(elem_id="group"):
|
186 |
+
x = gr.Slider(minimum=0, value=1.25, step=0.1, maximum=2.5, elem_id="x", interactive=False)
|
187 |
#y = gr.Slider(minimum=-10, value=0, maximum=10, elem_id="y", interactive=False)
|
188 |
output_image = gr.Image(elem_id="image_out")
|
189 |
image_seq = gr.Image()
|
|
|
259 |
# outputs=[x, y, x_concept_1, x_concept_2, y_concept_1, y_concept_2, avg_diff_x, avg_diff_y, output_image])
|
260 |
submit.click(fn=generate,
|
261 |
inputs=[slider_x, prompt, seed, recalc_directions, iterations, steps, guidance_scale, x_concept_1, x_concept_2, avg_diff_x],
|
262 |
+
outputs=[x, x_concept_1, x_concept_2, avg_diff_x, output_image]).then(fn=update_scales, inputs=[x, prompt, seed, steps, guidance_scale, avg_diff_x], outputs=[output_image, image_seq])
|
263 |
|
264 |
iterations.change(fn=reset_recalc_directions, outputs=[recalc_directions])
|
265 |
seed.change(fn=reset_recalc_directions, outputs=[recalc_directions])
|