Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,9 @@ import torch
|
|
| 3 |
from diffusers import I2VGenXLPipeline
|
| 4 |
from diffusers.utils import export_to_gif, load_image
|
| 5 |
import tempfile
|
|
|
|
| 6 |
|
|
|
|
| 7 |
def initialize_pipeline(device):
|
| 8 |
# Initialize the pipeline with CUDA support
|
| 9 |
pipeline = I2VGenXLPipeline.from_pretrained("ali-vilab/i2vgen-xl", torch_dtype=torch.float16, variant="fp16")
|
|
@@ -65,7 +67,7 @@ with gr.Blocks() as demo:
|
|
| 65 |
|
| 66 |
text_generate_button.click(
|
| 67 |
fn=generate_gif,
|
| 68 |
-
inputs=[text_prompt,
|
| 69 |
outputs=text_output_video
|
| 70 |
)
|
| 71 |
|
|
|
|
| 3 |
from diffusers import I2VGenXLPipeline
|
| 4 |
from diffusers.utils import export_to_gif, load_image
|
| 5 |
import tempfile
|
| 6 |
+
import spaces
|
| 7 |
|
| 8 |
+
@spaces.GPU
|
| 9 |
def initialize_pipeline(device):
|
| 10 |
# Initialize the pipeline with CUDA support
|
| 11 |
pipeline = I2VGenXLPipeline.from_pretrained("ali-vilab/i2vgen-xl", torch_dtype=torch.float16, variant="fp16")
|
|
|
|
| 67 |
|
| 68 |
text_generate_button.click(
|
| 69 |
fn=generate_gif,
|
| 70 |
+
inputs=[text_prompt, None, text_negative_prompt, text_num_inference_steps, text_guidance_scale, text_seed],
|
| 71 |
outputs=text_output_video
|
| 72 |
)
|
| 73 |
|