daasd commited on
Commit
4fac6db
·
verified ·
1 Parent(s): c8894a9

Update PNG_info_web.js

Browse files
Files changed (1) hide show
  1. PNG_info_web.js +62 -58
PNG_info_web.js CHANGED
@@ -461,6 +461,9 @@ let imgStorage=(img)=>{
461
  bubbles: true,
462
  });
463
  shadowRoot.querySelector("#tabs .tab-nav").children[0].click();
 
 
 
464
  if(!!result.Clipskip){
465
  shadowRoot.querySelectorAll(
466
  "#setting_CLIP_stop_at_last_layers input"
@@ -556,14 +559,15 @@ let imgStorage=(img)=>{
556
  shadowRoot.querySelector("#txt2img_enable_hr input").checked =true
557
  shadowRoot.querySelector("#txt2img_enable_hr input").dispatchEvent(changeEvent);
558
  }
559
- }else{
560
- if (!!result.Hiresupscaler) {
561
- shadowRoot.querySelector("#txt2img_hr > div:nth-child(3)").style.display ="block"
562
- }
563
- else{
564
- shadowRoot.querySelector("#txt2img_hr > div:nth-child(3)").style.display ="none"
565
- }
566
  }
 
 
 
 
 
 
 
 
567
  //高清
568
  //hr放大器
569
  const hr_upscaler_element = document.querySelector(
@@ -617,57 +621,57 @@ let imgStorage=(img)=>{
617
  });
618
  }
619
 
620
-
621
-
622
- shadowRoot.querySelectorAll("#txt2img_hires_steps input")[0].value =
623
- Number(result.Hiressteps) || 0;
624
- shadowRoot
625
- .querySelectorAll("#txt2img_hires_steps input")[0]
626
- .dispatchEvent(inputEvent);
627
-
628
- shadowRoot.querySelectorAll("#txt2img_hires_steps input")[1].value =
629
- Number(result.Hiressteps) || 0;
630
- shadowRoot
631
- .querySelectorAll("#txt2img_hires_steps input")[1]
632
- .dispatchEvent(inputEvent);
633
-
634
- shadowRoot.querySelectorAll("#txt2img_denoising_strength input")[0].value =
635
- Number(result.Denoisingstrength) || 0;
636
- shadowRoot
637
- .querySelectorAll("#txt2img_denoising_strength input")[0]
638
- .dispatchEvent(inputEvent);
639
-
640
- shadowRoot.querySelectorAll("#txt2img_denoising_strength input")[1].value =
641
- Number(result.Denoisingstrength) || 0;
642
- shadowRoot
643
- .querySelectorAll("#txt2img_denoising_strength input")[1]
644
- .dispatchEvent(inputEvent);
645
-
646
- shadowRoot.querySelectorAll("#txt2img_hr_scale input")[0].value =
647
- Number(result.Hiresupscale) || 1;
648
- shadowRoot
649
- .querySelectorAll("#txt2img_hr_scale input")[0]
650
- .dispatchEvent(inputEvent);
651
-
652
- shadowRoot.querySelectorAll("#txt2img_hr_scale input")[1].value =
653
- Number(result.Hiresupscale) || 1;
654
- shadowRoot
655
- .querySelectorAll("#txt2img_hr_scale input")[1]
656
- .dispatchEvent(inputEvent);
657
- //用户是否开启了高清prompt
658
- if(!!shadowRoot.querySelector("#hires_prompt > label > textarea")){
659
- shadowRoot.querySelector("#hires_prompt > label > textarea").value =
660
- result.HiresPrompt;
661
- shadowRoot
662
- .querySelector("#hires_prompt > label > textarea")
663
- .dispatchEvent(inputEvent);
664
- }
665
- if(!!shadowRoot.querySelector("#hires_neg_prompt > label > textarea")){
666
- shadowRoot.querySelector("#hires_neg_prompt > label > textarea").value =
667
- result.HiresNegativePrompt;
668
- shadowRoot
669
- .querySelector("#hires_neg_prompt > label > textarea")
670
- .dispatchEvent(inputEvent);
671
  }
672
  };
