Skip to content

Commit 356453c

Browse files
committed
fix encoding VAE tiling for Qwen Image
1 parent 5b6ba02 commit 356453c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

otherarch/sdcpp/stable-diffusion.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,10 +1553,19 @@ class StableDiffusionGGML {
15531553
if (vae_tiling_params.enabled && !encode_video) {
15541554
// TODO wan2.2 vae support?
15551555
int C = sd_version_is_dit(version) ? 16 : 4;
1556-
if (!use_tiny_autoencoder) {
1557-
C *= 2;
1556+
int NE2, NE3;
1557+
if (sd_version_is_qwen_image(version)) {
1558+
NE2 = x->ne[3];
1559+
NE3 = C;
1560+
}
1561+
else {
1562+
if (!use_tiny_autoencoder) {
1563+
C *= 2;
1564+
}
1565+
NE2 = C;
1566+
NE3 = x->ne[3];
15581567
}
1559-
result = ggml_new_tensor_4d(work_ctx, GGML_TYPE_F32, W, H, C, x->ne[3]);
1568+
result = ggml_new_tensor_4d(work_ctx, GGML_TYPE_F32, W, H, NE2, NE3);
15601569
}
15611570

15621571
if (sd_version_is_qwen_image(version)) {

0 commit comments

Comments
 (0)