Spaces:
Paused
Paused
Update app.py
Browse files12347 unmodified lines121314151617185 unmodified lines2425262728293031323334353637383940414243444546import gradio as grimport torchfrom diffusers import DiffusionPipeline, DPMSolverMultistepSchedulerfrom diffusers.utils import export_to_video7 unmodified linesvideo_frames = pipe(prompt, num_inference_steps=40, height=320, width=576, num_frames=24).framesvideo_path = export_to_video(video_frames)print(video_path)return video_pathcss = """#col-container {max-width: 510px; margin-left: auto; margin-right: auto;}5 unmodified linesgr.Markdown("""<h1 style="text-align: center;">Zeroscope Text-to-Video</h1>A watermark-free Modelscope-based video model optimized for producing high-quality 16:9 compositions and a smooth video output. <br />This zeroscope_v2_576w model was trained using 9,923 clips and 29,769 tagged frames at 24 frames, 576x320 resolution.<br />[](https://huggingface.co/spaces/fffiloni/zeroscope?duplicate=true)""")prompt_in = gr.Textbox(label="Prompt", placeholder="Darth Vader is surfing on waves")#inference_steps = gr.Slider(label="Inference Steps", minimum=10, maximum=100, step=1, value=40, interactive=False)submit_btn = gr.Button("Submit")video_result = gr.Video(label="Video Output")submit_btn.click(fn=infer,inputs=[prompt_in],outputs=[video_result])demo.queue(max_size=12).launch()123457 unmodified lines131415161718195 unmodified lines252627282930313233343536373839404142434445464748495051import gradio as grfrom share_btn import community_icon_html, loading_icon_html, share_jsimport torchfrom diffusers import DiffusionPipeline, DPMSolverMultistepSchedulerfrom diffusers.utils import export_to_video7 unmodified linesvideo_frames = pipe(prompt, num_inference_steps=40, height=320, width=576, num_frames=24).framesvideo_path = export_to_video(video_frames)print(video_path)return video_path, gr.Group.update(visible=True)css = """#col-container {max-width: 510px; margin-left: auto; margin-right: auto;}5 unmodified linesgr.Markdown("""<h1 style="text-align: center;">Zeroscope Text-to-Video</h1><p style="text-align: center;">A watermark-free Modelscope-based video model optimized for producing high-quality 16:9 compositions and a smooth video output. <br />[](https://huggingface.co/spaces/fffiloni/zeroscope?duplicate=true)</p>""")prompt_in = gr.Textbox(label="Prompt", placeholder="Darth Vader is surfing on waves", elem_id="prompt-in")#inference_steps = gr.Slider(label="Inference Steps", minimum=10, maximum=100, step=1, value=40, interactive=False)submit_btn = gr.Button("Submit")video_result = gr.Video(label="Video Output", elem_id="video-output")with gr.Group(elem_id="share-btn-container", visible=False) as share_group:community_icon = gr.HTML(community_icon_html)loading_icon = gr.HTML(loading_icon_html)share_button = gr.Button("Share to community", elem_id="share-btn")submit_btn.click(fn=infer,inputs=[prompt_in],outputs=[video_result, share_group])demo.queue(max_size=12).launch()
app.py+12-7