Spaces:
Sleeping
Sleeping
Bobby
commited on
Commit
·
883eb2e
1
Parent(s):
1cdb901
test
Browse files
app.py
CHANGED
|
@@ -19,6 +19,7 @@ from diffusers import (
|
|
| 19 |
DPMSolverMultistepScheduler,
|
| 20 |
StableDiffusionControlNetPipeline,
|
| 21 |
)
|
|
|
|
| 22 |
from preprocess import Preprocessor
|
| 23 |
MAX_SEED = np.iinfo(np.int32).max
|
| 24 |
API_KEY = os.environ.get("API_KEY", None)
|
|
@@ -95,6 +96,7 @@ if gr.NO_RELOAD:
|
|
| 95 |
def init(pipe):
|
| 96 |
pipe.enable_xformers_memory_efficient_attention()
|
| 97 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
|
|
|
| 98 |
print("Model Compiled!")
|
| 99 |
init(pipe)
|
| 100 |
|
|
|
|
| 19 |
DPMSolverMultistepScheduler,
|
| 20 |
StableDiffusionControlNetPipeline,
|
| 21 |
)
|
| 22 |
+
from diffusers.models.attention_processor import AttnProcessor2_0
|
| 23 |
from preprocess import Preprocessor
|
| 24 |
MAX_SEED = np.iinfo(np.int32).max
|
| 25 |
API_KEY = os.environ.get("API_KEY", None)
|
|
|
|
| 96 |
def init(pipe):
|
| 97 |
pipe.enable_xformers_memory_efficient_attention()
|
| 98 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
| 99 |
+
pipe.unet.set_attn_processor(AttnProcessor2_0())
|
| 100 |
print("Model Compiled!")
|
| 101 |
init(pipe)
|
| 102 |
|