Iwaku-Real commited on
Commit
d46664c
1 Parent(s): f15c2c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -17,7 +17,7 @@ from diffusers import StableDiffusionXLPipeline, LCMScheduler
17
 
18
  # from scheduling_tcd import TCDScheduler
19
 
20
- torch.backends.cuda.matmul.allow_tf32 = True
21
 
22
  class timer:
23
  def __init__(self, method_name="timed process"):
@@ -35,7 +35,7 @@ if not path.exists(cache_path):
35
  os.makedirs(cache_path, exist_ok=True)
36
 
37
  pipe = StableDiffusionXLPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.bfloat16)
38
- pipe.to(device="cuda", dtype=torch.bfloat16)
39
  unet_state = load_file(hf_hub_download("ByteDance/Hyper-SD", "Hyper-SDXL-1step-Unet.safetensors"), device="cuda")
40
  pipe.unet.load_state_dict(unet_state)
41
  pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config, timestep_spacing ="trailing")
 
17
 
18
  # from scheduling_tcd import TCDScheduler
19
 
20
+ # torch.backends.cuda.matmul.allow_tf32 = True
21
 
22
  class timer:
23
  def __init__(self, method_name="timed process"):
 
35
  os.makedirs(cache_path, exist_ok=True)
36
 
37
  pipe = StableDiffusionXLPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.bfloat16)
38
+ pipe.to(device="cpu", dtype=torch.bfloat16)
39
  unet_state = load_file(hf_hub_download("ByteDance/Hyper-SD", "Hyper-SDXL-1step-Unet.safetensors"), device="cuda")
40
  pipe.unet.load_state_dict(unet_state)
41
  pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config, timestep_spacing ="trailing")