From 36d286fb2b9fef7d4180a64911d8de021b1fed34 Mon Sep 17 00:00:00 2001 From: poxular Date: Mon, 1 Jun 2026 17:36:33 +0200 Subject: [PATCH] Restore full-resolution Comfy output; keep PIL 256 ONNX for LUT build. Co-authored-by: Cursor --- magicmatch_core/live_cache.py | 7 +++++-- nodes.py | 10 +++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/magicmatch_core/live_cache.py b/magicmatch_core/live_cache.py index 715b1eb..fe2ebf2 100644 --- a/magicmatch_core/live_cache.py +++ b/magicmatch_core/live_cache.py @@ -7,14 +7,17 @@ import io import numpy as np -from .image_ops import PROBE_MAX_EDGE, downscale_hwc_max_edge +from .image_ops import downscale_hwc_max_edge + +# Live UI only — queued IMAGE output stays full resolution +LIVE_PREVIEW_MAX_EDGE = 2048 def pack_live_cache(source_hwc: np.ndarray, merged_lut: np.ndarray) -> dict: """JSON-serializable bundle for the Comfy front-end (PNG + float32 LUT).""" from PIL import Image - small = downscale_hwc_max_edge(source_hwc, PROBE_MAX_EDGE) + small = downscale_hwc_max_edge(source_hwc, LIVE_PREVIEW_MAX_EDGE) merged = np.asarray(merged_lut, dtype=np.float32).reshape(-1) arr_u8 = (np.clip(small, 0, 1) * 255.0).astype(np.uint8) diff --git a/nodes.py b/nodes.py index 2468d45..d1a90d1 100644 --- a/nodes.py +++ b/nodes.py @@ -7,7 +7,6 @@ from __future__ import annotations import numpy as np import torch -from .magicmatch_core.image_ops import prepare_apply_source from .magicmatch_core.inference import build_merged_lut from .magicmatch_core.live_cache import pack_live_cache from .magicmatch_core.lut import apply_merged_lut_preview @@ -105,7 +104,7 @@ class MagicMatchPreview: FUNCTION = "preview" CATEGORY = "MAGICMATCH" DESCRIPTION = ( - "Apply cached LUT at probe parity (960px max edge, PIL 256 net). " + "Apply cached LUT at full source resolution (PIL 256 net for Build). " "Live slider after first run; queue again to export." ) @@ -160,9 +159,7 @@ class MagicMatch: RETURN_NAMES = ("image",) FUNCTION = "match" CATEGORY = "MAGICMATCH" - DESCRIPTION = ( - "One-shot color match; output at 960px max edge like the standalone probe." - ) + DESCRIPTION = "Single-node color match at full resolution (PIL 256 net)." def match( self, @@ -173,9 +170,8 @@ class MagicMatch: src = _image_batch_to_hwc(source) ref = _image_batch_to_hwc(reference) merged = build_merged_lut(src, ref) - src_apply = prepare_apply_source(src) strength = float(np.clip(strength, 0.0, 1.0)) - out = apply_merged_lut_preview(src_apply, merged, strength) + out = apply_merged_lut_preview(src, merged, strength) return (_hwc_to_image(out),)