Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ repo = "ByteDance/SDXL-Lightning"
|
|
15 |
ckpt = "sdxl_lightning_1step_unet_x0.safetensors"
|
16 |
|
17 |
unet = UNet2DConditionModel.from_config(base, subfolder="unet").to(torch.float16)
|
18 |
-
unet.load_state_dict(load_file(hf_hub_download(repo, ckpt)
|
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")
|
@@ -26,7 +26,7 @@ repo_name = "ByteDance/Hyper-SD"
|
|
26 |
ckpt_name = "Hyper-SDXL-1step-Unet.safetensors"
|
27 |
|
28 |
unet = UNet2DConditionModel.from_config(base, subfolder="unet").to(torch.float16)
|
29 |
-
unet.load_state_dict(load_file(hf_hub_download(repo_name, ckpt_name))
|
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")
|
|
|
15 |
ckpt = "sdxl_lightning_1step_unet_x0.safetensors"
|
16 |
|
17 |
unet = UNet2DConditionModel.from_config(base, subfolder="unet").to(torch.float16)
|
18 |
+
unet.load_state_dict(load_file(hf_hub_download(repo, ckpt)))
|
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")
|
|
|
26 |
ckpt_name = "Hyper-SDXL-1step-Unet.safetensors"
|
27 |
|
28 |
unet = UNet2DConditionModel.from_config(base, subfolder="unet").to(torch.float16)
|
29 |
+
unet.load_state_dict(load_file(hf_hub_download(repo_name, ckpt_name)))
|
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")
|