fix fooocus sampler error when sample batch size > 1

This commit is contained in:
Tung Nguyen
2023-08-30 15:51:44 +07:00
parent 5eaf46d1fc
commit f104668770
+4
View File
@@ -445,6 +445,10 @@ def unet_forward_patched(
alpha *= 0.001 * sharpness
degraded_x0 = bilateral_blur(x0) * alpha + x0 * (1.0 - alpha)
# FIX: uc_mask is not always the same size as x0
if uc_mask.shape[0] < x0.shape[0]:
uc_mask = uc_mask.repeat(int(x0.shape[0] / uc_mask.shape[0]), 1, 1, 1)
x0 = x0 * uc_mask + degraded_x0 * (1.0 - uc_mask)
return x0