mfranzon commited on
Commit
e5fc540
1 Parent(s): d6f7285
Files changed (1) hide show
  1. utils.py +3 -3
utils.py CHANGED
@@ -2,7 +2,7 @@ import torch
2
  from diffusers import StableDiffusionImg2ImgPipeline
3
 
4
  import os
5
- TOKEN=os.environ.get('sd')
6
 
7
  torch.cuda.empty_cache()
8
  device = "cpu"
@@ -13,8 +13,8 @@ def pipe_image(prompt,
13
  pipe = StableDiffusionImg2ImgPipeline.from_pretrained("CompVis/stable-diffusion-v1-4",
14
  revision="fp16",
15
  torch_dtype=torch.float32,
16
- use_auth_token=TOKEN)
17
-
18
  pipe = pipe.to(device)
19
  pipe.enable_attention_slicing()
20
  images = pipe(prompt=prompt,
 
2
  from diffusers import StableDiffusionImg2ImgPipeline
3
 
4
  import os
5
+ TOKEN = os.environ.get('sd') or True
6
 
7
  torch.cuda.empty_cache()
8
  device = "cpu"
 
13
  pipe = StableDiffusionImg2ImgPipeline.from_pretrained("CompVis/stable-diffusion-v1-4",
14
  revision="fp16",
15
  torch_dtype=torch.float32,
16
+ use_auth_token=TOKEN
17
+ )
18
  pipe = pipe.to(device)
19
  pipe.enable_attention_slicing()
20
  images = pipe(prompt=prompt,