andresgtn commited on
Commit
4e9944c
·
1 Parent(s): ade9768

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -6,7 +6,10 @@ from PIL import Image, PngImagePlugin
6
  from io import BytesIO
7
  import torch
8
 
9
- pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
 
 
 
10
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
11
  pipe.to(device)
12
 
 
6
  from io import BytesIO
7
  import torch
8
 
9
+ # required for stable difussion
10
+ auth_token = os.environ.get("auth_token") #in secret space
11
+
12
+ pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", use_auth_token=auth_token)
13
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
14
  pipe.to(device)
15