Spaces:
Runtime error
Runtime error
Update app.py
Browse files40 unmodified lines4142434445469 unmodified lines5657585960616214 unmodified lines7778798081827 unmodified lines90919293949584 unmodified lines1801811821831841851861871881897 unmodified lines1971981992002012028 unmodified lines21121221321421521621721840 unmodified linesmode,steps,num_frames,seed,randomize_seed,improve_texture=False, progress=gr.Progress(track_tqdm=True)):9 unmodified linesdownscaled_height, downscaled_width = round_to_nearest_resolution_acceptable_by_vae(downscaled_height, downscaled_width)if mode == "text-to-video" and video is not None:frames_to_use = 21 #todo make configurablevideo = load_video(video)[:frames_to_use]condition = Trueelif mode == "image-to-video" and image is not None:14 unmodified linesnum_inference_steps=steps,decode_timestep = 0.05,decode_noise_scale = 0.025,generator=torch.Generator(device="cuda").manual_seed(seed),output_type="latent",).frames7 unmodified linesnum_inference_steps=steps,decode_timestep = 0.05,decode_noise_scale = 0.025,generator=torch.Generator(device="cuda").manual_seed(seed),output_type="latent",).frames84 unmodified lines#prompt = gr.Textbox(label="prompt")with gr.Tab("image-to-video") as image_tab:image = gr.Image(label="")#prompt = gr.Textbox(label="prompt")with gr.Tab("video-to-video") as video_tab:video = gr.Video(label="")prompt = gr.Textbox(label="prompt")run_button = gr.Button()with gr.Column():output = gr.Video(interactive=False)7 unmodified lineswith gr.Row():steps = gr.Slider(label="Steps", minimum=1, maximum=30, value=8, step=1)num_frames = gr.Slider(label="# frames", minimum=1, maximum=161, value=96, step=1)text_tab.select(fn=change_mode_to_text, inputs=[], outputs=[mode])8 unmodified linesmode,steps,num_frames,seed,randomize_seed],outputs=[output])40 unmodified lines414243444546479 unmodified lines57585960616214 unmodified lines777879808182837 unmodified lines9192939495969784 unmodified lines1821831841851861871881891901911927 unmodified lines2002012022032042052062072088 unmodified lines21721821922022122222322422540 unmodified linesmode,steps,num_frames,frames_to_use,seed,randomize_seed,improve_texture=False, progress=gr.Progress(track_tqdm=True)):9 unmodified linesdownscaled_height, downscaled_width = round_to_nearest_resolution_acceptable_by_vae(downscaled_height, downscaled_width)if mode == "text-to-video" and video is not None:video = load_video(video)[:frames_to_use]condition = Trueelif mode == "image-to-video" and image is not None:14 unmodified linesnum_inference_steps=steps,decode_timestep = 0.05,decode_noise_scale = 0.025,guidance_scale=1.0,generator=torch.Generator(device="cuda").manual_seed(seed),output_type="latent",).frames7 unmodified linesnum_inference_steps=steps,decode_timestep = 0.05,decode_noise_scale = 0.025,guidance_scale=1.0,generator=torch.Generator(device="cuda").manual_seed(seed),output_type="latent",).frames84 unmodified lines#prompt = gr.Textbox(label="prompt")with gr.Tab("image-to-video") as image_tab:image = gr.Image(label="")with gr.Tab("video-to-video") as video_tab:video = gr.Video(label="")frames_to_use = gr.Number(label="num frames to use",info="first # of frames to use from the input video", value=1)prompt = gr.Textbox(label="prompt")improve_texture = gr.Checkbox("improve texture", value=False, info="note it slows generation")run_button = gr.Button()with gr.Column():output = gr.Video(interactive=False)7 unmodified lineswith gr.Row():steps = gr.Slider(label="Steps", minimum=1, maximum=30, value=8, step=1)num_frames = gr.Slider(label="# frames", minimum=1, maximum=161, value=96, step=1)with gr.Row():height = gr.Slider(label="height", value=512, step=1)width = gr.Slider(label="width", value=704, step=1)text_tab.select(fn=change_mode_to_text, inputs=[], outputs=[mode])8 unmodified linesmode,steps,num_frames,frames_to_use,seed,randomize_seed, improve_texture],outputs=[output])
app.py+10-3