mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-17 08:52:34 +08:00
prevent breaking old Pillow users
This commit is contained in:
parent
1b51478cc3
commit
55fadce8b2
@ -16,7 +16,12 @@ class LatentPreviewer:
|
||||
def decode_latent_to_preview_image(self, preview_format, x0):
|
||||
preview_image = self.decode_latent_to_preview(x0)
|
||||
|
||||
preview_image = ImageOps.contain(preview_image, (MAX_PREVIEW_RESOLUTION, MAX_PREVIEW_RESOLUTION), Image.Resampling.LANCZOS)
|
||||
if hasattr(Image, 'Resampling'):
|
||||
resampling = Image.Resampling.LANCZOS
|
||||
else:
|
||||
resampling = Image.ANTIALIAS
|
||||
|
||||
preview_image = ImageOps.contain(preview_image, (MAX_PREVIEW_RESOLUTION, MAX_PREVIEW_RESOLUTION), resampling)
|
||||
|
||||
preview_type = 1
|
||||
if preview_format == "JPEG":
|
||||
|
||||
Loading…
Reference in New Issue
Block a user