Spaces:
Build error
Build error
alfredplpl
commited on
Commit
•
8c44916
1
Parent(s):
a2f8768
Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,7 @@ pipe = StableDiffusionPipeline.from_pretrained(
|
|
15 |
model_id,
|
16 |
torch_dtype=torch.float32 if torch.cuda.is_available() else torch.float32,
|
17 |
scheduler=scheduler)
|
|
|
18 |
|
19 |
pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(
|
20 |
model_id,
|
@@ -43,15 +44,15 @@ def inference(prompt, guidance, steps, image_size="Square", seed=0, img=None, st
|
|
43 |
if(image_size=="Portrait"):
|
44 |
height=1024
|
45 |
width=768
|
46 |
-
pipe.enable_attention_slicing()
|
47 |
elif(image_size=="Landscape"):
|
48 |
height=768
|
49 |
width=1024
|
50 |
-
pipe.enable_attention_slicing()
|
51 |
else:
|
52 |
height=768
|
53 |
width=768
|
54 |
-
pipe.enable_attention_slicing()
|
55 |
|
56 |
print(prompt,neg_prompt)
|
57 |
|
|
|
15 |
model_id,
|
16 |
torch_dtype=torch.float32 if torch.cuda.is_available() else torch.float32,
|
17 |
scheduler=scheduler)
|
18 |
+
pipe.enable_xformers_memory_efficient_attention()
|
19 |
|
20 |
pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(
|
21 |
model_id,
|
|
|
44 |
if(image_size=="Portrait"):
|
45 |
height=1024
|
46 |
width=768
|
47 |
+
#pipe.enable_attention_slicing()
|
48 |
elif(image_size=="Landscape"):
|
49 |
height=768
|
50 |
width=1024
|
51 |
+
#pipe.enable_attention_slicing()
|
52 |
else:
|
53 |
height=768
|
54 |
width=768
|
55 |
+
#pipe.enable_attention_slicing()
|
56 |
|
57 |
print(prompt,neg_prompt)
|
58 |
|