From f1230284b11ac8befb356f6fb494340595046f04 Mon Sep 17 00:00:00 2001 From: David Chatel Date: Thu, 28 Nov 2024 18:51:26 +0100 Subject: [PATCH] in/outpainting gray instead of black --- nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodes.py b/nodes.py index 845366f..148dc2a 100644 --- a/nodes.py +++ b/nodes.py @@ -40,7 +40,7 @@ class PercentPadding: soft_m = np.minimum(dist / 32, 1) soft_m = torch.from_numpy(soft_m).type(torch.float32) mask = soft_m - image = F.pad(image, (left, top, right, bottom), 0, padding_mode='constant') + image = F.pad(image, (left, top, right, bottom), 0.5, padding_mode='constant') if c != 4: image = torch.cat((image, mask.unsqueeze(1)), 1) else: @@ -144,7 +144,7 @@ class ResizeCropFit: soft_m = np.minimum(dist / 32, 1) soft_m = torch.from_numpy(soft_m).type(torch.float32) mask = soft_m - result = F.pad(result, phw, fill=0, padding_mode='constant') + result = F.pad(result, phw, fill=0.5, padding_mode='constant') if c != 4: result = torch.cat((result, mask.unsqueeze(1)), 1) # result[:,3,:,:] = 1