Spaces:
Runtime error
Runtime error
Commit
·
64efbd0
1
Parent(s):
2728f78
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,7 @@ from diffusers import StableDiffusionPipeline
|
|
| 12 |
import torch
|
| 13 |
from free_lunch_utils import register_free_upblock2d, register_free_crossattn_upblock2d
|
| 14 |
|
|
|
|
| 15 |
|
| 16 |
model_id = "CompVis/stable-diffusion-v1-4"
|
| 17 |
|
|
@@ -20,10 +21,10 @@ pip_sd = pip_sd.to("cuda")
|
|
| 20 |
|
| 21 |
pip_freeu = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 22 |
pip_freeu = pip_freeu.to("cuda")
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
#
|
| 27 |
|
| 28 |
def infer(prompt):
|
| 29 |
|
|
|
|
| 12 |
import torch
|
| 13 |
from free_lunch_utils import register_free_upblock2d, register_free_crossattn_upblock2d
|
| 14 |
|
| 15 |
+
torch.manual_seed(42)
|
| 16 |
|
| 17 |
model_id = "CompVis/stable-diffusion-v1-4"
|
| 18 |
|
|
|
|
| 21 |
|
| 22 |
pip_freeu = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 23 |
pip_freeu = pip_freeu.to("cuda")
|
| 24 |
+
# -------- freeu block registration
|
| 25 |
+
register_free_upblock2d(pip_freeu, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
|
| 26 |
+
register_free_crossattn_upblock2d(pip_freeu, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
|
| 27 |
+
# -------- freeu block registration
|
| 28 |
|
| 29 |
def infer(prompt):
|
| 30 |
|