Spaces:
Running
on
Zero
Running
on
Zero
Fixed error
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ def inference(
|
|
42 |
device = torch.device("cuda")
|
43 |
model_path = "stabilityai/stable-diffusion-xl-base-1.0"
|
44 |
scheduler = DDIMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear", clip_sample=False, set_alpha_to_one=False)
|
45 |
-
model = StableDiffusionXLPipeline.from_pretrained(model_path, scheduler=scheduler,
|
46 |
model.unet.set_default_attn_processor()
|
47 |
model.enable_sequential_cpu_offload()
|
48 |
|
|
|
42 |
device = torch.device("cuda")
|
43 |
model_path = "stabilityai/stable-diffusion-xl-base-1.0"
|
44 |
scheduler = DDIMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear", clip_sample=False, set_alpha_to_one=False)
|
45 |
+
model = StableDiffusionXLPipeline.from_pretrained(model_path, scheduler=scheduler, torch_dtype=torch.float16).to(device)
|
46 |
model.unet.set_default_attn_processor()
|
47 |
model.enable_sequential_cpu_offload()
|
48 |
|