Fabrice-TIERCELIN commited on
Commit
ae9aaa7
·
verified ·
1 Parent(s): f4b4b46

Parameter for CUDA

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -11,7 +11,8 @@ import torch
11
  max_64_bit_int = 2**63 - 1
12
 
13
  device = "cuda" if torch.cuda.is_available() else "cpu"
14
- pipe = StableDiffusionXLInpaintPipeline.from_pretrained("diffusers/stable-diffusion-xl-1.0-inpainting-0.1")
 
15
  pipe = pipe.to(device)
16
 
17
  def noise_color(color, noise):
 
11
  max_64_bit_int = 2**63 - 1
12
 
13
  device = "cuda" if torch.cuda.is_available() else "cpu"
14
+ floatType = torch.float16 if torch.cuda.is_available() else torch.float32
15
+ pipe = StableDiffusionXLInpaintPipeline.from_pretrained("diffusers/stable-diffusion-xl-1.0-inpainting-0.1", torch_dtype = floatType)
16
  pipe = pipe.to(device)
17
 
18
  def noise_color(color, noise):