From 3c3b0a8c6f92f226c0ef65264e02677a5067cd24 Mon Sep 17 00:00:00 2001 From: CalamitousFelicitousness Date: Sat, 25 Apr 2026 21:44:09 +0100 Subject: [PATCH] fix(grading): preserve image .info across grade_image Image.fromarray returns a fresh PIL image with empty .info, so the source's parameters/UserComment metadata was silently dropped on the grading roundtrip. In the Process tab this caused upscale + color grading to save PNGs without the original generation parameters, while upscale alone (via PIL resize/filter ops that preserve .info) still worked. --- modules/processing_grading.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/processing_grading.py b/modules/processing_grading.py index c0fe0fe09..055e72de7 100644 --- a/modules/processing_grading.py +++ b/modules/processing_grading.py @@ -244,6 +244,7 @@ def grade_image(image: Image.Image, params: GradingParams) -> Image.Image: tensor = tensor.clamp(0, 1) arr = (tensor.squeeze(0).permute(1, 2, 0).float().cpu().numpy() * 255).astype(np.uint8) result = Image.fromarray(arr) + result.info = image.info.copy() # Image.fromarray drops info; preserve so Process-tab metadata survives grading # LUT applied last (CPU, via pillow-lut-tools) if params.lut_cube_file: