daasd commited on
Commit
90a1b0b
·
1 Parent(s): 1b94529

Update PNG_info_web.js

Browse files
Files changed (1) hide show
  1. PNG_info_web.js +19 -2
PNG_info_web.js CHANGED
@@ -358,6 +358,7 @@
358
 
359
  const inputEvent = new Event('input');
360
  const changeEvent = new Event('change');
 
361
 
362
 
363
  shadowRoot.querySelector('#txt2img_tab').onclick=()=>{
@@ -401,9 +402,25 @@
401
 
402
  //高清修复
403
  shadowRoot.querySelector('#txt2img_enable_hr input').checked = !!result.Hiresupscaler
404
- shadowRoot.querySelectorAll('#txt2img_steps input')[1].dispatchEvent(changeEvent);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
405
 
406
- shadowRoot.querySelector('#txt2img_hr_upscaler .single-select').innerText = result.Hiresupscaler||'Latent'
 
407
 
408
  shadowRoot.querySelectorAll('#txt2img_hires_steps input')[0].value=Number(result.Hiressteps)||0
409
  shadowRoot.querySelectorAll('#txt2img_hires_steps input')[0].dispatchEvent(inputEvent);
 
358
 
359
  const inputEvent = new Event('input');
360
  const changeEvent = new Event('change');
361
+ const click = new Event('click');
362
 
363
 
364
  shadowRoot.querySelector('#txt2img_tab').onclick=()=>{
 
402
 
403
  //高清修复
404
  shadowRoot.querySelector('#txt2img_enable_hr input').checked = !!result.Hiresupscaler
405
+ shadowRoot.querySelector('#txt2img_enable_hr input').dispatchEvent(changeEvent)
406
+
407
+
408
+ if(!!result.Hiresupscaler){
409
+ const inputElement = document.querySelector("#txt2img_hr_upscaler > label > div > div.wrap-inner.svelte-a6vu2r > div > input");
410
+ const mousevent = new MouseEvent('mousedown', {
411
+ view: window,
412
+ bubbles: true,
413
+ cancelable: true
414
+ });
415
+ inputElement.dispatchEvent(mousevent);
416
+ setTimeout(() => {
417
+ console.log(`[data-value="${result.Hiresupscaler}"]`)
418
+ shadowRoot.querySelector(`[data-value="${result.Hiresupscaler}"]`).click()
419
+ }, 3000);
420
+ }
421
 
422
+ // shadowRoot.querySelector('#txt2img_hr_upscaler .single-select').innerText = result.Hiresupscaler||'None'
423
+ // shadowRoot.querySelector('#txt2img_hr_upscaler .single-select').dispatchEvent(changeEvent)
424
 
425
  shadowRoot.querySelectorAll('#txt2img_hires_steps input')[0].value=Number(result.Hiressteps)||0
426
  shadowRoot.querySelectorAll('#txt2img_hires_steps input')[0].dispatchEvent(inputEvent);