Spaces:
Build error
Build error
Download app.py from Ruan-010/SpaceVideo: direct link, hf CLI and curl.
- Browser
- Download file 648 Bytes
-
https://huggingface.co/spaces/Ruan-010/SpaceVideo/resolve/main/app.py
- Command line
-
hf download hf://spaces/Ruan-010/SpaceVideo/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Ruan-010/SpaceVideo/resolve/main/app.py
648 Bytes
| import gradio as gr | |
| from diffusers import DiffusionPipeline | |
| # Carregando o pipeline | |
| pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-video-diffusion-img2vid-xt") | |
| # Função para gerar a imagem | |
| def generate_image(prompt): | |
| result = pipe(prompt).images[0] | |
| return result | |
| # Interface Gradio | |
| interface = gr.Interface( | |
| fn=generate_image, | |
| inputs=gr.Textbox(label="Digite um prompt:"), | |
| outputs=gr.Image(label="Resultado"), | |
| title="Stable Video Diffusion Img2Vid", | |
| description="Digite um prompt para gerar imagens usando o modelo stabilityai/stable-video-diffusion-img2vid-xt." | |
| ) | |
| # Lançar o app | |
| interface.launch() | |