andrewchwalik commited on
Commit
32ab995
·
verified ·
1 Parent(s): 4a6e26e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
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
- # Load the Stable Diffusion 3.5 Medium model
7
- model = StableDiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-3.5-medium")
 
 
 
 
 
 
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):