Skip to content

Commit b9064ac

Browse files
committed
Fixed if
1 parent 6c88e8b commit b9064ac

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

stable-diffusion.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ class StableDiffusionGGML {
510510
} else {
511511
// check is_using_v_parameterization_for_sd2
512512
bool is_using_v_parameterization = false;
513-
if (version == VERSION_2_x) {
513+
if (version == VERSION_SD2) {
514514
if (is_using_v_parameterization_for_sd2(ctx)) {
515515
is_using_v_parameterization = true;
516516
}
@@ -519,21 +519,22 @@ class StableDiffusionGGML {
519519
is_using_v_parameterization = true;
520520
}
521521

522-
if (version == VERSION_SD3_2B) {
523-
LOG_INFO("running in FLOW mode");
524-
denoiser = std::make_shared<DiscreteFlowDenoiser>();
525-
} else if (version == VERSION_FLUX_DEV || version == VERSION_FLUX_SCHNELL) {
526-
LOG_INFO("running in Flux FLOW mode");
527-
float shift = 1.15f;
528-
if (version == VERSION_FLUX_SCHNELL) {
529-
shift = 1.0f; // TODO: validate
522+
if (version == VERSION_SD3_2B) {
523+
LOG_INFO("running in FLOW mode");
524+
denoiser = std::make_shared<DiscreteFlowDenoiser>();
525+
} else if (version == VERSION_FLUX_DEV || version == VERSION_FLUX_SCHNELL) {
526+
LOG_INFO("running in Flux FLOW mode");
527+
float shift = 1.15f;
528+
if (version == VERSION_FLUX_SCHNELL) {
529+
shift = 1.0f; // TODO: validate
530+
}
531+
denoiser = std::make_shared<FluxFlowDenoiser>(shift);
532+
} else if (is_using_v_parameterization) {
533+
LOG_INFO("running in v-prediction mode");
534+
denoiser = std::make_shared<CompVisVDenoiser>();
535+
} else {
536+
LOG_INFO("running in eps-prediction mode");
530537
}
531-
denoiser = std::make_shared<FluxFlowDenoiser>(shift);
532-
} else if (is_using_v_parameterization) {
533-
LOG_INFO("running in v-prediction mode");
534-
denoiser = std::make_shared<CompVisVDenoiser>();
535-
} else {
536-
LOG_INFO("running in eps-prediction mode");
537538
}
538539

539540
if (schedule != DEFAULT) {

0 commit comments

Comments
 (0)