mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-22 06:57:00 +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):
|
def decode_latent_to_preview_image(self, preview_format, x0):
|
||||||
preview_image = self.decode_latent_to_preview(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
|
preview_type = 1
|
||||||
if preview_format == "JPEG":
|
if preview_format == "JPEG":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user