refactor(backend): use BICUBIC resampling for Kontext images

Switch from LANCZOS to BICUBIC for smoother image resizing to reduce
artifacts in reference image processing
This commit is contained in:
psychedelicious
2025-08-04 21:07:50 +10:00
parent 44a7dfd486
commit faf662d12e

View File

@@ -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)