Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,8 +8,8 @@ from PIL import Image
|
|
| 8 |
import spaces
|
| 9 |
|
| 10 |
# 🌟 Auto-detect device (CPU/GPU)
|
| 11 |
-
device = "cuda"
|
| 12 |
-
precision = torch.float16
|
| 13 |
|
| 14 |
|
| 15 |
eulera_scheduler = EulerAncestralDiscreteScheduler.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", subfolder="scheduler")
|
|
@@ -21,13 +21,13 @@ controlnet = ControlNetModel.from_pretrained(
|
|
| 21 |
)
|
| 22 |
|
| 23 |
# when test with other base model, you need to change the vae also.
|
| 24 |
-
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=
|
| 25 |
|
| 26 |
pipe = StableDiffusionXLControlNetPipeline.from_pretrained(
|
| 27 |
"stabilityai/stable-diffusion-xl-base-1.0",
|
| 28 |
controlnet=controlnet,
|
| 29 |
vae=vae,
|
| 30 |
-
torch_dtype=
|
| 31 |
scheduler=eulera_scheduler,
|
| 32 |
)
|
| 33 |
|
|
|
|
| 8 |
import spaces
|
| 9 |
|
| 10 |
# 🌟 Auto-detect device (CPU/GPU)
|
| 11 |
+
device = "cuda"
|
| 12 |
+
precision = torch.float16
|
| 13 |
|
| 14 |
|
| 15 |
eulera_scheduler = EulerAncestralDiscreteScheduler.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", subfolder="scheduler")
|
|
|
|
| 21 |
)
|
| 22 |
|
| 23 |
# when test with other base model, you need to change the vae also.
|
| 24 |
+
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=precision)
|
| 25 |
|
| 26 |
pipe = StableDiffusionXLControlNetPipeline.from_pretrained(
|
| 27 |
"stabilityai/stable-diffusion-xl-base-1.0",
|
| 28 |
controlnet=controlnet,
|
| 29 |
vae=vae,
|
| 30 |
+
torch_dtype=precision,
|
| 31 |
scheduler=eulera_scheduler,
|
| 32 |
)
|
| 33 |
|