We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afb4fa1 commit 74c17a2Copy full SHA for 74c17a2
1 file changed
comfy/utils.py
@@ -1164,12 +1164,18 @@ def mult_list_upscale(a):
1164
1165
o = out
1166
o_d = out_div
1167
+ ps_view = ps
1168
+ mask_view = mask
1169
for d in range(dims):
- o = o.narrow(d + 2, upscaled[d], mask.shape[d + 2])
- o_d = o_d.narrow(d + 2, upscaled[d], mask.shape[d + 2])
1170
-
1171
- o.add_(ps * mask)
1172
- o_d.add_(mask)
+ l = min(ps_view.shape[d + 2], o.shape[d + 2] - upscaled[d])
+ o = o.narrow(d + 2, upscaled[d], l)
+ o_d = o_d.narrow(d + 2, upscaled[d], l)
1173
+ if l < ps_view.shape[d + 2]:
1174
+ ps_view = ps_view.narrow(d + 2, 0, l)
1175
+ mask_view = mask_view.narrow(d + 2, 0, l)
1176
+
1177
+ o.add_(ps_view * mask_view)
1178
+ o_d.add_(mask_view)
1179
1180
if pbar is not None:
1181
pbar.update(1)
0 commit comments