Update src/utils.py
Browse files- src/utils.py +3 -3
src/utils.py
CHANGED
|
@@ -20,7 +20,7 @@ from diffusers.models.unet_2d_blocks import (
|
|
| 20 |
get_down_block,
|
| 21 |
get_up_block,
|
| 22 |
)
|
| 23 |
-
from diffusers.models.unet_2d_condition import UNet2DConditionOutput
|
| 24 |
from copy import deepcopy
|
| 25 |
import json
|
| 26 |
|
|
@@ -632,7 +632,7 @@ def register_faster_forward(model, mod = '50ls'):
|
|
| 632 |
upsample_size = None
|
| 633 |
|
| 634 |
if any(s % default_overall_up_factor != 0 for s in sample.shape[-2:]):
|
| 635 |
-
|
| 636 |
forward_upsample_size = True
|
| 637 |
|
| 638 |
# prepare attention_mask
|
|
@@ -880,7 +880,7 @@ def register_normal_forward(model):
|
|
| 880 |
# os.makedirs(f'{timestep.item()}_step', exist_ok=True)
|
| 881 |
#---------------------
|
| 882 |
if any(s % default_overall_up_factor != 0 for s in sample.shape[-2:]):
|
| 883 |
-
|
| 884 |
forward_upsample_size = True
|
| 885 |
|
| 886 |
# prepare attention_mask
|
|
|
|
| 20 |
get_down_block,
|
| 21 |
get_up_block,
|
| 22 |
)
|
| 23 |
+
from diffusers.models.unet_2d_condition import UNet2DConditionOutput
|
| 24 |
from copy import deepcopy
|
| 25 |
import json
|
| 26 |
|
|
|
|
| 632 |
upsample_size = None
|
| 633 |
|
| 634 |
if any(s % default_overall_up_factor != 0 for s in sample.shape[-2:]):
|
| 635 |
+
print("Forward upsample size to force interpolation output size.")
|
| 636 |
forward_upsample_size = True
|
| 637 |
|
| 638 |
# prepare attention_mask
|
|
|
|
| 880 |
# os.makedirs(f'{timestep.item()}_step', exist_ok=True)
|
| 881 |
#---------------------
|
| 882 |
if any(s % default_overall_up_factor != 0 for s in sample.shape[-2:]):
|
| 883 |
+
print("Forward upsample size to force interpolation output size.")
|
| 884 |
forward_upsample_size = True
|
| 885 |
|
| 886 |
# prepare attention_mask
|