panelforge commited on
Commit
c33f21f
1 Parent(s): 56af9e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import gradio as gr
2
  import numpy as np
3
  import random
@@ -5,6 +6,8 @@ import spaces #[uncomment to use ZeroGPU]
5
  from diffusers import DiffusionPipeline
6
  import torch
7
 
 
 
8
  device = "cuda" if torch.cuda.is_available() else "cpu"
9
  model_repo_id = "John6666/wai-ani-nsfw-ponyxl-v5-sdxl" #Replace to the model you would like to use
10
 
@@ -13,7 +16,7 @@ if torch.cuda.is_available():
13
  else:
14
  torch_dtype = torch.float32
15
 
16
- pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
17
  pipe = pipe.to(device)
18
 
19
  MAX_SEED = np.iinfo(np.int32).max
 
1
+ import os
2
  import gradio as gr
3
  import numpy as np
4
  import random
 
6
  from diffusers import DiffusionPipeline
7
  import torch
8
 
9
+ token = os.getenv('HUGGINGFACE_TOKEN')
10
+
11
  device = "cuda" if torch.cuda.is_available() else "cpu"
12
  model_repo_id = "John6666/wai-ani-nsfw-ponyxl-v5-sdxl" #Replace to the model you would like to use
13
 
 
16
  else:
17
  torch_dtype = torch.float32
18
 
19
+ pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype, use_auth_token=token)
20
  pipe = pipe.to(device)
21
 
22
  MAX_SEED = np.iinfo(np.int32).max