Update app.py
Browse files
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"
|
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)
|