Skip to content

fix: honor reference image resize opt-out in server requests - #2011

Merged
leejet merged 1 commit into
leejet:masterfrom
AzizMuminov:fix-ref-image-resize-opt-out
Sep 21, 2026
Merged

leejet merged 1 commit into
leejet:masterfrom
AzizMuminov:fix-ref-image-resize-opt-out

Conversation

@AzizMuminov

@AzizMuminov AzizMuminov commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Make auto_resize_ref_image: false preserve native dimensions for native ref_images and SDAPI extra_images.
  • Preserve the existing default behavior when auto_resize_ref_image is enabled or omitted.
  • Keep the OpenAI edits route unchanged because it also establishes generic init_image/img2img semantics.

Related Issue / Discussion

Related to #2004.

The server previously resized base64 reference images to the requested output size during decode. This occurred before the later resize_before_vae option was evaluated, so setting auto_resize_ref_image: false could not restore the original pixels. For PiD, which bypasses the later reference-VAE resize path, the prematurely upscaled reference was encoded directly.

This intentionally takes the compatibility-preserving approach: the existing opt-out now works, while default server requests retain their current behavior. It differs from #2007, which proposes preserving native reference dimensions by default.

Verification

  • Parser-level probe using a 1x1 PNG and a 1536x1152 request:
    • default behavior: reference is resized to 1536x1152;
    • auto_resize_ref_image: false: reference remains 1x1 through the generation request.
  • cmake --build build_issue2004 --target sd-server -j 4 with SD_METAL=ON.
  • git diff --check.

Full PiD image-quality verification was not run because the required PiD model weights are not available locally.

@leejet
leejet merged commit 78557f8 into leejet:master Sep 21, 2026
9 checks passed
@leejet

leejet commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants