Skip to content

Commit 8f6fded

Browse files
authored
modify LCM scripts (#2586)
1 parent f0c37e0 commit 8f6fded

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

models_v2/pytorch/LCM/inference/cpu/inference.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,8 @@ def main():
286286
pipe.unet = torch.compile(pipe.unet)
287287
pipe.unet(*input)
288288
pipe.unet(*input)
289-
if args.model_name_or_path == "stabilityai/stable-diffusion-2-1":
290-
pipe.text_encoder = torch.compile(pipe.text_encoder)
291-
pipe.vae.decode = torch.compile(pipe.vae.decode)
289+
pipe.text_encoder = torch.compile(pipe.text_encoder)
290+
pipe.vae.decode = torch.compile(pipe.vae.decode)
292291
elif args.precision == "bf16":
293292
with torch.cpu.amp.autocast(), torch.no_grad():
294293
pipe.unet = torch.compile(pipe.unet)

models_v2/pytorch/stable_diffusion/inference/cpu/inference.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,8 @@ def main():
286286
pipe.unet = torch.compile(pipe.unet)
287287
pipe.unet(*input)
288288
pipe.unet(*input)
289-
if args.model_name_or_path == "stabilityai/stable-diffusion-2-1":
290-
pipe.text_encoder = torch.compile(pipe.text_encoder)
291-
pipe.vae.decode = torch.compile(pipe.vae.decode)
289+
pipe.text_encoder = torch.compile(pipe.text_encoder)
290+
pipe.vae.decode = torch.compile(pipe.vae.decode)
292291
elif args.precision == "bf16":
293292
with torch.cpu.amp.autocast(), torch.no_grad():
294293
pipe.unet = torch.compile(pipe.unet)

0 commit comments

Comments
 (0)