Spaces:
Runtime error
Runtime error
update enviroment
Browse files- app.py +2 -1
- models/region_diffusion.py +1 -0
- requirements.txt +5 -5
app.py
CHANGED
|
@@ -112,6 +112,7 @@ def main():
|
|
| 112 |
# get token maps from plain text to image generation.
|
| 113 |
begin_time = time.time()
|
| 114 |
if model.selfattn_maps is None and model.crossattn_maps is None:
|
|
|
|
| 115 |
model.register_tokenmap_hooks()
|
| 116 |
else:
|
| 117 |
model.reset_attention_maps()
|
|
@@ -344,7 +345,7 @@ def main():
|
|
| 344 |
'',
|
| 345 |
5,
|
| 346 |
0.3,
|
| 347 |
-
0.
|
| 348 |
6,
|
| 349 |
0.5,
|
| 350 |
None,
|
|
|
|
| 112 |
# get token maps from plain text to image generation.
|
| 113 |
begin_time = time.time()
|
| 114 |
if model.selfattn_maps is None and model.crossattn_maps is None:
|
| 115 |
+
model.remove_tokenmap_hooks()
|
| 116 |
model.register_tokenmap_hooks()
|
| 117 |
else:
|
| 118 |
model.reset_attention_maps()
|
|
|
|
| 345 |
'',
|
| 346 |
5,
|
| 347 |
0.3,
|
| 348 |
+
0.5,
|
| 349 |
6,
|
| 350 |
0.5,
|
| 351 |
None,
|
models/region_diffusion.py
CHANGED
|
@@ -41,6 +41,7 @@ class RegionDiffusion(nn.Module):
|
|
| 41 |
self.selfattn_maps = None
|
| 42 |
self.crossattn_maps = None
|
| 43 |
self.color_loss = torch.nn.functional.mse_loss
|
|
|
|
| 44 |
self.forward_replacement_hooks = []
|
| 45 |
|
| 46 |
print(f'[INFO] loaded stable diffusion!')
|
|
|
|
| 41 |
self.selfattn_maps = None
|
| 42 |
self.crossattn_maps = None
|
| 43 |
self.color_loss = torch.nn.functional.mse_loss
|
| 44 |
+
self.forward_hooks = []
|
| 45 |
self.forward_replacement_hooks = []
|
| 46 |
|
| 47 |
print(f'[INFO] loaded stable diffusion!')
|
requirements.txt
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
-
--extra-index-url https://download.pytorch.org/whl/
|
| 2 |
-
torch==1.
|
| 3 |
-
torchvision==0.
|
| 4 |
diffusers==0.12.1
|
| 5 |
-
transformers==4.
|
| 6 |
numpy==1.24.2
|
| 7 |
seaborn==0.12.2
|
| 8 |
-
accelerate==0.
|
| 9 |
scikit-learn==0.24.1
|
|
|
|
| 1 |
+
--extra-index-url https://download.pytorch.org/whl/cu117
|
| 2 |
+
torch==1.13.1
|
| 3 |
+
torchvision==0.14.1
|
| 4 |
diffusers==0.12.1
|
| 5 |
+
transformers==4.26.0
|
| 6 |
numpy==1.24.2
|
| 7 |
seaborn==0.12.2
|
| 8 |
+
accelerate==0.16.0
|
| 9 |
scikit-learn==0.24.1
|