From f115abec92782737b37cd59b51d26f7189cce866 Mon Sep 17 00:00:00 2001 From: shadowcz007 Date: Thu, 4 Jan 2024 11:01:08 +0800 Subject: [PATCH 01/11] add clip interrogator --- __init__.py | 2 + nodes/ClipInterrogator.py | 154 ++++++++++++++++++++++++++++++++++++++ requirements.txt | 3 +- 3 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 nodes/ClipInterrogator.py diff --git a/__init__.py b/__init__.py index 9957e5b..eac42d4 100644 --- a/__init__.py +++ b/__init__.py @@ -512,6 +512,7 @@ from .nodes.ChatGPT import ChatGPTNode,ShowTextForGPT,CharacterInText from .nodes.Audio import GamePal,SpeechRecognition,SpeechSynthesis from .nodes.Utils import AppInfo,IntNumber,FloatSlider,TextInput,ColorInput,FontInput,TextToNumber,DynamicDelayProcessor,LimitNumber,SwitchByIndex,GetImageSize_,MultiplicationNode from .nodes.Lama import LaMaInpainting +from .nodes.ClipInterrogator import ClipInterrogator # 要导出的所有节点及其名称的字典 # 注意:名称应全局唯一 @@ -519,6 +520,7 @@ NODE_CLASS_MAPPINGS = { "AppInfo":AppInfo, "RandomPrompt":RandomPrompt, "PromptSlide":PromptSlide, + "ClipInterrogator":ClipInterrogator, "NoiseImage":NoiseImage, "GradientImage":GradientImage, "TransparentImage":TransparentImage, diff --git a/nodes/ClipInterrogator.py b/nodes/ClipInterrogator.py new file mode 100644 index 0000000..c055053 --- /dev/null +++ b/nodes/ClipInterrogator.py @@ -0,0 +1,154 @@ +import os +import folder_paths + +from PIL import Image + +import numpy as np +import json +import torch + +from transformers import AutoProcessor, BlipForConditionalGeneration + +from clip_interrogator import Config, Interrogator + +def load_caption_model(model_path,config,t='blip-base'): + dtype=torch.float16 if config.device == 'cuda' else torch.float32 + caption_model = BlipForConditionalGeneration.from_pretrained(model_path, torch_dtype=dtype) + + caption_processor = AutoProcessor.from_pretrained(model_path) + + caption_model.eval() + if not config.caption_offload: + caption_model = caption_model.to(config.device) + + return (caption_model,caption_processor) + + + +caption_model_path=os.path.join(folder_paths.models_dir, "clip_interrogator/Salesforce/blip-image-captioning-base") +if not os.path.exists(caption_model_path): + print(f"## clip_interrogator_model not found: {caption_model_path}, pls download from https://huggingface.co/Salesforce/blip-image-captioning-base") + +cache_path=os.path.join(folder_paths.models_dir, "clip_interrogator") + + + +# Tensor to PIL +def tensor2pil(image): + return Image.fromarray(np.clip(255. * image.cpu().numpy().squeeze(), 0, 255).astype(np.uint8)) + +# Convert PIL to Tensor +def pil2tensor(image): + return torch.from_numpy(np.array(image).astype(np.float32) / 255.0).unsqueeze(0) + + +def image_analysis(ci,image): + image = image.convert('RGB') + image_features = ci.image_to_features(image) + + top_mediums = ci.mediums.rank(image_features, 5) + top_artists = ci.artists.rank(image_features, 5) + top_movements = ci.movements.rank(image_features, 5) + top_trendings = ci.trendings.rank(image_features, 5) + top_flavors = ci.flavors.rank(image_features, 5) + + medium_ranks = {medium: sim for medium, sim in zip(top_mediums, ci.similarities(image_features, top_mediums))} + artist_ranks = {artist: sim for artist, sim in zip(top_artists, ci.similarities(image_features, top_artists))} + movement_ranks = {movement: sim for movement, sim in zip(top_movements, ci.similarities(image_features, top_movements))} + trending_ranks = {trending: sim for trending, sim in zip(top_trendings, ci.similarities(image_features, top_trendings))} + flavor_ranks = {flavor: sim for flavor, sim in zip(top_flavors, ci.similarities(image_features, top_flavors))} + + return medium_ranks, artist_ranks, movement_ranks, trending_ranks, flavor_ranks + +def image_to_prompt(ci,image, mode): + ci.config.chunk_size = 2048 if ci.config.clip_model_name == "ViT-L-14/openai" else 1024 + ci.config.flavor_intermediate_count = 2048 if ci.config.clip_model_name == "ViT-L-14/openai" else 1024 + image = image.convert('RGB') + if mode == 'best': + return ci.interrogate(image) + elif mode == 'classic': + return ci.interrogate_classic(image) + elif mode == 'fast': + return ci.interrogate_fast(image) + elif mode == 'negative': + return ci.interrogate_negative(image) + +# image = Image.open(image_path).convert('RGB') +# ci = Interrogator(Config(clip_model_name="ViT-L-14/openai")) +# print(ci.interrogate(image)) + + +class ClipInterrogator: + @classmethod + def INPUT_TYPES(s): + return {"required": { + "image": ("IMAGE",), + "prompt_mode": (['fast','classic','best','negative'],), + "image_analysis": (["off","on"],), + }, + } + + RETURN_TYPES = ("STRING","STRING",) + RETURN_NAMES = ("prompt","analysis",) + + FUNCTION = "run" + + CATEGORY = "♾️Mixlab/prompt" + + INPUT_IS_LIST = True + OUTPUT_IS_LIST = (True,) + global ci + ci = None + def run(self,image,prompt_mode,image_analysis): + global ci + + prompt_mode=prompt_mode[0] + analysis=image_analysis[0] + + prompt_result=[] + analysis_result=[] + + if ci==None: + config=Config( + clip_model_name="ViT-L-14/openai", + device="cuda" if torch.cuda.is_available() else "cpu", + download_cache=True, + clip_model_path=cache_path, + cache_path=cache_path + ) + config.apply_low_vram_defaults() + + caption_model,caption_processor=load_caption_model(caption_model_path,config) + + config.caption_model= caption_model + config.caption_processor= caption_processor + + ci = Interrogator(config) + # else: + # simple_lama.model.to("cuda" if torch.cuda.is_available() else "cpu") + + for i in range(len(image)): + im=image[i] + + im=tensor2pil(im) + im=im.convert('RGB') + + if analysis=='on': + analysis_res=image_analysis(ci,im) + analysis_result.append(json.dumps(analysis_res)) + + prompt=image_to_prompt(ci,im,prompt_mode) + + prompt_result.append(prompt) + + + # result.save("inpainted.png") + if ci.config.clip_offload and not ci.clip_offloaded: + ci.clip_model = ci.clip_model.to('cpu') + ci.clip_offloaded = True + + if ci.config.caption_offload and not ci.caption_offloaded: + ci.caption_model = ci.caption_model.to('cpu') + ci.caption_offloaded = True + + return {"ui":{"prompt": prompt_result,"analysis":analysis_result},"result": (prompt_result,analysis_result,)} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 3a06273..7cf54d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,5 @@ watchdog opencv-python-headless matplotlib openai -simple-lama-inpainting \ No newline at end of file +simple-lama-inpainting +clip-interrogator==0.6.0 \ No newline at end of file From cd6a42ab646bb19bb3811815c217c1d6df9d64cd Mon Sep 17 00:00:00 2001 From: shadowcz007 Date: Thu, 4 Jan 2024 11:03:25 +0800 Subject: [PATCH 02/11] clip-interrogator --- README.md | 3 +++ data/extension-node-map.json | 1 + 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 8d85277..a5663b0 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,9 @@ https://github.com/shadowcz007/comfyui-mixlab-nodes/assets/12645064/e7e77f90-e43 ![randomPrompt](./assets/randomPrompt.png) +> ClipInterrogator + +[add clip-interrogator](https://github.com/pharmapsychotic/clip-interrogator) ### Layers > A new layer class node has been added, allowing you to separate the image into layers. After merging the images, you can input the controlnet for further processing. diff --git a/data/extension-node-map.json b/data/extension-node-map.json index e7aab3a..7b594ec 100644 --- a/data/extension-node-map.json +++ b/data/extension-node-map.json @@ -4786,6 +4786,7 @@ "NewLayer", "RandomPrompt", "PromptSlide", + "ClipInterrogator", "ScreenShare", "ShowLayer", "ShowTextForGPT", From 068b00b99f4de3eadc98e069d2d893c5dcb28bf9 Mon Sep 17 00:00:00 2001 From: shadowcz007 Date: Thu, 4 Jan 2024 11:24:00 +0800 Subject: [PATCH 03/11] update --- nodes/ClipInterrogator.py | 8 ++++++-- web/index.html | 2 +- web/javascript/prompt_mixlab.js | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/nodes/ClipInterrogator.py b/nodes/ClipInterrogator.py index c055053..1524984 100644 --- a/nodes/ClipInterrogator.py +++ b/nodes/ClipInterrogator.py @@ -2,7 +2,7 @@ import os import folder_paths from PIL import Image - +import comfy.utils import numpy as np import json import torch @@ -108,6 +108,9 @@ class ClipInterrogator: prompt_result=[] analysis_result=[] + # 进度条 + pbar = comfy.utils.ProgressBar(len(image)*(2 if analysis=='on' else 1)) + if ci==None: config=Config( clip_model_name="ViT-L-14/openai", @@ -136,9 +139,10 @@ class ClipInterrogator: if analysis=='on': analysis_res=image_analysis(ci,im) analysis_result.append(json.dumps(analysis_res)) + pbar.update(1) prompt=image_to_prompt(ci,im,prompt_mode) - + pbar.update(1) prompt_result.append(prompt) diff --git a/web/index.html b/web/index.html index 3f5c0b3..58197be 100644 --- a/web/index.html +++ b/web/index.html @@ -276,7 +276,7 @@ .show_text { font-size: 14px; - /* display: inline-block; */ + user-select: text; margin: 8px; padding: 32px; min-width: 200px; diff --git a/web/javascript/prompt_mixlab.js b/web/javascript/prompt_mixlab.js index e50ed5a..0ae0caa 100644 --- a/web/javascript/prompt_mixlab.js +++ b/web/javascript/prompt_mixlab.js @@ -133,7 +133,7 @@ app.registerExtension({ inp.addEventListener('change', event => { // 获取选择的文件 const file = event.target.files[0] - + console.log(file) // 创建文件读取器 const reader = new FileReader() From 380c68ff2bc50240f886eeb83b4b7d546f92f4d3 Mon Sep 17 00:00:00 2001 From: shadowcz007 Date: Thu, 4 Jan 2024 12:03:27 +0800 Subject: [PATCH 04/11] =?UTF-8?q?EnhanceImage=E8=8A=82=E7=82=B9=E6=94=AF?= =?UTF-8?q?=E6=8C=81batch=E5=A4=9A=E5=BC=A0=E8=BE=93=E5=85=A5=E5=92=8C?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +--- nodes/ImageNode.py | 23 +++++++++++++++-------- nodes/Utils.py | 22 +++++++++++++++++----- web/javascript/prompt_mixlab.js | 6 ++++-- 4 files changed, 37 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index a5663b0..590153b 100644 --- a/README.md +++ b/README.md @@ -170,9 +170,7 @@ v0.8.0 🚀🚗🚚🏃‍ LaMaInpainting [Download lama](https://github.com/enesmsahin/simple-lama-inpainting/releases/download/v0.1.0/big-lama.pt), move to : models/lama - - +[Download Salesforce\blip-image-captioning-base](https://huggingface.co/Salesforce/blip-image-captioning-base), move to : models/clip_interrogator/Salesforce/blip-image-captioning-base ## Installation diff --git a/nodes/ImageNode.py b/nodes/ImageNode.py index 1a47952..76df646 100644 --- a/nodes/ImageNode.py +++ b/nodes/ImageNode.py @@ -953,20 +953,27 @@ class EnhanceImage: CATEGORY = "♾️Mixlab/image" - INPUT_IS_LIST = False + INPUT_IS_LIST = True - OUTPUT_IS_LIST = (False,) + OUTPUT_IS_LIST = (True,) # 运行的函数 def run(self,image,contrast): - # print('EnhanceImage',image.shape) - image=tensor2pil(image) - - image=enhance_depth_map(image,contrast) + # print('EnhanceImage',len(image),image[0].shape) + contrast=contrast[0] + res=[] + for ims in image: + for im in ims: - image=pil2tensor(image) + image=tensor2pil(im) + + image=enhance_depth_map(image,contrast) + + image=pil2tensor(image) + + res.append(image) - return (image,) + return (res,) diff --git a/nodes/Utils.py b/nodes/Utils.py index 5c9d978..2c52cde 100644 --- a/nodes/Utils.py +++ b/nodes/Utils.py @@ -34,13 +34,13 @@ def create_temp_file(image): ) = folder_paths.get_save_image_path('tmp', output_dir) - image=tensor2pil(image) + im=tensor2pil(image) image_file = f"{filename}_{counter:05}.png" image_path=os.path.join(full_output_folder, image_file) - image.save(image_path,compress_level=4) + im.save(image_path,compress_level=4) return [{ "filename": image_file, @@ -461,12 +461,24 @@ class AppInfo: CATEGORY = "♾️Mixlab" - INPUT_IS_LIST = False - OUTPUT_IS_LIST = (False,) + INPUT_IS_LIST = True + OUTPUT_IS_LIST = (True,) def run(self,name,image,input_ids,output_ids,description,version,share_prefix,link,category): + name=name[0] + im=image[0][0] + # image [img,] img[batch,w,h,a] 列表里面是batch, + + input_ids=input_ids[0] + output_ids=output_ids[0] + description=description[0] + version=version[0] + share_prefix=share_prefix[0] + link=link[0] + category=category[0] + #TODO batch 的方式需要处理 - im=create_temp_file(image) + im=create_temp_file(im) # id=get_json_hash([name,im,input_ids,output_ids,description,version]) diff --git a/web/javascript/prompt_mixlab.js b/web/javascript/prompt_mixlab.js index 0ae0caa..203aff6 100644 --- a/web/javascript/prompt_mixlab.js +++ b/web/javascript/prompt_mixlab.js @@ -132,8 +132,10 @@ app.registerExtension({ inp.click() inp.addEventListener('change', event => { // 获取选择的文件 - const file = event.target.files[0] - console.log(file) + const file = event.target.files[0]; + this.title=file.name.split('.')[0]; + + // console.log(file.name.split('.')[0]) // 创建文件读取器 const reader = new FileReader() From af05c431744082c6ba979e1bf45e24babceb14b7 Mon Sep 17 00:00:00 2001 From: shadowcz007 Date: Thu, 4 Jan 2024 12:31:45 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E6=94=AF=E6=8C=81image=E7=9A=84batch?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/index.html | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/web/index.html b/web/index.html index 58197be..25a7299 100644 --- a/web/index.html +++ b/web/index.html @@ -1474,7 +1474,6 @@ update: async function (type = "image", val, id) { console.log(val, id) if (val && type == "image" && output.querySelector(`#output_${id} img`)) { - // if (output.querySelector(`#output_${id}`)) { let im = await createImage(val) @@ -1486,10 +1485,32 @@ a.setAttribute('target', "_blank"); a.setAttribute('href', val); - // } - // else { - // output.querySelector(`#output_${id}`).src = val; - // } + } + + if (val && type == "images" && output.querySelector(`#output_${id} img`)) { + let imgDiv = output.querySelector(`#output_${id}`) + imgDiv.style.display = 'none'; + + // 清空 + Array.from(imgDiv.querySelectorAll('.output_images'), im => im.remove()); + + for (const v of val) { + let im = await createImage(v); + + // 构建新的 + let a = document.createElement('a'); + a.className = `${imgDiv.id} output_images` + a.setAttribute('data-pswp-width', im.naturalWidth); + a.setAttribute('data-pswp-height', im.naturalHeight); + a.setAttribute('target', "_blank"); + a.setAttribute('href', v); + + let img = new Image(); + // img; + img.src = v; + a.appendChild(img) + imgDiv.parentElement.appendChild(a); + } } @@ -1672,9 +1693,14 @@ const gifs = detail?.output?.gifs; if (images) { - // if (!images) return; - const src = `${get_url()}/view?filename=${encodeURIComponent(images[0].filename)}&type=${images[0].type}&subfolder=${encodeURIComponent(images[0].subfolder)}&t=${+new Date()}`; - show(src, detail.node, 'image'); + // if (!images) return; + + let url = get_url(); + + show(Array.from(images, img => { + return `${url}/view?filename=${encodeURIComponent(img.filename)}&type=${img.type}&subfolder=${encodeURIComponent(img.subfolder)}&t=${+new Date()}`; + }), detail.node, 'images'); + } else if (text) { ui.output.update("text", Array.isArray(text) ? text[0] : text, detail.node) } else if (gifs && gifs[0]) { @@ -1686,7 +1712,7 @@ } - try { + try { ui.status.update(`executed_#${window._appData.data[detail.node]?.class_type}`); ui.submitButton.reset() } catch (error) { From 9cf7356f98589a08edff2b4fa62c1d77b3a2138e Mon Sep 17 00:00:00 2001 From: shadowcz007 Date: Thu, 4 Jan 2024 12:33:59 +0800 Subject: [PATCH 06/11] Update index.html --- web/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/index.html b/web/index.html index 25a7299..1e9fbeb 100644 --- a/web/index.html +++ b/web/index.html @@ -1492,7 +1492,7 @@ imgDiv.style.display = 'none'; // 清空 - Array.from(imgDiv.querySelectorAll('.output_images'), im => im.remove()); + // Array.from(imgDiv.parentElement.querySelectorAll('.output_images'), im => im.remove()); for (const v of val) { let im = await createImage(v); From efb0e147c574d1c884a55122d1b7f8ed51b8cb13 Mon Sep 17 00:00:00 2001 From: shadowcz007 Date: Thu, 4 Jan 2024 12:45:00 +0800 Subject: [PATCH 07/11] Update index.html --- web/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/index.html b/web/index.html index 1e9fbeb..fa3284c 100644 --- a/web/index.html +++ b/web/index.html @@ -1509,7 +1509,8 @@ // img; img.src = v; a.appendChild(img) - imgDiv.parentElement.appendChild(a); + // imgDiv.parentElement.appendChild(a); + imgDiv.parentElement.insertBefore(a, imgDiv.parentElement.firstChild); } } From c6f964c921043c2f4caf29b6c8df41e963f7841e Mon Sep 17 00:00:00 2001 From: shadowcz007 Date: Thu, 4 Jan 2024 12:57:55 +0800 Subject: [PATCH 08/11] =?UTF-8?q?textarea=E8=BE=93=E5=85=A5=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=B8=80=E6=AC=A1=20=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/index.html b/web/index.html index fa3284c..2c117ef 100644 --- a/web/index.html +++ b/web/index.html @@ -980,8 +980,9 @@ // Create an input field for the image name const textInput = document.createElement("textarea"); + // textInput.className=; // uploadImageInput.type = "text"; - textInput.value = data.inputs.text; + textInput.value = localStorage.getItem(`t_${data.id}`) || data.inputs.text; uploadContainer.appendChild(textInput); function autoResize(textarea) { @@ -993,6 +994,7 @@ // console.log(textInput.value) autoResize(textInput); window._appData.data[data.id].inputs.text = textInput.value; + localStorage.setItem(`t_${data.id}`, textInput.value); }) // Append the upload container to the main container From 998a02c3a45a8b9242095dfed6e3982f81ca3f92 Mon Sep 17 00:00:00 2001 From: shadowcz007 Date: Thu, 4 Jan 2024 13:12:02 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E4=B8=8A=E4=B8=80=E6=AC=A1=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/index.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/index.html b/web/index.html index 2c117ef..e4cc8f1 100644 --- a/web/index.html +++ b/web/index.html @@ -1169,13 +1169,17 @@ if (keywords && keywords[0]) { // label.innerHTML = `` // 有备选的关键词 + + let defaultValue=(targetId?localStorage.getItem(`_slide_${targetId}`):'')|| keywords[0]; + let selectTag = createSelect(Array.from(keywords, (k, i) => { return { value: k, text: k, selected: i == 0 } - }), keywords[0]); + }),defaultValue); + selectTag.style = `background: none; color: black; max-width: 300px; border-bottom: 1px solid #acacac; @@ -1184,8 +1188,8 @@ selectTag.addEventListener('change', e => { e.preventDefault(); window._appData.data[targetId].inputs.prompt_keyword = selectTag.value; - // label.querySelector('.label').innerText = selectTag.value - // console.log(window._appData.data[targetId].inputs.prompt_keyword,selectTag.value) + + targetId?localStorage.setItem(`_slide_${targetId}`,selectTag.value):'' }) label.appendChild(selectTag); } From 574557810ed5aeec68848fc4a8c0d5d3f734e9c3 Mon Sep 17 00:00:00 2001 From: shadowcz007 Date: Thu, 4 Jan 2024 13:24:50 +0800 Subject: [PATCH 10/11] Update index.html --- web/index.html | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/web/index.html b/web/index.html index e4cc8f1..8c546fa 100644 --- a/web/index.html +++ b/web/index.html @@ -981,9 +981,19 @@ // Create an input field for the image name const textInput = document.createElement("textarea"); // textInput.className=; + textInput.value = data.inputs.text; // uploadImageInput.type = "text"; - textInput.value = localStorage.getItem(`t_${data.id}`) || data.inputs.text; + let json = localStorage.getItem(`t_${data.id}`) + try { + const { value, height } = JSON.parse(json); + textInput.value = value; + textInput.style.height=height; + } catch (error) { + + } + uploadContainer.appendChild(textInput); + // autoResize(textInput); function autoResize(textarea) { textarea.style.height = 'auto'; @@ -994,7 +1004,10 @@ // console.log(textInput.value) autoResize(textInput); window._appData.data[data.id].inputs.text = textInput.value; - localStorage.setItem(`t_${data.id}`, textInput.value); + + localStorage.setItem(`t_${data.id}`, JSON.stringify({ + value: textInput.value, + height: textInput.style.height })); }) // Append the upload container to the main container @@ -1170,7 +1183,7 @@ // label.innerHTML = `` // 有备选的关键词 - let defaultValue=(targetId?localStorage.getItem(`_slide_${targetId}`):'')|| keywords[0]; + let defaultValue = (targetId ? localStorage.getItem(`_slide_${targetId}`) : '') || keywords[0]; let selectTag = createSelect(Array.from(keywords, (k, i) => { return { @@ -1178,8 +1191,8 @@ text: k, selected: i == 0 } - }),defaultValue); - + }), defaultValue); + selectTag.style = `background: none; color: black; max-width: 300px; border-bottom: 1px solid #acacac; @@ -1188,8 +1201,8 @@ selectTag.addEventListener('change', e => { e.preventDefault(); window._appData.data[targetId].inputs.prompt_keyword = selectTag.value; - - targetId?localStorage.setItem(`_slide_${targetId}`,selectTag.value):'' + + targetId ? localStorage.setItem(`_slide_${targetId}`, selectTag.value) : '' }) label.appendChild(selectTag); } @@ -1246,7 +1259,7 @@ // 设置默认值 selectElement.value = defaultValue; - console.log(defaultValue, options) + // console.log(defaultValue, options) return selectElement } From 406a255db00d35fbec48eba143f60317bf8b5ec6 Mon Sep 17 00:00:00 2001 From: shadowcz007 Date: Thu, 4 Jan 2024 13:37:07 +0800 Subject: [PATCH 11/11] =?UTF-8?q?v0.10.0=20=E5=A2=9E=E5=8A=A0=20ClipInterr?= =?UTF-8?q?ogator=E3=80=81=E4=BC=98=E5=8C=96APP=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/javascript/checkVersion_mixlab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/javascript/checkVersion_mixlab.js b/web/javascript/checkVersion_mixlab.js index 600fba9..525c262 100644 --- a/web/javascript/checkVersion_mixlab.js +++ b/web/javascript/checkVersion_mixlab.js @@ -3,7 +3,7 @@ import { app } from '../../../scripts/app.js' const repoOwner = 'shadowcz007' // 替换为仓库的所有者 const repoName = 'comfyui-mixlab-nodes' // 替换为仓库的名称 -const version = 'v0.9.1' +const version = 'v0.10.0' fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/releases/latest`) .then(response => response.json())