673
 
 
461
  bubbles: true,
462
  });
463
  shadowRoot.querySelector("#tabs .tab-nav").children[0].click();
464
+ if(!!this.version_more_16 && !!result.Hiresupscaler && !shadowRoot.querySelector("#txt2img_hr > div.label-wrap.open")){
465
+ shadowRoot.querySelector("#txt2img_hr > div.label-wrap").click();
466
+ }
467
  if(!!result.Clipskip){
468
  shadowRoot.querySelectorAll(
469
  "#setting_CLIP_stop_at_last_layers input"
 
559
  shadowRoot.querySelector("#txt2img_enable_hr input").checked =true
560
  shadowRoot.querySelector("#txt2img_enable_hr input").dispatchEvent(changeEvent);
561
  }
 
 
 
 
 
 
 
562
  }
563
+ // else{
564
+ // if (!!result.Hiresupscaler) {
565
+ // shadowRoot.querySelector("#txt2img_hr > div:nth-child(3)").style.display ="block"
566
+ // }
567
+ // else{
568
+ // shadowRoot.querySelector("#txt2img_hr > div:nth-child(3)").style.display ="none"
569
+ // }
570
+ // }
571
  //高清
572
  //hr放大器
573
  const hr_upscaler_element = document.querySelector(
 
621
  });
622
  }
623
 
624
+ if (!!result.Hiresupscaler) {
625
+ shadowRoot.querySelectorAll("#txt2img_hires_steps input")[0].value =
626
+ Number(result.Hiressteps) || 0;
627
+ shadowRoot
628
+ .querySelectorAll("#txt2img_hires_steps input")[0]
629
+ .dispatchEvent(inputEvent);
630
+
631
+ shadowRoot.querySelectorAll("#txt2img_hires_steps input")[1].value =
632
+ Number(result.Hiressteps) || 0;
633
+ shadowRoot
634
+ .querySelectorAll("#txt2img_hires_steps input")[1]
635
+ .dispatchEvent(inputEvent);
636
+
637
+ shadowRoot.querySelectorAll("#txt2img_denoising_strength input")[0].value =
638
+ Number(result.Denoisingstrength) || 0;
639
+ shadowRoot
640
+ .querySelectorAll("#txt2img_denoising_strength input")[0]
641
+ .dispatchEvent(inputEvent);
642
+
643
+ shadowRoot.querySelectorAll("#txt2img_denoising_strength input")[1].value =
644
+ Number(result.Denoisingstrength) || 0;
645
+ shadowRoot
646
+ .querySelectorAll("#txt2img_denoising_strength input")[1]
647
+ .dispatchEvent(inputEvent);
648
+
649
+ shadowRoot.querySelectorAll("#txt2img_hr_scale input")[0].value =
650
+ Number(result.Hiresupscale) || 1;
651
+ shadowRoot
652
+ .querySelectorAll("#txt2img_hr_scale input")[0]
653
+ .dispatchEvent(inputEvent);
654
+
655
+ shadowRoot.querySelectorAll("#txt2img_hr_scale input")[1].value =
656
+ Number(result.Hiresupscale) || 1;
657
+ shadowRoot
658
+ .querySelectorAll("#txt2img_hr_scale input")[1]
659
+ .dispatchEvent(inputEvent);
660
+ //用户是否开启了高清prompt
661
+ if(!!shadowRoot.querySelector("#hires_prompt > label > textarea")){
662
+ shadowRoot.querySelector("#hires_prompt > label > textarea").value =
663
+ result.HiresPrompt;
664
+ shadowRoot
665
+ .querySelector("#hires_prompt > label > textarea")
666
+ .dispatchEvent(inputEvent);
667
+ }
668
+ if(!!shadowRoot.querySelector("#hires_neg_prompt > label > textarea")){
669
+ shadowRoot.querySelector("#hires_neg_prompt > label > textarea").value =
670
+ result.HiresNegativePrompt;
671
+ shadowRoot
672
+ .querySelector("#hires_neg_prompt > label > textarea")
673
+ .dispatchEvent(inputEvent);
674
+ }
675
  }
676
  };
677