File size: 862 Bytes
d42bffd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
});