nightfury commited on
Commit
7761bc3
·
1 Parent(s): e13b608

Update dj_sd.py

Browse files
Files changed (1) hide show
  1. dj_sd.py +3 -2
dj_sd.py CHANGED
@@ -14,9 +14,10 @@ import requests
14
 
15
  model_id = "CompVis/stable-diffusion-v1-4"
16
  device = "cuda"
17
-
 
18
  #If you are running this code locally, you need to either do a 'huggingface-cli login` or paste your User Access Token from here https://huggingface.co/settings/tokens into the use_auth_token field below.
19
- pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=True, revision="fp16", torch_dtype=torch.float16)
20
  pipe = pipe.to(device)
21
  torch.backends.cudnn.benchmark = True
22
 
 
14
 
15
  model_id = "CompVis/stable-diffusion-v1-4"
16
  device = "cuda"
17
+ MY_SECRET_TOKEN=os.environ.get('HF_TOKEN_SD')
18
+ YOUR_TOKEN=MY_SECRET_TOKEN
19
  #If you are running this code locally, you need to either do a 'huggingface-cli login` or paste your User Access Token from here https://huggingface.co/settings/tokens into the use_auth_token field below.
20
+ pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=YOUR_TOKEN, revision="fp16", torch_dtype=torch.float16)
21
  pipe = pipe.to(device)
22
  torch.backends.cudnn.benchmark = True
23