Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,7 @@ controlnet = ControlNetModel.from_pretrained(
|
|
| 37 |
"monster-labs/control_v1p_sd15_qrcode_monster",
|
| 38 |
#"DionTimmer/controlnet_qrcode-control_v1p_sd15",
|
| 39 |
torch_dtype=torch.float16
|
| 40 |
-
).to("
|
| 41 |
|
| 42 |
pipe = StableDiffusionControlNetImg2ImgPipeline.from_pretrained(
|
| 43 |
"digiplay/GhostMixV1.2VAE",
|
|
@@ -45,8 +45,10 @@ pipe = StableDiffusionControlNetImg2ImgPipeline.from_pretrained(
|
|
| 45 |
controlnet = controlnet,
|
| 46 |
torch_dtype = torch.float16,
|
| 47 |
safety_checker = None,
|
| 48 |
-
).to("
|
| 49 |
-
|
|
|
|
|
|
|
| 50 |
|
| 51 |
|
| 52 |
def resize_for_condition_image(input_image: Image.Image, resolution: int):
|
|
|
|
| 37 |
"monster-labs/control_v1p_sd15_qrcode_monster",
|
| 38 |
#"DionTimmer/controlnet_qrcode-control_v1p_sd15",
|
| 39 |
torch_dtype=torch.float16
|
| 40 |
+
).to("cuda")
|
| 41 |
|
| 42 |
pipe = StableDiffusionControlNetImg2ImgPipeline.from_pretrained(
|
| 43 |
"digiplay/GhostMixV1.2VAE",
|
|
|
|
| 45 |
controlnet = controlnet,
|
| 46 |
torch_dtype = torch.float16,
|
| 47 |
safety_checker = None,
|
| 48 |
+
).to("cuda")
|
| 49 |
+
pipe.enable_xformers_memory_efficient_attention()
|
| 50 |
+
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
|
| 51 |
+
pipe.enable_model_cpu_offload()
|
| 52 |
|
| 53 |
|
| 54 |
def resize_for_condition_image(input_image: Image.Image, resolution: int):
|