lsLoad = false; | |
onUiUpdate(function () { | |
if (lsLoad) return; | |
if (!opts) return; | |
if (!opts["encrypt_image_is_enable"]) return; | |
lsLoad = true; | |
let enable = opts["encrypt_image_is_enable"] == "是"; | |
function renderInfo(txtOrImg2img, isEnable) { | |
let info = document.getElementById("encrypt_image_" + txtOrImg2img + "2img_info"); | |
let top = document.getElementById(txtOrImg2img + "2img_neg_prompt"); | |
if (!top) return; | |
if (!info) { | |
let parent = top.parentNode; | |
info = document.createElement("div"); | |
info.style.minWidth = "100%"; | |
info.style.textAlign = "center"; | |
info.style.opacity = 0.5; | |
info.style.fontSize = ".89em"; | |
info.id = "encrypt_image_" + txtOrImg2img + "2img_info"; | |
parent.insertBefore(info, top.nextSibling); | |
} | |
} | |
renderInfo("txt", enable); | |
renderInfo("img", enable); | |
}); |