mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-20 19:30:20 +08:00
Prevent becoming blurry for default preview image.
This commit is contained in:
parent
1ff09e5541
commit
4489f45259
4
nodes.py
4
nodes.py
@ -335,7 +335,7 @@ class SavePreviewLatent(SaveLatent):
|
|||||||
upper_bound = 512
|
upper_bound = 512
|
||||||
|
|
||||||
if image is None:
|
if image is None:
|
||||||
image = comfy.utils.latent_to_rgb(latent_tensor)
|
image = comfy.utils.latent_to_rgb(latent_tensor).convert("P", palette=Image.ADAPTIVE, colors=256)
|
||||||
|
|
||||||
min_size = min(image.size[0], image.size[1])
|
min_size = min(image.size[0], image.size[1])
|
||||||
max_size = max(image.size[0], image.size[1])
|
max_size = max(image.size[0], image.size[1])
|
||||||
@ -351,7 +351,7 @@ class SavePreviewLatent(SaveLatent):
|
|||||||
w = int(image.size[0] * scale_factor)
|
w = int(image.size[0] * scale_factor)
|
||||||
h = int(image.size[1] * scale_factor)
|
h = int(image.size[1] * scale_factor)
|
||||||
|
|
||||||
image = image.resize((w, h))
|
image = image.resize((w, h), resample=Image.NEAREST)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# don't resize if provide preview image intentionally
|
# don't resize if provide preview image intentionally
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user