Skip to content

Commit a8b92d2

Browse files
committed
fix encoding VAE tiling for Qwen Image
1 parent b8c6a60 commit a8b92d2

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
@@ -1433,10 +1433,19 @@ class StableDiffusionGGML {
14331433
if (vae_tiling_params.enabled && !encode_video) {
14341434
// TODO wan2.2 vae support?
14351435
int C = sd_version_is_dit(version) ? 16 : 4;
1436-
if (!use_tiny_autoencoder) {
1437-
C *= 2;
1436+
int NE2, NE3;
1437+
if (sd_version_is_qwen_image(version)) {
1438+
NE2 = x->ne[3];
1439+
NE3 = C;
1440+
}
1441+
else {
1442+
if (!use_tiny_autoencoder) {
1443+
C *= 2;
1444+
}
1445+
NE2 = C;
1446+
NE3 = x->ne[3];
14381447
}
1439-
result = ggml_new_tensor_4d(work_ctx, GGML_TYPE_F32, W, H, C, x->ne[3]);
1448+
result = ggml_new_tensor_4d(work_ctx, GGML_TYPE_F32, W, H, NE2, NE3);
14401449
}
14411450

14421451
if (sd_version_is_qwen_image(version)) {

0 commit comments

Comments
 (0)