Skip to content

Commit 997bb11

Browse files
fix: correct encoder channels for flux2 (#1346)
1 parent 862a658 commit 997bb11

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/auto_encoder_kl.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,9 @@ class AutoEncoderKLModel : public GGMLBlock {
613613

614614
int get_encoder_output_channels() {
615615
int factor = dd_config.double_z ? 2 : 1;
616+
if (sd_version_is_flux2(version)) {
617+
return dd_config.z_channels * 4;
618+
}
616619
return dd_config.z_channels * factor;
617620
}
618621
};
@@ -927,4 +930,4 @@ struct AutoEncoderKL : public VAE {
927930
};
928931
};
929932

930-
#endif // __AUTO_ENCODER_KL_HPP__
933+
#endif // __AUTO_ENCODER_KL_HPP__

0 commit comments

Comments
 (0)