From 5aae034a30746b1ae5bae61ed053e397efdf4607 Mon Sep 17 00:00:00 2001 From: wwoodsTM Date: Tue, 23 Dec 2025 01:24:02 -0700 Subject: [PATCH] Restore asymmetric padding (right/bottom only) in DownSampleBlock::forward while keeping circular padding support --- common.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common.hpp b/common.hpp index b17c11e35..2a85d2d0e 100644 --- a/common.hpp +++ b/common.hpp @@ -28,7 +28,13 @@ class DownSampleBlock : public GGMLBlock { if (vae_downsample) { auto conv = std::dynamic_pointer_cast(blocks["conv"]); - x = ggml_ext_pad(ctx->ggml_ctx, x, 1, 1, 0, 0, ctx->circular_x_enabled, ctx->circular_y_enabled); + // Commenting out (from commit 50ff966) + // x = ggml_ext_pad(ctx->ggml_ctx, x, 1, 1, 0, 0, ctx->circular_x_enabled, ctx->circular_y_enabled); + + // Restoring asymmetric padding (right/bottom only) while keeping circular padding support. + // Matches original ggml_pad behavior, maintains spatial alignment through VAE encode/decode cycles. + x = ggml_ext_pad_ext(ctx->ggml_ctx, x, 0, 1, 0, 1, 0, 0, 0, 0, ctx->circular_x_enabled, ctx->circular_y_enabled); + x = conv->forward(ctx, x); } else { auto conv = std::dynamic_pointer_cast(blocks["op"]);