diff --git a/ui/index.html b/ui/index.html index 0dab7b78..90b306a7 100644 --- a/ui/index.html +++ b/ui/index.html @@ -339,7 +339,7 @@ Click to learn more about samplers - Please avoid 'Euler Ancestral' with Flux! + Tip:This sampler does not work well with Flux! + Tip:This scheduler does not work well with Flux! + Tip:This scheduler needs 15 steps or more
diff --git a/ui/media/js/main.js b/ui/media/js/main.js index e5f58edd..e59a6ace 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -1932,13 +1932,52 @@ function checkFluxSampler() { samplerWarning.classList.add("displayNone") } } + +function checkFluxScheduler() { + const badSchedulers = ["automatic", "uniform", "turbo", "align_your_steps", "align_your_steps_GITS", "align_your_steps_11", "align_your_steps_32"] + + let schedulerWarning = document.querySelector("#fluxSchedulerWarning") + if (sdModelField.value.toLowerCase().includes("flux")) { + if (badSchedulers.includes(schedulerField.value)) { + schedulerWarning.classList.remove("displayNone") + } else { + schedulerWarning.classList.add("displayNone") + } + } else { + schedulerWarning.classList.add("displayNone") + } +} + +function checkFluxSchedulerSteps() { + const problematicSchedulers = ["karras", "exponential", "polyexponential"] + + let schedulerWarning = document.querySelector("#fluxSchedulerStepsWarning") + if (sdModelField.value.toLowerCase().includes("flux") && parseInt(numInferenceStepsField.value) < 15) { + if (problematicSchedulers.includes(schedulerField.value)) { + schedulerWarning.classList.remove("displayNone") + } else { + schedulerWarning.classList.add("displayNone") + } + } else { + schedulerWarning.classList.add("displayNone") + } +} sdModelField.addEventListener("change", checkFluxSampler) samplerField.addEventListener("change", checkFluxSampler) +sdModelField.addEventListener("change", checkFluxScheduler) +schedulerField.addEventListener("change", checkFluxScheduler) + +sdModelField.addEventListener("change", checkFluxSchedulerSteps) +schedulerField.addEventListener("change", checkFluxSchedulerSteps) +numInferenceStepsField.addEventListener("change", checkFluxSchedulerSteps) + document.addEventListener("refreshModels", function() { checkGuidanceValue() checkGuidanceScaleVisibility() checkFluxSampler() + checkFluxScheduler() + checkFluxSchedulerSteps() }) // function onControlImageFilterChange() {