ziwaixian009 commited on
Commit
71d9354
·
verified ·
1 Parent(s): b3b4280

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -22
app.py CHANGED
@@ -1,22 +1,10 @@
1
- import torch
2
- from diffusers import DiffusionPipeline
3
- from diffusers.utils import load_image, export_to_video
4
-
5
- # pipe = DiffusionPipeline.from_pretrained("Wan-AI/Wan2.2-I2V-A14B", torch_dtype=torch.float16)
6
- # pipe.to("cuda")
7
- # pipe = DiffusionPipeline.from_pretrained("Wan-AI/Wan2.2-I2V-A14B")
8
- # pipe.to("cpu")
9
-
10
- pipe = DiffusionPipeline.from_pretrained("Linaqruf/animov-512x", torch_dtype=torch.float32)
11
- pipe.to("cpu")
12
-
13
-
14
- prompt = "A man with short gray hair plays a red electric guitar."
15
- image = load_image(
16
- "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png"
17
- )
18
-
19
-
20
-
21
- output = pipe(image=image, prompt=prompt).frames[0]
22
- export_to_video(output, "output.mp4")
 
1
+ import gradio as gr
2
+
3
+ with gr.Blocks(fill_height=True) as demo:
4
+ with gr.Sidebar():
5
+ gr.Markdown("# Inference Provider")
6
+ gr.Markdown("This Space showcases the Wan-AI/Wan2.2-I2V-A14B model, served by the fal-ai API. Sign in with your Hugging Face account to use this API.")
7
+ button = gr.LoginButton("Sign in")
8
+ gr.load("models/Wan-AI/Wan2.2-I2V-A14B", accept_token=button, provider="fal-ai")
9
+
10
+ demo.launch()