Merge pull request #108 from tombearx/main

Fix ImagePadForOutpaintTargetSize
This commit is contained in:
Jukka Seppänen 2024-09-17 17:58:02 +03:00 committed by GitHub
commit ca0e1ad28d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1029,8 +1029,8 @@ class ImagePadForOutpaintTargetSize:
def expand_image(self, image, target_width, target_height, feathering, upscale_method, mask=None): def expand_image(self, image, target_width, target_height, feathering, upscale_method, mask=None):
B, H, W, C = image.size() B, H, W, C = image.size()
new_height = 0 new_height = H
new_width = 0 new_width = W
# Calculate the scaling factor while maintaining aspect ratio # Calculate the scaling factor while maintaining aspect ratio
scaling_factor = min(target_width / W, target_height / H) scaling_factor = min(target_width / W, target_height / H)
@ -1937,4 +1937,4 @@ class ImageGridtoBatch:
# Reshape to the final batch tensor # Reshape to the final batch tensor
img_tensor = image.view(-1, orig_h, orig_w, C) img_tensor = image.view(-1, orig_h, orig_w, C)
return img_tensor, return img_tensor,