multimodalart HF staff commited on
Commit
e10dc6d
·
verified ·
1 Parent(s): 577e167

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -17,7 +17,7 @@ ckpt = "sdxl_lightning_1step_unet_x0.safetensors"
17
  unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cuda", torch.float16)
18
  unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cuda"))
19
  pipe_lightning = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float16, variant="fp16").to("cuda")
20
-
21
  pipe_lightning.scheduler = EulerDiscreteScheduler.from_config(pipe_lightning.scheduler.config, timestep_spacing="trailing", prediction_type="sample")
22
  pipe_lightning.to("cuda")
23
 
@@ -30,7 +30,7 @@ unet.load_state_dict(load_file(hf_hub_download(repo_name, ckpt_name), device="cu
30
  pipe_hyper = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float16, variant="fp16").to("cuda")
31
  pipe_hyper.scheduler = LCMScheduler.from_config(pipe_hyper.scheduler.config)
32
  pipe_hyper.to("cuda")
33
-
34
 
35
  @spaces.GPU
36
  def run_comparison(prompt):
 
17
  unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cuda", torch.float16)
18
  unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cuda"))
19
  pipe_lightning = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float16, variant="fp16").to("cuda")
20
+ del unet
21
  pipe_lightning.scheduler = EulerDiscreteScheduler.from_config(pipe_lightning.scheduler.config, timestep_spacing="trailing", prediction_type="sample")
22
  pipe_lightning.to("cuda")
23
 
 
30
  pipe_hyper = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float16, variant="fp16").to("cuda")
31
  pipe_hyper.scheduler = LCMScheduler.from_config(pipe_hyper.scheduler.config)
32
  pipe_hyper.to("cuda")
33
+ del unet
34
 
35
  @spaces.GPU
36
  def run_comparison(prompt):