Skip to content

Commit 28973fc

Browse files
committed
Enable flux.2 proj for preview with flux model
1 parent 16f839c commit 28973fc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

latent-preview.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const float flux_latent_rgb_proj[16][3] = {
9191
{-0.111849f, -0.055589f, -0.032361f}};
9292
float flux_latent_rgb_bias[3] = {0.024600f, -0.006937f, -0.008089f};
9393

94-
const float flux_2_latent_rgb_proj[32][3] = {
94+
const float flux2_latent_rgb_proj[32][3] = {
9595
{0.000736f, -0.008385f, -0.019710f},
9696
{-0.001352f, -0.016392f, 0.020693f},
9797
{-0.006376f, 0.002428f, 0.036736f},
@@ -124,7 +124,7 @@ const float flux_2_latent_rgb_proj[32][3] = {
124124
{-0.034560f, -0.008740f, 0.012996f},
125125
{0.000166f, 0.001079f, -0.012153f},
126126
{0.017772f, 0.000937f, -0.011953f}};
127-
float flux_2_latent_rgb_bias[3] = {-0.028738f, -0.098463f, -0.107619f};
127+
float flux2_latent_rgb_bias[3] = {-0.028738f, -0.098463f, -0.107619f};
128128

129129
// This one was taken straight from
130130
// https://github.com/Stability-AI/sd3.5/blob/8565799a3b41eb0c7ba976d18375f0f753f56402/sd3_impls.py#L288-L303

stable-diffusion.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,6 +1327,11 @@ class StableDiffusionGGML {
13271327
// unknown model
13281328
return;
13291329
}
1330+
} else if (dim == 32) {
1331+
if (sd_version_is_flux2(version)) {
1332+
latent_rgb_proj = flux2_latent_rgb_proj;
1333+
latent_rgb_bias = flux2_latent_rgb_bias;
1334+
}
13301335
} else if (dim == 16) {
13311336
// 16 channels VAE -> Flux or SD3
13321337

0 commit comments

Comments
 (0)