radames commited on
Commit
2eb807c
1 Parent(s): ea1e8bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -35,10 +35,16 @@ if mps_available:
35
  torch_dtype = torch.float32
36
 
37
  if SAFETY_CHECKER == "True":
38
- pipe = DiffusionPipeline.from_pretrained("stabilityai/sdxl-turbo", revision="pr/4")
 
 
 
39
  else:
40
  pipe = DiffusionPipeline.from_pretrained(
41
- "stabilityai/sdxl-turbo", revision="pr/4", safety_checker=None
 
 
 
42
  )
43
 
44
 
@@ -116,7 +122,7 @@ with gr.Blocks(css=css) as demo:
116
  from diffusers import DiffusionPipeline
117
 
118
  pipe = DiffusionPipeline.from_pretrained(
119
- "stabilityai/sdxl-turbo", revision="refs/pr/4"
120
  ).to("cuda")
121
  results = pipe(
122
  prompt="A cinematic shot of a baby racoon wearing an intricate italian priest robe",
 
35
  torch_dtype = torch.float32
36
 
37
  if SAFETY_CHECKER == "True":
38
+ pipe = DiffusionPipeline.from_pretrained(
39
+ "stabilityai/sdxl-turbo",
40
+ torch_dtype=torch_dtype,
41
+ variant="fp16" if torch_dtype == torch.float16 else "fp32")
42
  else:
43
  pipe = DiffusionPipeline.from_pretrained(
44
+ "stabilityai/sdxl-turbo",
45
+ safety_checker=None,
46
+ torch_dtype=torch_dtype,
47
+ variant="fp16" if torch_dtype == torch.float16 else "fp32",
48
  )
49
 
50
 
 
122
  from diffusers import DiffusionPipeline
123
 
124
  pipe = DiffusionPipeline.from_pretrained(
125
+ "stabilityai/sdxl-turbo", variant="fp16", torch_dtype=torch.float16
126
  ).to("cuda")
127
  results = pipe(
128
  prompt="A cinematic shot of a baby racoon wearing an intricate italian priest robe",