Former-commit-id: 9ce0e4b07e3733c015137bc93c7e6d53bf25b08e
This commit is contained in:
hiyouga
2024-11-25 00:05:05 +08:00
parent 9f6c5c4798
commit ae9f338bf7
2 changed files with 3 additions and 3 deletions

View File

@@ -82,7 +82,7 @@ class BasePlugin:
Pre-processes a single image.
"""
image_resolution: int = kwargs.get("image_resolution")
if image.width * image.height > image_resolution:
if (image.width * image.height) > image_resolution:
resize_factor = math.sqrt(image_resolution / (image.width * image.height))
width, height = int(image.width * resize_factor), int(image.height * resize_factor)
image = image.resize((width, height), resample=Image.NEAREST)