Show the negative embeddings button only if the negative prompt panel is open

This commit is contained in:
cmdr2 2023-08-22 16:59:40 +05:30
parent e607035c65
commit 1cd9c7fdac
2 changed files with 12 additions and 1 deletions

View File

@ -2517,6 +2517,17 @@ window.addEventListener("beforeunload", function(e) {
}
})
document.addEventListener("collapsibleClick", function(e) {
let header = e.detail
if (header === document.querySelector("#negative_prompt_handle")) {
if (header.classList.contains("active")) {
negativeEmbeddingsButton.classList.remove("displayNone")
} else {
negativeEmbeddingsButton.classList.add("displayNone")
}
}
})
createCollapsibles()
prettifyInputs(document)

View File

@ -487,6 +487,7 @@ async function getAppConfig() {
document.querySelector("#controlnet_model_container").style.display = "none"
document.querySelector("#hypernetwork_model_container").style.display = ""
document.querySelector("#hypernetwork_strength_container").style.display = ""
document.querySelector("#negative-embeddings-button").style.display = "none"
document.querySelectorAll("#sampler_name option.diffusers-only").forEach((option) => {
option.style.display = "none"
@ -506,7 +507,6 @@ async function getAppConfig() {
})
document.querySelector("#clip_skip_config").classList.remove("displayNone")
document.querySelector("#embeddings-button").classList.remove("displayNone")
document.querySelector("#negative-embeddings-button").classList.remove("displayNone")
IMAGE_STEP_SIZE = 8
customWidthField.step = IMAGE_STEP_SIZE
customHeightField.step = IMAGE_STEP_SIZE