Skip to content

Commit f1db617

Browse files
committed
fix encoding VAE tiling for Qwen Image
1 parent 91dca1a commit f1db617

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

stable-diffusion.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,10 +1440,19 @@ class StableDiffusionGGML {
14401440
if (vae_tiling_params.enabled && !encode_video) {
14411441
// TODO wan2.2 vae support?
14421442
int C = sd_version_is_dit(version) ? 16 : 4;
1443-
if (!use_tiny_autoencoder) {
1444-
C *= 2;
1443+
int NE2, NE3;
1444+
if (sd_version_is_qwen_image(version)) {
1445+
NE2 = x->ne[3];
1446+
NE3 = C;
1447+
}
1448+
else {
1449+
if (!use_tiny_autoencoder) {
1450+
C *= 2;
1451+
}
1452+
NE2 = C;
1453+
NE3 = x->ne[3];
14451454
}
1446-
result = ggml_new_tensor_4d(work_ctx, GGML_TYPE_F32, W, H, C, x->ne[3]);
1455+
result = ggml_new_tensor_4d(work_ctx, GGML_TYPE_F32, W, H, NE2, NE3);
14471456
}
14481457

14491458
if (sd_version_is_qwen_image(version)) {

0 commit comments

Comments
 (0)