CosmoAI commited on
Commit
2d3ce56
·
verified ·
1 Parent(s): 0baa2ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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.float16)
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.float16, variant="fp16").to("cpu")
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