Update PNG_info_web.js
Browse files- PNG_info_web.js +86 -30
PNG_info_web.js
CHANGED
|
@@ -380,6 +380,23 @@ let imgStorage=(img)=>{
|
|
| 380 |
});
|
| 381 |
};
|
| 382 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
let delay_tab_click = function () {
|
| 384 |
return new Promise((resolve) => {
|
| 385 |
//用来判断点击事件进行resolve,因为初始化优先级没那么高,所以不用担心初始化的时候执行
|
|
@@ -415,7 +432,7 @@ let imgStorage=(img)=>{
|
|
| 415 |
console.log('点击类读取')
|
| 416 |
resolve(this.shadowRoot.querySelector("#img2maskimg > div.svelte-rlgzoo.fixed-height > div > div:nth-child(2)"));
|
| 417 |
}
|
| 418 |
-
|
| 419 |
this.shadowRoot = document.querySelector("gradio-app");
|
| 420 |
const observer = new MutationObserver((mutations) => {
|
| 421 |
mutations.forEach((mutation) => {
|
|
@@ -433,6 +450,8 @@ let imgStorage=(img)=>{
|
|
| 433 |
observer.observe(this.shadowRoot, { childList: true, subtree: true });
|
| 434 |
});
|
| 435 |
};
|
|
|
|
|
|
|
| 436 |
let txt2ImgFormFill = () => {
|
| 437 |
shadowRoot=this.shadowRoot
|
| 438 |
let result = this.result;
|
|
@@ -585,6 +604,7 @@ let imgStorage=(img)=>{
|
|
| 585 |
.dispatchEvent(inputEvent);
|
| 586 |
};
|
| 587 |
|
|
|
|
| 588 |
let img2ImgFormFill = () => {
|
| 589 |
let result = this.result;
|
| 590 |
const inputEvent = new Event("input");
|
|
@@ -596,37 +616,37 @@ let imgStorage=(img)=>{
|
|
| 596 |
|
| 597 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[0].value = Number(result.Clipskip)
|
| 598 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[0].dispatchEvent(inputEvent);
|
| 599 |
-
|
| 600 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[1].value = Number(result.Clipskip)
|
| 601 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[1].dispatchEvent(inputEvent);
|
| 602 |
-
|
| 603 |
this.shadowRoot.querySelector('#img2img_prompt textarea').value = result.prompt
|
| 604 |
this.shadowRoot.querySelector('#img2img_prompt textarea').dispatchEvent(inputEvent);
|
| 605 |
-
|
| 606 |
this.shadowRoot.querySelector('#img2img_neg_prompt textarea').value = result.negativePrompt
|
| 607 |
this.shadowRoot.querySelector('#img2img_neg_prompt textarea').dispatchEvent(inputEvent);
|
| 608 |
-
|
| 609 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[0].value = Number(result.Steps)
|
| 610 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[0].dispatchEvent(inputEvent);
|
| 611 |
-
|
| 612 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[1].value = Number(result.Steps)
|
| 613 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[1].dispatchEvent(inputEvent);
|
| 614 |
-
|
| 615 |
this.shadowRoot.querySelectorAll(`[value="${result.Sampler}"]`)[1].checked = true;
|
| 616 |
this.shadowRoot.querySelectorAll(`[value="${result.Sampler}"]`)[1].dispatchEvent(changeEvent)
|
| 617 |
-
|
| 618 |
this.shadowRoot.querySelectorAll('#img2img_width input')[0].value = Number(result.Size.split('x')[0])
|
| 619 |
this.shadowRoot.querySelectorAll('#img2img_width input')[0].dispatchEvent(inputEvent);
|
| 620 |
-
|
| 621 |
this.shadowRoot.querySelectorAll('#img2img_width input')[1].value = Number(result.Size.split('x')[0])
|
| 622 |
this.shadowRoot.querySelectorAll('#img2img_width input')[1].dispatchEvent(inputEvent);
|
| 623 |
-
|
| 624 |
this.shadowRoot.querySelectorAll('#img2img_height input')[0].value = Number(result.Size.split('x')[1])
|
| 625 |
this.shadowRoot.querySelectorAll('#img2img_height input')[0].dispatchEvent(inputEvent);
|
| 626 |
-
|
| 627 |
this.shadowRoot.querySelectorAll('#img2img_height input')[1].value = Number(result.Size.split('x')[1])
|
| 628 |
this.shadowRoot.querySelectorAll('#img2img_height input')[1].dispatchEvent(inputEvent);
|
| 629 |
-
|
| 630 |
this.shadowRoot.querySelector('#img2img_seed input').value = Number(result.Seed)
|
| 631 |
this.shadowRoot.querySelector('#img2img_seed input').dispatchEvent(inputEvent);
|
| 632 |
//图生图调用pnginfo的png
|
|
@@ -634,10 +654,12 @@ let imgStorage=(img)=>{
|
|
| 634 |
const dataTransfer = new DataTransfer();
|
| 635 |
dataTransfer.items.add(file);
|
| 636 |
const fileList = dataTransfer.files;
|
|
|
|
| 637 |
this.shadowRoot.querySelector("#img2img_image input").files = fileList;
|
| 638 |
this.shadowRoot.querySelector('#img2img_image input').dispatchEvent(changeEvent);
|
| 639 |
};
|
| 640 |
|
|
|
|
| 641 |
let inpaintTabFormFill=async ()=> {
|
| 642 |
let result = this.result;
|
| 643 |
const inputEvent = new Event("input");
|
|
@@ -660,37 +682,37 @@ let imgStorage=(img)=>{
|
|
| 660 |
this.shadowRoot.querySelectorAll('#mode_img2img button')[2].click()
|
| 661 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[0].value = Number(result.Clipskip)
|
| 662 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[0].dispatchEvent(inputEvent);
|
| 663 |
-
|
| 664 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[1].value = Number(result.Clipskip)
|
| 665 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[1].dispatchEvent(inputEvent);
|
| 666 |
-
|
| 667 |
this.shadowRoot.querySelector('#img2img_prompt textarea').value = result.prompt
|
| 668 |
this.shadowRoot.querySelector('#img2img_prompt textarea').dispatchEvent(inputEvent);
|
| 669 |
-
|
| 670 |
this.shadowRoot.querySelector('#img2img_neg_prompt textarea').value = result.negativePrompt
|
| 671 |
this.shadowRoot.querySelector('#img2img_neg_prompt textarea').dispatchEvent(inputEvent);
|
| 672 |
-
|
| 673 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[0].value = Number(result.Steps)
|
| 674 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[0].dispatchEvent(inputEvent);
|
| 675 |
-
|
| 676 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[1].value = Number(result.Steps)
|
| 677 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[1].dispatchEvent(inputEvent);
|
| 678 |
-
|
| 679 |
this.shadowRoot.querySelectorAll(`[value="${result.Sampler}"]`)[1].checked = true;
|
| 680 |
this.shadowRoot.querySelectorAll(`[value="${result.Sampler}"]`)[1].dispatchEvent(changeEvent)
|
| 681 |
-
|
| 682 |
this.shadowRoot.querySelectorAll('#img2img_width input')[0].value = Number(result.Size.split('x')[0])
|
| 683 |
this.shadowRoot.querySelectorAll('#img2img_width input')[0].dispatchEvent(inputEvent);
|
| 684 |
-
|
| 685 |
this.shadowRoot.querySelectorAll('#img2img_width input')[1].value = Number(result.Size.split('x')[0])
|
| 686 |
this.shadowRoot.querySelectorAll('#img2img_width input')[1].dispatchEvent(inputEvent);
|
| 687 |
-
|
| 688 |
this.shadowRoot.querySelectorAll('#img2img_height input')[0].value = Number(result.Size.split('x')[1])
|
| 689 |
this.shadowRoot.querySelectorAll('#img2img_height input')[0].dispatchEvent(inputEvent);
|
| 690 |
-
|
| 691 |
this.shadowRoot.querySelectorAll('#img2img_height input')[1].value = Number(result.Size.split('x')[1])
|
| 692 |
this.shadowRoot.querySelectorAll('#img2img_height input')[1].dispatchEvent(inputEvent);
|
| 693 |
-
|
| 694 |
this.shadowRoot.querySelector('#img2img_seed input').value = Number(result.Seed)
|
| 695 |
this.shadowRoot.querySelector('#img2img_seed input').dispatchEvent(inputEvent);
|
| 696 |
//图生图调用pnginfo的png
|
|
@@ -703,6 +725,28 @@ let imgStorage=(img)=>{
|
|
| 703 |
};
|
| 704 |
|
| 705 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 706 |
//PNGinfo事件
|
| 707 |
async function png_info_edit() {
|
| 708 |
let png_info = await delayPng_info();
|
|
@@ -729,10 +773,21 @@ let imgStorage=(img)=>{
|
|
| 729 |
let png_info_blob = await convertDomImageToBlob(png_info_img);
|
| 730 |
this.png_info_blob = png_info_blob;
|
| 731 |
let res = await readNovelAITag(png_info_blob);
|
| 732 |
-
|
| 733 |
-
"#tab_pnginfo > div > div > div:nth-child(2) > div:nth-child(3)"
|
| 734 |
-
|
| 735 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 736 |
//js对象形式转化
|
| 737 |
const result = {};
|
| 738 |
// const match = inputString.match(/(?<=prompt:)(.*)(?=Negative prompt:)/s)[0].trim();]
|
|
@@ -778,14 +833,15 @@ let imgStorage=(img)=>{
|
|
| 778 |
png_info.dispatchEvent(changeEvent)
|
| 779 |
})
|
| 780 |
}
|
|
|
|
| 781 |
document.addEventListener("DOMContentLoaded", async () => {
|
| 782 |
//初始化图生图图片
|
| 783 |
if(localStorage.getItem("png_info_img"))
|
| 784 |
this.png_info_blob = await readStoragePng(
|
| 785 |
localStorage.getItem("png_info_img")
|
| 786 |
);
|
| 787 |
-
|
| 788 |
png_info_edit();
|
| 789 |
-
|
| 790 |
});
|
| 791 |
-
})()
|
|
|
|
| 380 |
});
|
| 381 |
};
|
| 382 |
|
| 383 |
+
let delay_png_downloaded = function (downloadNode) {
|
| 384 |
+
return new Promise((resolve) => {
|
| 385 |
+
const observer = new MutationObserver((mutations) => {
|
| 386 |
+
mutations.forEach((mutation) => {
|
| 387 |
+
if (
|
| 388 |
+
downloadNode.querySelector("#txt2img_gallery > div.grid-wrap > div")
|
| 389 |
+
) {
|
| 390 |
+
// 取消监听
|
| 391 |
+
observer.disconnect();
|
| 392 |
+
resolve(document.querySelector("#txt2img_gallery > div.grid-wrap > div >button >img"));
|
| 393 |
+
}
|
| 394 |
+
});
|
| 395 |
+
});
|
| 396 |
+
observer.observe(downloadNode, { childList: true, subtree: true });
|
| 397 |
+
});
|
| 398 |
+
};
|
| 399 |
+
|
| 400 |
let delay_tab_click = function () {
|
| 401 |
return new Promise((resolve) => {
|
| 402 |
//用来判断点击事件进行resolve,因为初始化优先级没那么高,所以不用担心初始化的时候执行
|
|
|
|
| 432 |
console.log('点击类读取')
|
| 433 |
resolve(this.shadowRoot.querySelector("#img2maskimg > div.svelte-rlgzoo.fixed-height > div > div:nth-child(2)"));
|
| 434 |
}
|
| 435 |
+
|
| 436 |
this.shadowRoot = document.querySelector("gradio-app");
|
| 437 |
const observer = new MutationObserver((mutations) => {
|
| 438 |
mutations.forEach((mutation) => {
|
|
|
|
| 450 |
observer.observe(this.shadowRoot, { childList: true, subtree: true });
|
| 451 |
});
|
| 452 |
};
|
| 453 |
+
|
| 454 |
+
//文生图
|
| 455 |
let txt2ImgFormFill = () => {
|
| 456 |
shadowRoot=this.shadowRoot
|
| 457 |
let result = this.result;
|
|
|
|
| 604 |
.dispatchEvent(inputEvent);
|
| 605 |
};
|
| 606 |
|
| 607 |
+
//图生图
|
| 608 |
let img2ImgFormFill = () => {
|
| 609 |
let result = this.result;
|
| 610 |
const inputEvent = new Event("input");
|
|
|
|
| 616 |
|
| 617 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[0].value = Number(result.Clipskip)
|
| 618 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[0].dispatchEvent(inputEvent);
|
| 619 |
+
|
| 620 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[1].value = Number(result.Clipskip)
|
| 621 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[1].dispatchEvent(inputEvent);
|
| 622 |
+
|
| 623 |
this.shadowRoot.querySelector('#img2img_prompt textarea').value = result.prompt
|
| 624 |
this.shadowRoot.querySelector('#img2img_prompt textarea').dispatchEvent(inputEvent);
|
| 625 |
+
|
| 626 |
this.shadowRoot.querySelector('#img2img_neg_prompt textarea').value = result.negativePrompt
|
| 627 |
this.shadowRoot.querySelector('#img2img_neg_prompt textarea').dispatchEvent(inputEvent);
|
| 628 |
+
|
| 629 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[0].value = Number(result.Steps)
|
| 630 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[0].dispatchEvent(inputEvent);
|
| 631 |
+
|
| 632 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[1].value = Number(result.Steps)
|
| 633 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[1].dispatchEvent(inputEvent);
|
| 634 |
+
|
| 635 |
this.shadowRoot.querySelectorAll(`[value="${result.Sampler}"]`)[1].checked = true;
|
| 636 |
this.shadowRoot.querySelectorAll(`[value="${result.Sampler}"]`)[1].dispatchEvent(changeEvent)
|
| 637 |
+
|
| 638 |
this.shadowRoot.querySelectorAll('#img2img_width input')[0].value = Number(result.Size.split('x')[0])
|
| 639 |
this.shadowRoot.querySelectorAll('#img2img_width input')[0].dispatchEvent(inputEvent);
|
| 640 |
+
|
| 641 |
this.shadowRoot.querySelectorAll('#img2img_width input')[1].value = Number(result.Size.split('x')[0])
|
| 642 |
this.shadowRoot.querySelectorAll('#img2img_width input')[1].dispatchEvent(inputEvent);
|
| 643 |
+
|
| 644 |
this.shadowRoot.querySelectorAll('#img2img_height input')[0].value = Number(result.Size.split('x')[1])
|
| 645 |
this.shadowRoot.querySelectorAll('#img2img_height input')[0].dispatchEvent(inputEvent);
|
| 646 |
+
|
| 647 |
this.shadowRoot.querySelectorAll('#img2img_height input')[1].value = Number(result.Size.split('x')[1])
|
| 648 |
this.shadowRoot.querySelectorAll('#img2img_height input')[1].dispatchEvent(inputEvent);
|
| 649 |
+
|
| 650 |
this.shadowRoot.querySelector('#img2img_seed input').value = Number(result.Seed)
|
| 651 |
this.shadowRoot.querySelector('#img2img_seed input').dispatchEvent(inputEvent);
|
| 652 |
//图生图调用pnginfo的png
|
|
|
|
| 654 |
const dataTransfer = new DataTransfer();
|
| 655 |
dataTransfer.items.add(file);
|
| 656 |
const fileList = dataTransfer.files;
|
| 657 |
+
console.log([this.shadowRoot.querySelector("#img2img_image input")])
|
| 658 |
this.shadowRoot.querySelector("#img2img_image input").files = fileList;
|
| 659 |
this.shadowRoot.querySelector('#img2img_image input').dispatchEvent(changeEvent);
|
| 660 |
};
|
| 661 |
|
| 662 |
+
//局部重绘
|
| 663 |
let inpaintTabFormFill=async ()=> {
|
| 664 |
let result = this.result;
|
| 665 |
const inputEvent = new Event("input");
|
|
|
|
| 682 |
this.shadowRoot.querySelectorAll('#mode_img2img button')[2].click()
|
| 683 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[0].value = Number(result.Clipskip)
|
| 684 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[0].dispatchEvent(inputEvent);
|
| 685 |
+
|
| 686 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[1].value = Number(result.Clipskip)
|
| 687 |
this.shadowRoot.querySelectorAll('#setting_CLIP_stop_at_last_layers input')[1].dispatchEvent(inputEvent);
|
| 688 |
+
|
| 689 |
this.shadowRoot.querySelector('#img2img_prompt textarea').value = result.prompt
|
| 690 |
this.shadowRoot.querySelector('#img2img_prompt textarea').dispatchEvent(inputEvent);
|
| 691 |
+
|
| 692 |
this.shadowRoot.querySelector('#img2img_neg_prompt textarea').value = result.negativePrompt
|
| 693 |
this.shadowRoot.querySelector('#img2img_neg_prompt textarea').dispatchEvent(inputEvent);
|
| 694 |
+
|
| 695 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[0].value = Number(result.Steps)
|
| 696 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[0].dispatchEvent(inputEvent);
|
| 697 |
+
|
| 698 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[1].value = Number(result.Steps)
|
| 699 |
this.shadowRoot.querySelectorAll('#img2img_steps input')[1].dispatchEvent(inputEvent);
|
| 700 |
+
|
| 701 |
this.shadowRoot.querySelectorAll(`[value="${result.Sampler}"]`)[1].checked = true;
|
| 702 |
this.shadowRoot.querySelectorAll(`[value="${result.Sampler}"]`)[1].dispatchEvent(changeEvent)
|
| 703 |
+
|
| 704 |
this.shadowRoot.querySelectorAll('#img2img_width input')[0].value = Number(result.Size.split('x')[0])
|
| 705 |
this.shadowRoot.querySelectorAll('#img2img_width input')[0].dispatchEvent(inputEvent);
|
| 706 |
+
|
| 707 |
this.shadowRoot.querySelectorAll('#img2img_width input')[1].value = Number(result.Size.split('x')[0])
|
| 708 |
this.shadowRoot.querySelectorAll('#img2img_width input')[1].dispatchEvent(inputEvent);
|
| 709 |
+
|
| 710 |
this.shadowRoot.querySelectorAll('#img2img_height input')[0].value = Number(result.Size.split('x')[1])
|
| 711 |
this.shadowRoot.querySelectorAll('#img2img_height input')[0].dispatchEvent(inputEvent);
|
| 712 |
+
|
| 713 |
this.shadowRoot.querySelectorAll('#img2img_height input')[1].value = Number(result.Size.split('x')[1])
|
| 714 |
this.shadowRoot.querySelectorAll('#img2img_height input')[1].dispatchEvent(inputEvent);
|
| 715 |
+
|
| 716 |
this.shadowRoot.querySelector('#img2img_seed input').value = Number(result.Seed)
|
| 717 |
this.shadowRoot.querySelector('#img2img_seed input').dispatchEvent(inputEvent);
|
| 718 |
//图生图调用pnginfo的png
|
|
|
|
| 725 |
};
|
| 726 |
|
| 727 |
|
| 728 |
+
let TaggerFormFill=()=>{
|
| 729 |
+
let result = this.result;
|
| 730 |
+
const inputEvent = new Event("input");
|
| 731 |
+
const changeEvent = new Event("change", {
|
| 732 |
+
bubbles: true,
|
| 733 |
+
});
|
| 734 |
+
let taggerNode=null
|
| 735 |
+
let menu=[...document.querySelector('[class="tab-nav scroll-hide svelte-1g805jl"]').children]
|
| 736 |
+
menu.forEach(e=>{try{if(e.innerText=="Tag反推(Tagger)")taggerNode=e;throw error()}catch(err){}})
|
| 737 |
+
console.log(taggerNode)
|
| 738 |
+
taggerNode.click()
|
| 739 |
+
|
| 740 |
+
// //图生图调用pnginfo的png
|
| 741 |
+
const file = new File([this.png_info_blob], 'example.png');
|
| 742 |
+
const dataTransfer = new DataTransfer();
|
| 743 |
+
dataTransfer.items.add(file);
|
| 744 |
+
const fileList = dataTransfer.files;
|
| 745 |
+
console.log([this.shadowRoot.querySelector(" div.image-container > div > input")])
|
| 746 |
+
this.shadowRoot.querySelector(" div.image-container > div > input").files = fileList;
|
| 747 |
+
this.shadowRoot.querySelector(" div.image-container > div > input").dispatchEvent(changeEvent);
|
| 748 |
+
}
|
| 749 |
+
|
| 750 |
//PNGinfo事件
|
| 751 |
async function png_info_edit() {
|
| 752 |
let png_info = await delayPng_info();
|
|
|
|
| 773 |
let png_info_blob = await convertDomImageToBlob(png_info_img);
|
| 774 |
this.png_info_blob = png_info_blob;
|
| 775 |
let res = await readNovelAITag(png_info_blob);
|
| 776 |
+
if(!res.length){
|
| 777 |
+
this.shadowRoot.querySelector("#tab_pnginfo > div > div > div:nth-child(2) > div:nth-child(3)").innerText ="这不是一张stablediffusion图片"
|
| 778 |
+
this.shadowRoot.querySelector("#tagger图生文_tab").style.color='red'
|
| 779 |
+
//tag反推(tagger)
|
| 780 |
+
this.shadowRoot.querySelector("#tagger图生文_tab").onclick =
|
| 781 |
+
() => {
|
| 782 |
+
this.result.fillType = "inpaint_tab";
|
| 783 |
+
localStorage.setItem("tempPngInfo", JSON.stringify(this.result));
|
| 784 |
+
TaggerFormFill();
|
| 785 |
+
};
|
| 786 |
+
}
|
| 787 |
+
else{
|
| 788 |
+
this.shadowRoot.querySelector("#tagger图生文_tab").style.color=''
|
| 789 |
+
this.shadowRoot.querySelector("#tab_pnginfo > div > div > div:nth-child(2) > div:nth-child(3)").innerText = res[0].text
|
| 790 |
+
}
|
| 791 |
//js对象形式转化
|
| 792 |
const result = {};
|
| 793 |
// const match = inputString.match(/(?<=prompt:)(.*)(?=Negative prompt:)/s)[0].trim();]
|
|
|
|
| 833 |
png_info.dispatchEvent(changeEvent)
|
| 834 |
})
|
| 835 |
}
|
| 836 |
+
|
| 837 |
document.addEventListener("DOMContentLoaded", async () => {
|
| 838 |
//初始化图生图图片
|
| 839 |
if(localStorage.getItem("png_info_img"))
|
| 840 |
this.png_info_blob = await readStoragePng(
|
| 841 |
localStorage.getItem("png_info_img")
|
| 842 |
);
|
| 843 |
+
//初始化png_info事件
|
| 844 |
png_info_edit();
|
| 845 |
+
//test
|
| 846 |
});
|
| 847 |
+
})()
|