diff --git a/README.md b/README.md index f4497e1..10461d0 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ This custom node helps to conveniently enhance images through Detector, Detailer ## NOTICE +* V4.77: Compatibility patch applied. Requires ComfyUI version (Oct. 8th) or later. * V4.73.3: ControlNetApply (SEGS) supports AnimateDiff * V4.20.1: Due to the feature update in `RegionalSampler`, the parameter order has changed, causing malfunctions in previously created `RegionalSamplers`. Please adjust the parameters accordingly. * V4.12: `MASKS` is changed to `MASK`. diff --git a/modules/impact/config.py b/modules/impact/config.py index 6ae10aa..7fcb8fc 100644 --- a/modules/impact/config.py +++ b/modules/impact/config.py @@ -2,7 +2,7 @@ import configparser import os -version_code = [4, 76, 1] +version_code = [4, 77] version = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') dependency_version = 20 diff --git a/modules/impact/utils.py b/modules/impact/utils.py index fcfd05e..9802214 100644 --- a/modules/impact/utils.py +++ b/modules/impact/utils.py @@ -495,9 +495,16 @@ def to_latent_image(pixels, vae): y = pixels.shape[2] if pixels.shape[1] != x or pixels.shape[2] != y: pixels = pixels[:, :x, :y, :] - pixels = nodes.VAEEncode.vae_encode_crop_pixels(pixels) - t = vae.encode(pixels[:, :, :, :3]) - return {"samples": t} + + vae_encode = nodes.VAEEncode() + if hasattr(nodes.VAEEncode, "vae_encode_crop_pixels"): + # backward compatibility + print(f"[Impact Pack] ComfyUI is outdated.") + pixels = nodes.VAEEncode.vae_encode_crop_pixels(pixels) + t = vae.encode(pixels[:, :, :, :3]) + return {"samples": t} + + return vae_encode.encode(vae, pixels)[0] def empty_pil_tensor(w=64, h=64):