Omnibus commited on
Commit
b66fb93
1 Parent(s): c0e3387

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -13,10 +13,10 @@ repo = "ByteDance/SDXL-Lightning"
13
  ckpt = "sdxl_lightning_4step_unet.safetensors" # Use the correct ckpt for your step setting!
14
  # Load model.
15
  pipe_box=[]
16
- device="cuda:0"
17
 
18
  @spaces.GPU()
19
  def init():
 
20
  #unet = UNet2DConditionModel.from_config(base, subfolder="unet").to(device, torch.float16)
21
  #unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device=device))
22
  #pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float16, variant="fp16").to(device)
@@ -25,6 +25,7 @@ def init():
25
  pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
26
  pipe_box.append(pipe)
27
  #init()
 
28
  def run():
29
  init()
30
  pipe=pipe_box[0]
 
13
  ckpt = "sdxl_lightning_4step_unet.safetensors" # Use the correct ckpt for your step setting!
14
  # Load model.
15
  pipe_box=[]
 
16
 
17
  @spaces.GPU()
18
  def init():
19
+ device="cuda:0"
20
  #unet = UNet2DConditionModel.from_config(base, subfolder="unet").to(device, torch.float16)
21
  #unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device=device))
22
  #pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float16, variant="fp16").to(device)
 
25
  pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
26
  pipe_box.append(pipe)
27
  #init()
28
+ @spaces.GPU()
29
  def run():
30
  init()
31
  pipe=pipe_box[0]