fix: support --flow-shift for flux models with default pred (#913)

This commit is contained in:
stduhpf 2025-10-23 15:35:18 +02:00 committed by GitHub
parent 48e0a28ddf
commit 917f7bfe99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -761,11 +761,14 @@ public:
denoiser = std::make_shared<DiscreteFlowDenoiser>(shift);
} else if (sd_version_is_flux(version)) {
LOG_INFO("running in Flux FLOW mode");
float shift = 1.0f; // TODO: validate
for (auto pair : model_loader.tensor_storages_types) {
if (pair.first.find("model.diffusion_model.guidance_in.in_layer.weight") != std::string::npos) {
shift = 1.15f;
break;
float shift = sd_ctx_params->flow_shift;
if (shift == INFINITY) {
shift = 1.0f; // TODO: validate
for (auto pair : model_loader.tensor_storages_types) {
if (pair.first.find("model.diffusion_model.guidance_in.in_layer.weight") != std::string::npos) {
shift = 1.15f;
break;
}
}
}
denoiser = std::make_shared<FluxFlowDenoiser>(shift);