Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -14,9 +14,9 @@ ckpt = "sdxl_lightning_4step_unet.safetensors"
|
|
14 |
# Load model (Executed only once for efficiency)
|
15 |
@st.cache_resource
|
16 |
def load_sdxl_pipeline():
|
17 |
-
unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cpu", torch.
|
18 |
unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cpu"))
|
19 |
-
pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.
|
20 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|
21 |
return pipe
|
22 |
|
|
|
14 |
# Load model (Executed only once for efficiency)
|
15 |
@st.cache_resource
|
16 |
def load_sdxl_pipeline():
|
17 |
+
unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cpu", torch.float32)
|
18 |
unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cpu"))
|
19 |
+
pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float32, variant="fp32").to("cpu")
|
20 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|
21 |
return pipe
|
22 |
|