Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,16 @@
|
|
|
|
1 |
from diffusers import StableDiffusionPipeline
|
2 |
import ffmpeg
|
3 |
-
import os
|
4 |
import gradio as gr
|
5 |
|
6 |
-
#
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
model.to("cuda") # Use GPU for faster processing (if available)
|
9 |
|
10 |
def generate_video(prompt):
|
|
|
1 |
+
import os
|
2 |
from diffusers import StableDiffusionPipeline
|
3 |
import ffmpeg
|
|
|
4 |
import gradio as gr
|
5 |
|
6 |
+
# Retrieve the token from Hugging Face secrets
|
7 |
+
token = os.getenv("HUGGINGFACE_TOKEN")
|
8 |
+
|
9 |
+
# Authenticate with the Hugging Face token
|
10 |
+
model = StableDiffusionPipeline.from_pretrained(
|
11 |
+
"stabilityai/stable-diffusion-3.5-medium",
|
12 |
+
use_auth_token=token
|
13 |
+
)
|
14 |
model.to("cuda") # Use GPU for faster processing (if available)
|
15 |
|
16 |
def generate_video(prompt):
|