fix: scale Qwen Image 2.1 VAE convolutions (#2054)

This commit is contained in:
leejet authored and GitHub committed 2026-09-25 15:52:35 +08:00
1 parent b167b942f7
commit 0a9340c599
4 files changed
+30 -4

No files matched your search

+8 -1
View File
@@ -465,7 +465,11 @@ ggml_tensor* ggml_ext_conv_3d(ggml_context* ctx,
int d1,
int d2,
bool force_prec_f32,
bool direct) {
bool direct,
float scale) {
if (scale != 1.f) {
x = ggml_ext_scale(ctx, x, scale);
}
if (direct) {
int64_t OC = w->ne[3] / IC;
int64_t N = x->ne[3] / IC;
@@ -502,6 +506,9 @@ ggml_tensor* ggml_ext_conv_3d(ggml_context* ctx,
}
}
if (scale != 1.f) {
x = ggml_ext_scale(ctx, x, 1.f / scale);
}
if (b != nullptr) {
b = ggml_reshape_4d(ctx, b, 1, 1, 1, b->ne[0]); // [OC, 1, 1, 1]
x = ggml_add_inplace(ctx, x, b);
+2 -1
View File
@@ -154,7 +154,8 @@ ggml_tensor* ggml_ext_conv_3d(ggml_context* ctx,
int d1 = 1,
int d2 = 1,
bool force_prec_f32 = false,
bool direct = false);
bool direct = false,
float scale = 1.f);
// w: [OC,IC, KD, 1 * 1]
// x: [N, IC, ID, IH*IW]