From faf662d12e7ed3f1ba2869109db239561a03dca0 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 4 Aug 2025 21:07:50 +1000 Subject: [PATCH] refactor(backend): use BICUBIC resampling for Kontext images Switch from LANCZOS to BICUBIC for smoother image resizing to reduce artifacts in reference image processing --- invokeai/backend/flux/extensions/kontext_extension.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/invokeai/backend/flux/extensions/kontext_extension.py b/invokeai/backend/flux/extensions/kontext_extension.py index 1c75bed051..f9d1cccf27 100644 --- a/invokeai/backend/flux/extensions/kontext_extension.py +++ b/invokeai/backend/flux/extensions/kontext_extension.py @@ -133,7 +133,8 @@ class KontextExtension: image = image.convert("RGB") final_width = 8 * scaled_width final_height = 8 * scaled_height - image = image.resize((final_width, final_height), Image.Resampling.LANCZOS) + # Use BICUBIC for smoother resizing to reduce artifacts + image = image.resize((final_width, final_height), Image.Resampling.BICUBIC) # Convert to tensor with same normalization as BFL image_np = np.array(image)