Spaces:
Running
on
Zero
Running
on
Zero
fix bugs
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ class AnimateController:
|
|
60 |
pil_image = pil_image.crop((int((width - height * 16 / 10) / 2), 0, int((width + height * 16 / 10) / 2), height))
|
61 |
elif aspect_ratio < 16 / 10:
|
62 |
pil_image = pil_image.crop((0, int((height - width * 10 / 16) / 2), width, int((height + width * 10 / 16) / 2)))
|
63 |
-
return gr.Textbox.
|
64 |
|
65 |
@spaces.GPU
|
66 |
def animate(
|
@@ -180,7 +180,7 @@ class AnimateController:
|
|
180 |
f.write(json_str)
|
181 |
f.write("\n\n")
|
182 |
|
183 |
-
return gr.Video.
|
184 |
|
185 |
|
186 |
controller = AnimateController()
|
@@ -230,7 +230,7 @@ def ui():
|
|
230 |
|
231 |
seed_textbox = gr.Textbox(label="Seed", value=-1)
|
232 |
seed_button = gr.Button(value="\U0001F3B2", elem_classes="toolbutton")
|
233 |
-
seed_button.click(fn=lambda: gr.Textbox.
|
234 |
|
235 |
|
236 |
|
@@ -273,7 +273,7 @@ def ui():
|
|
273 |
pil_image = pil_image.crop((left, top, right, bottom))
|
274 |
|
275 |
pil_image = pil_image.resize((width_slider, height_slider))
|
276 |
-
return gr.Image.
|
277 |
|
278 |
preview_button.click(fn=update_and_resize_image, inputs=[input_image_path, height_slider, width_slider, center_crop], outputs=[input_image])
|
279 |
input_image_path.submit(fn=update_and_resize_image, inputs=[input_image_path, height_slider, width_slider, center_crop], outputs=[input_image])
|
|
|
60 |
pil_image = pil_image.crop((int((width - height * 16 / 10) / 2), 0, int((width + height * 16 / 10) / 2), height))
|
61 |
elif aspect_ratio < 16 / 10:
|
62 |
pil_image = pil_image.crop((0, int((height - width * 10 / 16) / 2), width, int((height + width * 10 / 16) / 2)))
|
63 |
+
return gr.Textbox.change(value=img_path), gr.Image.change(value=np.array(pil_image))
|
64 |
|
65 |
@spaces.GPU
|
66 |
def animate(
|
|
|
180 |
f.write(json_str)
|
181 |
f.write("\n\n")
|
182 |
|
183 |
+
return gr.Video.change(value=save_sample_path)
|
184 |
|
185 |
|
186 |
controller = AnimateController()
|
|
|
230 |
|
231 |
seed_textbox = gr.Textbox(label="Seed", value=-1)
|
232 |
seed_button = gr.Button(value="\U0001F3B2", elem_classes="toolbutton")
|
233 |
+
seed_button.click(fn=lambda: gr.Textbox.change(value=random.randint(1, 1e8)), inputs=[], outputs=[seed_textbox])
|
234 |
|
235 |
|
236 |
|
|
|
273 |
pil_image = pil_image.crop((left, top, right, bottom))
|
274 |
|
275 |
pil_image = pil_image.resize((width_slider, height_slider))
|
276 |
+
return gr.Image.change(value=np.array(pil_image))
|
277 |
|
278 |
preview_button.click(fn=update_and_resize_image, inputs=[input_image_path, height_slider, width_slider, center_crop], outputs=[input_image])
|
279 |
input_image_path.submit(fn=update_and_resize_image, inputs=[input_image_path, height_slider, width_slider, center_crop], outputs=[input_image])
|