From 3beb06f6b35d909003094224ed8693c9b5f28d88 Mon Sep 17 00:00:00 2001 From: Daniele <57776841+daniandtheweb@users.noreply.github.com> Date: Sat, 24 Aug 2024 18:53:33 +0200 Subject: [PATCH] Fixed if --- stable-diffusion.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/stable-diffusion.cpp b/stable-diffusion.cpp index 741926a9..586c6d76 100644 --- a/stable-diffusion.cpp +++ b/stable-diffusion.cpp @@ -521,7 +521,7 @@ class StableDiffusionGGML { } else { // check is_using_v_parameterization_for_sd2 bool is_using_v_parameterization = false; - if (version == VERSION_2_x) { + if (version == VERSION_SD2) { if (is_using_v_parameterization_for_sd2(ctx)) { is_using_v_parameterization = true; } @@ -530,21 +530,22 @@ class StableDiffusionGGML { is_using_v_parameterization = true; } - if (version == VERSION_SD3_2B) { - LOG_INFO("running in FLOW mode"); - denoiser = std::make_shared(); - } else if (version == VERSION_FLUX_DEV || version == VERSION_FLUX_SCHNELL) { - LOG_INFO("running in Flux FLOW mode"); - float shift = 1.15f; - if (version == VERSION_FLUX_SCHNELL) { - shift = 1.0f; // TODO: validate + if (version == VERSION_SD3_2B) { + LOG_INFO("running in FLOW mode"); + denoiser = std::make_shared(); + } else if (version == VERSION_FLUX_DEV || version == VERSION_FLUX_SCHNELL) { + LOG_INFO("running in Flux FLOW mode"); + float shift = 1.15f; + if (version == VERSION_FLUX_SCHNELL) { + shift = 1.0f; // TODO: validate + } + denoiser = std::make_shared(shift); + } else if (is_using_v_parameterization) { + LOG_INFO("running in v-prediction mode"); + denoiser = std::make_shared(); + } else { + LOG_INFO("running in eps-prediction mode"); } - denoiser = std::make_shared(shift); - } else if (is_using_v_parameterization) { - LOG_INFO("running in v-prediction mode"); - denoiser = std::make_shared(); - } else { - LOG_INFO("running in eps-prediction mode"); } if (schedule != DEFAULT) {