diff --git a/src/runtime/latent-preview.h b/src/runtime/latent-preview.h index 152399081..c19a0eebc 100644 --- a/src/runtime/latent-preview.h +++ b/src/runtime/latent-preview.h @@ -4,6 +4,33 @@ #include "core/tensor.hpp" #include "ggml.h" +const float minimax_latent_rgb_proj[24][3] = { + {0.19819857f, 0.11584999f, 0.07929777f}, + {-0.16047224f, -0.10601170f, -0.15996324f}, + {0.47391951f, 0.37602475f, 0.20267826f}, + {-0.09857441f, -0.27435449f, -0.51681751f}, + {-0.18930605f, -0.10512278f, -0.28571478f}, + {-0.15639569f, -0.18000929f, -0.25432852f}, + {-0.07176921f, -0.10901598f, -0.06654253f}, + {-0.05014077f, -0.05839826f, -0.05516087f}, + {-0.05201424f, -0.04351913f, -0.01507579f}, + {0.24750438f, 0.13307422f, 0.17684120f}, + {0.07377446f, 0.10235858f, 0.11707827f}, + {0.02908304f, 0.06587022f, 0.10643690f}, + {-0.00670531f, -0.03857879f, 0.01750151f}, + {-0.07119107f, -0.03083323f, -0.01995450f}, + {-0.08612627f, -0.07253841f, -0.01442890f}, + {0.08793202f, 0.08681750f, 0.02994647f}, + {0.00876893f, 0.02721868f, 0.00091178f}, + {-0.03484412f, -0.02711262f, -0.00110101f}, + {-0.00679772f, -0.01844275f, -0.01683359f}, + {0.04287028f, 0.01601068f, 0.04037397f}, + {-0.00493432f, -0.00230528f, 0.00353911f}, + {0.01495088f, 0.00292306f, 0.00416671f}, + {0.00495307f, 0.05066542f, 0.05210543f}, + {-0.02154842f, -0.01518524f, 0.00442402f}}; +float minimax_latent_rgb_bias[3] = {0.07776964f, -0.01580954f, -0.06561434f}; + const float ltxav_latent_rgb_proj[128][3] = { {-0.0293802f, -0.0362516f, -0.0291386f}, {0.0117735f, 0.0223435f, 0.018856f}, diff --git a/src/stable-diffusion.cpp b/src/stable-diffusion.cpp index bdb8a968b..f2b69cc02 100644 --- a/src/stable-diffusion.cpp +++ b/src/stable-diffusion.cpp @@ -2296,6 +2296,14 @@ class StableDiffusionGGML { LOG_WARN("No latent to RGB projection known for this model"); return; } + } else if (channels == 24) { + if(sd_version_is_minimax_h3(version)){ + latent_rgb_proj = minimax_latent_rgb_proj; + latent_rgb_bias = minimax_latent_rgb_bias; + } else { + LOG_WARN("No latent to RGB projection known for this model"); + return; + } } else if (channels == 16) { if (sd_version_is_sd3(version)) { latent_rgb_proj = sd3_latent_rgb_proj;