vilarin commited on
Commit
81dbe48
·
verified ·
1 Parent(s): f14baf4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -41,7 +41,7 @@ vae = AutoencoderKL.from_pretrained(
41
 
42
  # Ensure model and scheduler are initialized in GPU-enabled function
43
  if torch.cuda.is_available():
44
- unet = UNet2DConditionModel.from_pretrained(model, subfolder="unet").to("cuda", torch.float16)
45
  pipe = StableDiffusionXLPipeline.from_pretrained(model, vae=vae, unet=unet, torch_dtype=torch.float16).to("cuda")
46
 
47
  pipe.scheduler = KDPM2AncestralDiscreteScheduler.from_config(pipe.scheduler.config)
 
41
 
42
  # Ensure model and scheduler are initialized in GPU-enabled function
43
  if torch.cuda.is_available():
44
+ unet = UNet2DConditionModel.from_pretrained(model, subfolder="unet", torch_dtype=torch.float16).to("cuda")
45
  pipe = StableDiffusionXLPipeline.from_pretrained(model, vae=vae, unet=unet, torch_dtype=torch.float16).to("cuda")
46
 
47
  pipe.scheduler = KDPM2AncestralDiscreteScheduler.from_config(pipe.scheduler.config)