Spaces:
Runtime error
Runtime error
Commit
·
8273150
1
Parent(s):
028c209
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,12 @@ from multiprocessing import cpu_count
|
|
7 |
import requests
|
8 |
import io
|
9 |
import os
|
|
|
|
|
10 |
from PIL import Image
|
|
|
|
|
|
|
11 |
|
12 |
from diffusers import (
|
13 |
StableDiffusionPipeline,
|
@@ -38,6 +43,8 @@ pipe = StableDiffusionControlNetImg2ImgPipeline.from_pretrained(
|
|
38 |
torch_dtype=torch.float16,
|
39 |
).to("cuda")
|
40 |
pipe.enable_xformers_memory_efficient_attention()
|
|
|
|
|
41 |
|
42 |
|
43 |
def resize_for_condition_image(input_image: Image.Image, resolution: int):
|
|
|
7 |
import requests
|
8 |
import io
|
9 |
import os
|
10 |
+
|
11 |
+
|
12 |
from PIL import Image
|
13 |
+
from diffusers import StableDiffusionControlNetImg2ImgPipeline, ControlNetModel, DDIMScheduler
|
14 |
+
from diffusers.utils import load_image
|
15 |
+
|
16 |
|
17 |
from diffusers import (
|
18 |
StableDiffusionPipeline,
|
|
|
43 |
torch_dtype=torch.float16,
|
44 |
).to("cuda")
|
45 |
pipe.enable_xformers_memory_efficient_attention()
|
46 |
+
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
|
47 |
+
pipe.enable_model_cpu_offload()
|
48 |
|
49 |
|
50 |
def resize_for_condition_image(input_image: Image.Image, resolution: int):
|