Omnibus commited on
Commit
a05e88c
1 Parent(s): 744924d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -14,7 +14,7 @@ ckpt = "sdxl_lightning_4step_unet.safetensors" # Use the correct ckpt for your s
14
  # Load model.
15
  pipe_box=[]
16
  @spaces.GPU
17
- def inti():
18
  device="cuda"
19
  unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cuda", torch.float16)
20
  unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cuda"))
@@ -22,6 +22,7 @@ def inti():
22
  # Ensure sampler uses "trailing" timesteps.
23
  pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
24
  pipe_box.append(pipe)
 
25
  def run():
26
  pipe=pipe_box[0]
27
  # Ensure using the same inference steps as the loaded model and CFG set to 0.
 
14
  # Load model.
15
  pipe_box=[]
16
  @spaces.GPU
17
+ def init():
18
  device="cuda"
19
  unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cuda", torch.float16)
20
  unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cuda"))
 
22
  # Ensure sampler uses "trailing" timesteps.
23
  pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
24
  pipe_box.append(pipe)
25
+ init()
26
  def run():
27
  pipe=pipe_box[0]
28
  # Ensure using the same inference steps as the loaded model and CFG set to 0.