PeterL1n commited on
Commit
e08daf1
1 Parent(s): 5ecb4a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -26,9 +26,11 @@ def generate(prompt, option, progress=gr.Progress()):
26
  print(prompt, option)
27
  ckpt, step = opts[option]
28
 
 
 
29
  # Main pipeline.
30
  unet = UNet2DConditionModel.from_config(base, subfolder="unet")
31
- pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=dtype, variant="fp16")
32
  pipe.unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device=device))
33
  pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", prediction_type="sample" if step == 1 else "epsilon")
34
 
 
26
  print(prompt, option)
27
  ckpt, step = opts[option]
28
 
29
+ progress(0, desc="Downloading the model")
30
+
31
  # Main pipeline.
32
  unet = UNet2DConditionModel.from_config(base, subfolder="unet")
33
+ pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=dtype, variant="fp16").to(device, dtype)
34
  pipe.unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device=device))
35
  pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", prediction_type="sample" if step == 1 else "epsilon")
36