Spaces:
Runtime error
Runtime error
Sophia Yang
commited on
Commit
·
91dec07
1
Parent(s):
05170b4
test
Browse files- app.py +2 -0
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -21,6 +21,8 @@ model_id = "timbrooks/instruct-pix2pix"
|
|
| 21 |
pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(
|
| 22 |
model_id, torch_dtype=torch.float16
|
| 23 |
).to("cuda")
|
|
|
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
def new_image(prompt, image, img_guidance, guidance, steps):
|
|
|
|
| 21 |
pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(
|
| 22 |
model_id, torch_dtype=torch.float16
|
| 23 |
).to("cuda")
|
| 24 |
+
pipe.enable_xformers_memory_efficient_attention()
|
| 25 |
+
pipe.unet.to(memory_format=torch.channels_last)
|
| 26 |
|
| 27 |
|
| 28 |
def new_image(prompt, image, img_guidance, guidance, steps):
|
requirements.txt
CHANGED
|
@@ -2,4 +2,4 @@ panel
|
|
| 2 |
hvplot
|
| 3 |
diffusers
|
| 4 |
transformers
|
| 5 |
-
accelerate
|
|
|
|
| 2 |
hvplot
|
| 3 |
diffusers
|
| 4 |
transformers
|
| 5 |
+
accelerate
|