multimodalart HF staff commited on
Commit
6da6b11
1 Parent(s): d827a95

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -3,6 +3,7 @@ from diffusers import StableDiffusionXLPipeline, UNet2DConditionModel, EulerDisc
3
  import torch
4
  from huggingface_hub import hf_hub_download
5
  from safetensors.torch import load_file
 
6
 
7
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
8
 
@@ -55,6 +56,7 @@ pipe_hyper.scheduler = LCMScheduler.from_config(pipe_hyper.scheduler.config)
55
  pipe_hyper.to("cuda")
56
  del unet
57
 
 
58
  def run_comparison(prompt):
59
  image_turbo=pipe_turbo(prompt=prompt, num_inference_steps=1, guidance_scale=0).images[0]
60
  image_lightning=pipe_lightning(prompt=prompt, num_inference_steps=1, guidance_scale=0).images[0]
 
3
  import torch
4
  from huggingface_hub import hf_hub_download
5
  from safetensors.torch import load_file
6
+ import spaces
7
 
8
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
9
 
 
56
  pipe_hyper.to("cuda")
57
  del unet
58
 
59
+ @spaces.GPU
60
  def run_comparison(prompt):
61
  image_turbo=pipe_turbo(prompt=prompt, num_inference_steps=1, guidance_scale=0).images[0]
62
  image_lightning=pipe_lightning(prompt=prompt, num_inference_steps=1, guidance_scale=0).images[0]