Skip to content

Commit 196bb89

Browse files
committed
patch size consistent with Flux1
1 parent fd032bc commit 196bb89

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

flux.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,6 @@ namespace Flux {
13091309
} else if (sd_version_is_longcat(version)) {
13101310
flux_params.context_in_dim = 3584;
13111311
flux_params.vec_in_dim = 0;
1312-
flux_params.patch_size = 1;
13131312
}
13141313
for (auto pair : tensor_storage_map) {
13151314
std::string tensor_name = pair.first;

stable-diffusion.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,12 +1346,6 @@ class StableDiffusionGGML {
13461346
latent_rgb_bias = flux2_latent_rgb_bias;
13471347
patch_sz = 2;
13481348
}
1349-
} else if (dim == 64) {
1350-
if (sd_version_is_flux(version) || sd_version_is_z_image(version) || sd_version_is_longcat(version)) {
1351-
latent_rgb_proj = flux_latent_rgb_proj;
1352-
latent_rgb_bias = flux_latent_rgb_bias;
1353-
patch_sz = 2;
1354-
}
13551349
} else if (dim == 48) {
13561350
if (sd_version_is_wan(version)) {
13571351
latent_rgb_proj = wan_22_latent_rgb_proj;
@@ -1916,7 +1910,7 @@ class StableDiffusionGGML {
19161910
int vae_scale_factor = 8;
19171911
if (version == VERSION_WAN2_2_TI2V) {
19181912
vae_scale_factor = 16;
1919-
} else if (sd_version_is_flux2(version) || sd_version_is_longcat(version)) {
1913+
} else if (sd_version_is_flux2(version)) {
19201914
vae_scale_factor = 16;
19211915
} else if (version == VERSION_CHROMA_RADIANCE) {
19221916
vae_scale_factor = 1;
@@ -1945,8 +1939,6 @@ class StableDiffusionGGML {
19451939
latent_channel = 3;
19461940
} else if (sd_version_is_flux2(version)) {
19471941
latent_channel = 128;
1948-
} else if (sd_version_is_longcat(version)) {
1949-
latent_channel = 64;
19501942
} else {
19511943
latent_channel = 16;
19521944
}
@@ -2247,7 +2239,6 @@ class StableDiffusionGGML {
22472239
sd_version_is_qwen_image(version) ||
22482240
sd_version_is_wan(version) ||
22492241
sd_version_is_flux2(version) ||
2250-
sd_version_is_longcat(version) ||
22512242
version == VERSION_CHROMA_RADIANCE) {
22522243
latent = vae_output;
22532244
} else if (version == VERSION_SD1_PIX2PIX) {

vae.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ class AutoencodingEngine : public GGMLBlock {
553553

554554
struct ggml_tensor* decode(GGMLRunnerContext* ctx, struct ggml_tensor* z) {
555555
// z: [N, z_channels, h, w]
556-
if (sd_version_is_flux2(version) || sd_version_is_longcat(version)) {
556+
if (sd_version_is_flux2(version)) {
557557
// [N, C*p*p, h, w] -> [N, C, h*p, w*p]
558558
int64_t p = 2;
559559

@@ -592,7 +592,7 @@ class AutoencodingEngine : public GGMLBlock {
592592
auto quant_conv = std::dynamic_pointer_cast<Conv2d>(blocks["quant_conv"]);
593593
z = quant_conv->forward(ctx, z); // [N, 2*embed_dim, h/8, w/8]
594594
}
595-
if (sd_version_is_flux2(version) || sd_version_is_longcat(version)) {
595+
if (sd_version_is_flux2(version)) {
596596
z = ggml_ext_chunk(ctx->ggml_ctx, z, 2, 2)[0];
597597

598598
// [N, C, H, W] -> [N, C*p*p, H/p, W/p]

0 commit comments

Comments
 (0)