diff --git a/py/api.py b/py/api.py index 014c886..fae60d5 100644 --- a/py/api.py +++ b/py/api.py @@ -7,7 +7,6 @@ from folder_paths import get_directory_by_type from server import PromptServer from .config import RESOURCES_DIR, FOOOCUS_STYLES_DIR, FOOOCUS_STYLES_SAMPLES -from .logic import ConvertAnything from .libs.model import easyModelManager from .libs.utils import getMetadata, cleanGPUUsedForce, get_local_filepath from .libs.cache import remove_cache @@ -123,18 +122,6 @@ async def getStylesImage(request): return web.Response(text=FOOOCUS_STYLES_SAMPLES + name + '.jpg') return web.Response(status=400) -# convert type -@PromptServer.instance.routes.post("/easyuse/convert") -async def convertType(request): - post = await request.post() - type = post.get('type') - if type: - ConvertAnything.RETURN_TYPES = (type.upper(),) - ConvertAnything.RETURN_NAMES = (type,) - return web.Response(status=200) - else: - return web.Response(status=400) - # get models lists @PromptServer.instance.routes.get("/easyuse/models/list") async def getModelsList(request): diff --git a/py/image.py b/py/image.py index 3a5ef11..91539f4 100644 --- a/py/image.py +++ b/py/image.py @@ -1523,46 +1523,46 @@ def listdir(path, dir_name=''): # 姿势编辑器 -class poseEditor: - @classmethod - def INPUT_TYPES(self): - temp_dir = folder_paths.get_temp_directory() - - if not os.path.isdir(temp_dir): - os.makedirs(temp_dir) - - temp_dir = folder_paths.get_temp_directory() - - return {"required": - {"image": (sorted(os.listdir(temp_dir)),)}, - } - - RETURN_TYPES = ("IMAGE",) - FUNCTION = "output_pose" - - CATEGORY = "EasyUse/Image" - - def output_pose(self, image): - image_path = os.path.join(folder_paths.get_temp_directory(), image) - # print(f"Create: {image_path}") - - i = Image.open(image_path) - image = i.convert("RGB") - image = np.array(image).astype(np.float32) / 255.0 - image = torch.from_numpy(image)[None,] - - return (image,) - - @classmethod - def IS_CHANGED(self, image): - image_path = os.path.join( - folder_paths.get_temp_directory(), image) - # print(f'Change: {image_path}') - - m = hashlib.sha256() - with open(image_path, 'rb') as f: - m.update(f.read()) - return m.digest().hex() +# class poseEditor: +# @classmethod +# def INPUT_TYPES(self): +# temp_dir = folder_paths.get_temp_directory() +# +# if not os.path.isdir(temp_dir): +# os.makedirs(temp_dir) +# +# temp_dir = folder_paths.get_temp_directory() +# +# return {"required": +# {"image": (sorted(os.listdir(temp_dir)),)}, +# } +# +# RETURN_TYPES = ("IMAGE",) +# FUNCTION = "output_pose" +# +# CATEGORY = "EasyUse/🚫 Deprecated" +# +# def output_pose(self, image): +# image_path = os.path.join(folder_paths.get_temp_directory(), image) +# # print(f"Create: {image_path}") +# +# i = Image.open(image_path) +# image = i.convert("RGB") +# image = np.array(image).astype(np.float32) / 255.0 +# image = torch.from_numpy(image)[None,] +# +# return (image,) +# +# @classmethod +# def IS_CHANGED(self, image): +# image_path = os.path.join( +# folder_paths.get_temp_directory(), image) +# # print(f'Change: {image_path}') +# +# m = hashlib.sha256() +# with open(image_path, 'rb') as f: +# m.update(f.read()) +# return m.digest().hex() NODE_CLASS_MAPPINGS = { "easy imageInsetCrop": imageInsetCrop, @@ -1595,7 +1595,6 @@ def IS_CHANGED(self, image): "easy joinImageBatch": JoinImageBatch, "easy humanSegmentation": humanSegmentation, "easy removeLocalImage": removeLocalImage, - "easy poseEditor": poseEditor } NODE_DISPLAY_NAME_MAPPINGS = { @@ -1630,5 +1629,4 @@ def IS_CHANGED(self, image): "easy imageToBase64": "Image To Base64", "easy humanSegmentation": "Human Segmentation", "easy removeLocalImage": "Remove Local Image", - "easy poseEditor": "PoseEditor", } \ No newline at end of file diff --git a/py/logic.py b/py/logic.py index 9809203..498201d 100644 --- a/py/logic.py +++ b/py/logic.py @@ -1,10 +1,17 @@ from typing import Iterator, List, Tuple, Dict, Any, Union, Optional from _decimal import Context, getcontext from decimal import Decimal -from .libs.utils import AlwaysEqualProxy, ByPassTypeTuple, cleanGPUUsedForce +from .libs.utils import AlwaysEqualProxy, ByPassTypeTuple, cleanGPUUsedForce, compare_revision from .libs.cache import remove_cache import numpy as np +import re import json +import torch +import comfy.utils + +DEFAULT_FLOW_NUM = 2 +MAX_FLOW_NUM = 10 +lazy_options = {"lazy": True} if compare_revision(2543) else {} def validate_list_args(args: Dict[str, List[Any]]) -> Tuple[bool, Optional[str], Optional[str]]: """ @@ -302,7 +309,457 @@ def switch(self, input, text1=None, text2=None,): else: return (text2,) -# ---------------------------------------------------------------运算 开始----------------------------------------------------------------------# +# ---------------------------------------------------------------Index Switch----------------------------------------------------------------------# + +class anythingIndexSwitch: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + inputs = { + "required": { + "index": ("INT", {"default": 0, "min": 0, "max": 9, "step": 1}), + }, + "optional": { + } + } + for i in range(DEFAULT_FLOW_NUM): + inputs["optional"]["value%d" % i] = (AlwaysEqualProxy("*"),lazy_options) + return inputs + + RETURN_TYPES = (AlwaysEqualProxy("*"),) + RETURN_NAMES = ("value",) + FUNCTION = "index_switch" + + CATEGORY = "EasyUse/Logic/Index Switch" + + def check_lazy_status(self, index, **kwargs): + key = "value%d" % index + if kwargs.get(key, None) is None: + return [key] + + def index_switch(self, index, **kwargs): + key = "value%d" % index + return (kwargs[key],) + +class imageIndexSwitch: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + inputs = { + "required": { + "index": ("INT", {"default": 0, "min": 0, "max": 9, "step": 1}), + }, + "optional": { + } + } + for i in range(DEFAULT_FLOW_NUM): + inputs["optional"]["image%d" % i] = ("IMAGE",lazy_options) + return inputs + + RETURN_TYPES = ("IMAGE",) + RETURN_NAMES = ("image",) + FUNCTION = "index_switch" + + CATEGORY = "EasyUse/Logic/Index Switch" + + def check_lazy_status(self, index, **kwargs): + key = "image%d" % index + if kwargs.get(key, None) is None: + return [key] + + def index_switch(self, index, **kwargs): + key = "image%d" % index + return (kwargs[key],) + +class textIndexSwitch: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + inputs = { + "required": { + "index": ("INT", {"default": 0, "min": 0, "max": 9, "step": 1}), + }, + "optional": { + } + } + for i in range(DEFAULT_FLOW_NUM): + inputs["optional"]["text%d" % i] = ("STRING",{**lazy_options,"forceInput":True}) + return inputs + + RETURN_TYPES = ("STRING",) + RETURN_NAMES = ("text",) + FUNCTION = "index_switch" + + CATEGORY = "EasyUse/Logic/Index Switch" + + def check_lazy_status(self, index, **kwargs): + key = "text%d" % index + if kwargs.get(key, None) is None: + return [key] + + def index_switch(self, index, **kwargs): + key = "text%d" % index + return (kwargs[key],) + +class conditioningIndexSwitch: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + inputs = { + "required": { + "index": ("INT", {"default": 0, "min": 0, "max": 9, "step": 1}), + }, + "optional": { + } + } + for i in range(DEFAULT_FLOW_NUM): + inputs["optional"]["cond%d" % i] = ("CONDITIONING",lazy_options) + return inputs + + RETURN_TYPES = ("CONDITIONING",) + RETURN_NAMES = ("conditioning",) + FUNCTION = "index_switch" + + CATEGORY = "EasyUse/Logic/Index Switch" + + def check_lazy_status(self, index, **kwargs): + key = "cond%d" % index + if kwargs.get(key, None) is None: + return [key] + + def index_switch(self, index, **kwargs): + key = "cond%d" % index + return (kwargs[key],) + +# ---------------------------------------------------------------Math----------------------------------------------------------------------# +class mathIntOperation: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "a": ("INT", {"default": 0, "min": -0xffffffffffffffff, "max": 0xffffffffffffffff, "step": 1}), + "b": ("INT", {"default": 0, "min": -0xffffffffffffffff, "max": 0xffffffffffffffff, "step": 1}), + "operation": (["add", "subtract", "multiply", "divide", "modulo", "power"],), + }, + } + + RETURN_TYPES = ("INT",) + FUNCTION = "int_math_operation" + + CATEGORY = "EasyUse/Logic/Math" + + def int_math_operation(self, a, b, operation): + if operation == "add": + return (a + b,) + elif operation == "subtract": + return (a - b,) + elif operation == "multiply": + return (a * b,) + elif operation == "divide": + return (a // b,) + elif operation == "modulo": + return (a % b,) + elif operation == "power": + return (a ** b,) + +class mathFloatOperation: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "a": ("FLOAT", {"default": 0, "min": -999999999999.0, "max": 999999999999.0, "step": 1}), + "b": ("FLOAT", {"default": 0, "min": -999999999999.0, "max": 999999999999.0, "step": 1}), + "operation": (["==", "!=", "<", ">", "<=", ">="],), + }, + } + + RETURN_TYPES = ("BOOLEAN",) + FUNCTION = "float_math_operation" + + CATEGORY = "EasyUse/Logic/Math" + + def float_math_operation(self, a, b, operation): + if operation == "==": + return (a == b,) + elif operation == "!=": + return (a != b,) + elif operation == "<": + return (a < b,) + elif operation == ">": + return (a > b,) + elif operation == "<=": + return (a <= b,) + elif operation == ">=": + return (a >= b,) + +class mathStringOperation: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "a": ("STRING", {"multiline": False}), + "b": ("STRING", {"multiline": False}), + "operation": (["a == b", "a != b", "a IN b", "a MATCH REGEX(b)", "a BEGINSWITH b", "a ENDSWITH b"],), + "case_sensitive": ("BOOLEAN", {"default": True}), + }, + } + + RETURN_TYPES = ("BOOLEAN",) + FUNCTION = "string_math_operation" + + CATEGORY = "EasyUse/Logic/Math" + + def string_math_operation(self, a, b, operation, case_sensitive): + if not case_sensitive: + a = a.lower() + b = b.lower() + + if operation == "a == b": + return (a == b,) + elif operation == "a != b": + return (a != b,) + elif operation == "a IN b": + return (a in b,) + elif operation == "a MATCH REGEX(b)": + try: + return (re.match(b, a) is not None,) + except: + return (False,) + elif operation == "a BEGINSWITH b": + return (a.startswith(b),) + elif operation == "a ENDSWITH b": + return (a.endswith(b),) + +# ---------------------------------------------------------------Flow----------------------------------------------------------------------# +try: + from comfy_execution.graph_utils import GraphBuilder, is_link +except: + GraphBuilder = None + +class whileLoopStart: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + inputs = { + "required": { + "condition": ("BOOLEAN", {"default": True}), + }, + "optional": { + }, + } + for i in range(MAX_FLOW_NUM): + inputs["optional"]["initial_value%d" % i] = ("*",) + return inputs + + RETURN_TYPES = ByPassTypeTuple(tuple(["FLOW_CONTROL"] + ["*"] * MAX_FLOW_NUM)) + RETURN_NAMES = ByPassTypeTuple(tuple(["flow"] + ["value%d" % i for i in range(MAX_FLOW_NUM)])) + FUNCTION = "while_loop_open" + + CATEGORY = "EasyUse/Logic/While Loop" + + def while_loop_open(self, condition, **kwargs): + values = [] + for i in range(MAX_FLOW_NUM): + values.append(kwargs.get("initial_value%d" % i, None)) + return tuple(["stub"] + values) + +class whileLoopEnd: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + inputs = { + "required": { + "flow": ("FLOW_CONTROL", {"rawLink": True}), + "condition": ("BOOLEAN", {"forceInput": True}), + }, + "optional": { + }, + "hidden": { + "dynprompt": "DYNPROMPT", + "unique_id": "UNIQUE_ID", + } + } + for i in range(MAX_FLOW_NUM): + inputs["optional"]["initial_value%d" % i] = (AlwaysEqualProxy('*'),) + return inputs + + RETURN_TYPES = ByPassTypeTuple(tuple([AlwaysEqualProxy('*')] * MAX_FLOW_NUM)) + RETURN_NAMES = ByPassTypeTuple(tuple(["value%d" % i for i in range(MAX_FLOW_NUM)])) + FUNCTION = "while_loop_close" + + CATEGORY = "EasyUse/Logic/While Loop" + + def explore_dependencies(self, node_id, dynprompt, upstream): + node_info = dynprompt.get_node(node_id) + if "inputs" not in node_info: + return + for k, v in node_info["inputs"].items(): + if is_link(v): + parent_id = v[0] + if parent_id not in upstream: + upstream[parent_id] = [] + self.explore_dependencies(parent_id, dynprompt, upstream) + upstream[parent_id].append(node_id) + + def collect_contained(self, node_id, upstream, contained): + if node_id not in upstream: + return + for child_id in upstream[node_id]: + if child_id not in contained: + contained[child_id] = True + self.collect_contained(child_id, upstream, contained) + + + def while_loop_close(self, flow, condition, dynprompt=None, unique_id=None, **kwargs): + if not condition: + # We're done with the loop + values = [] + for i in range(MAX_FLOW_NUM): + values.append(kwargs.get("initial_value%d" % i, None)) + return tuple(values) + + # We want to loop + this_node = dynprompt.get_node(unique_id) + upstream = {} + # Get the list of all nodes between the open and close nodes + self.explore_dependencies(unique_id, dynprompt, upstream) + + contained = {} + open_node = flow[0] + self.collect_contained(open_node, upstream, contained) + contained[unique_id] = True + contained[open_node] = True + + graph = GraphBuilder() + for node_id in contained: + original_node = dynprompt.get_node(node_id) + node = graph.node(original_node["class_type"], "Recurse" if node_id == unique_id else node_id) + node.set_override_display_id(node_id) + for node_id in contained: + original_node = dynprompt.get_node(node_id) + node = graph.lookup_node("Recurse" if node_id == unique_id else node_id) + for k, v in original_node["inputs"].items(): + if is_link(v) and v[0] in contained: + parent = graph.lookup_node(v[0]) + node.set_input(k, parent.out(v[1])) + else: + node.set_input(k, v) + + new_open = graph.lookup_node(open_node) + for i in range(MAX_FLOW_NUM): + key = "initial_value%d" % i + new_open.set_input(key, kwargs.get(key, None)) + my_clone = graph.lookup_node("Recurse") + result = map(lambda x: my_clone.out(x), range(MAX_FLOW_NUM)) + return { + "result": tuple(result), + "expand": graph.finalize(), + } + +class forLoopStart: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "total": ("INT", {"default": 1, "min": 0, "max": 100000, "step": 1}), + }, + "optional": { + "initial_value%d" % i: (AlwaysEqualProxy("*"),) for i in range(1, MAX_FLOW_NUM) + }, + "hidden": { + "initial_value0": (AlwaysEqualProxy("*"),), + "prompt": "PROMPT", + "unique_id": "UNIQUE_ID" + } + } + + RETURN_TYPES = ByPassTypeTuple(tuple(["FLOW_CONTROL", "INT"] + [AlwaysEqualProxy("*")] * (MAX_FLOW_NUM - 1))) + RETURN_NAMES = ByPassTypeTuple(tuple(["flow", "index"] + ["value%d" % i for i in range(1, MAX_FLOW_NUM)])) + FUNCTION = "for_loop_start" + + CATEGORY = "EasyUse/Logic/For Loop" + + def for_loop_start(self, total, prompt=None, unique_id=None, **kwargs): + graph = GraphBuilder() + i = 0 + if "initial_value0" in kwargs: + i = kwargs["initial_value0"] + initial_values = {("initial_value%d" % num): kwargs.get("initial_value%d" % num, None) for num in range(1, MAX_FLOW_NUM)} + while_open = graph.node("easy whileLoopStart", condition=total, initial_value0=i, **initial_values) + outputs = [kwargs.get("initial_value%d" % num, None) for num in range(1, MAX_FLOW_NUM)] + return { + "result": tuple(["stub", i] + outputs), + "expand": graph.finalize(), + } + +class forLoopEnd: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "flow": ("FLOW_CONTROL", {"rawLink": True}), + }, + "optional": { + "initial_value%d" % i: (AlwaysEqualProxy("*"), {"rawLink": True}) for i in range(1, MAX_FLOW_NUM) + }, + "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO", "my_unique_id": "UNIQUE_ID"}, + } + + RETURN_TYPES = ByPassTypeTuple(tuple([AlwaysEqualProxy("*")] * (MAX_FLOW_NUM - 1))) + RETURN_NAMES = ByPassTypeTuple(tuple(["value%d" % i for i in range(1, MAX_FLOW_NUM)])) + FUNCTION = "for_loop_end" + + CATEGORY = "EasyUse/Logic/For Loop" + + def for_loop_end(self, flow, prompt=None, extra_pnginfo=None, my_unique_id=None, **kwargs): + graph = GraphBuilder() + while_open = flow[0] + total = None + if extra_pnginfo: + node = next((x for x in extra_pnginfo['workflow']['nodes'] if x['id'] == int(while_open)), None) + total = node['widgets_values'][0] if "widgets_values" in node else None + if total is None: + raise Exception("Unable to get parameters for the start of the loop") + sub = graph.node("easy mathInt", operation="add", a=[while_open, 1], b=1) + cond = graph.node("easy compare", a=sub.out(0), b=total, comparison='a < b') + input_values = {("initial_value%d" % i): kwargs.get("initial_value%d" % i, None) for i in + range(1, MAX_FLOW_NUM)} + while_close = graph.node("easy whileLoopEnd", + flow=flow, + condition=cond.out(0), + initial_value0=sub.out(0), + **input_values) + return { + "result": tuple([while_close.out(i) for i in range(1, MAX_FLOW_NUM)]), + "expand": graph.finalize(), + } COMPARE_FUNCTIONS = { "a == b": lambda a, b: a == b, @@ -317,46 +774,70 @@ def switch(self, input, text1=None, text2=None,): class Compare: @classmethod def INPUT_TYPES(s): - s.compare_functions = list(COMPARE_FUNCTIONS.keys()) + compare_functions = list(COMPARE_FUNCTIONS.keys()) return { "required": { "a": (AlwaysEqualProxy("*"), {"default": 0}), "b": (AlwaysEqualProxy("*"), {"default": 0}), - "comparison": (s.compare_functions, {"default": "a == b"}), + "comparison": (compare_functions, {"default": "a == b"}), }, } RETURN_TYPES = ("BOOLEAN",) RETURN_NAMES = ("boolean",) FUNCTION = "compare" - CATEGORY = "EasyUse/Logic/Math" + CATEGORY = "EasyUse/Logic" def compare(self, a, b, comparison): return (COMPARE_FUNCTIONS[comparison](a, b),) # 判断 -class If: +class IfElse: @classmethod def INPUT_TYPES(s): return { "required": { - "any": (AlwaysEqualProxy("*"),), - "if": (AlwaysEqualProxy("*"),), - "else": (AlwaysEqualProxy("*"),), + "boolean": ("BOOLEAN",), + "on_true": (AlwaysEqualProxy("*"), lazy_options), + "on_false": (AlwaysEqualProxy("*"), lazy_options), }, } RETURN_TYPES = (AlwaysEqualProxy("*"),) - RETURN_NAMES = ("?",) + RETURN_NAMES = ("*",) FUNCTION = "execute" - CATEGORY = "EasyUse/Logic/Math" + CATEGORY = "EasyUse/Logic" - def execute(self, *args, **kwargs): - return (kwargs['if'] if kwargs['any'] else kwargs['else'],) + def check_lazy_status(self, boolean, on_true=None, on_false=None): + if boolean and on_true is None: + return ["on_true"] + if not boolean and on_false is None: + return ["on_false"] + def execute(self, *args, **kwargs): + return (kwargs['on_true'] if kwargs['boolean'] else kwargs['on_false'],) #是否为SDXL from comfy.sdxl_clip import SDXLClipModel, SDXLRefinerClipModel, SDXLClipG +class isNone: + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "any": (AlwaysEqualProxy("*"),) + }, + "optional": { + } + } + + RETURN_TYPES = ("BOOLEAN",) + RETURN_NAMES = ("boolean",) + FUNCTION = "execute" + CATEGORY = "EasyUse/Logic" + + def execute(self, any): + return (True if any is None else False,) + class isSDXL: @classmethod def INPUT_TYPES(s): @@ -419,8 +900,52 @@ def to_xy(self, X, Y, direction): return (new_x, new_y) +class batchAnything: + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "a": (AlwaysEqualProxy("*"),{}), + "b": (AlwaysEqualProxy("*"),{}) + } + } + + RETURN_TYPES = (AlwaysEqualProxy("*"),) + RETURN_NAMES = ("batch",) + + FUNCTION = "batch" + CATEGORY = "EasyUse/Logic" + + def batch(self, a, b): + if isinstance(a, torch.Tensor) or isinstance(b, torch.Tensor): + if a is None: + return (b,) + elif b is None: + return (a,) + if a.shape[1:] != b.shape[1:]: + b = comfy.utils.common_upscale(b.movedim(-1, 1), a.shape[2], a.shape[1], "bilinear", "center").movedim(1, -1) + return (torch.cat((a, b), 0),) + elif isinstance(a, (str, float, int)): + if b is None: + return (a,) + elif isinstance(b, tuple): + return (b + (a,),) + return ((a, b),) + elif isinstance(b, (str, float, int)): + if a is None: + return (b,) + elif isinstance(a, tuple): + return (a + (b,),) + return ((b, a),) + else: + if a is None: + return (b,) + elif b is None: + return (a,) + return (a + b,) + # 转换所有类型 -class ConvertAnything: +class convertAnything: @classmethod def INPUT_TYPES(s): return {"required": { @@ -434,7 +959,6 @@ def INPUT_TYPES(s): CATEGORY = "EasyUse/Logic" def convert(self, *args, **kwargs): - print(kwargs) anything = kwargs['*'] output_type = kwargs['output_type'] params = None @@ -577,8 +1101,39 @@ def empty_cache(self, anything, unique_id=None, extra_pnginfo=None): remove_cache('*') return () +# Deprecated +class If: + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "any": (AlwaysEqualProxy("*"),), + "if": (AlwaysEqualProxy("*"),), + "else": (AlwaysEqualProxy("*"),), + }, + } + + RETURN_TYPES = (AlwaysEqualProxy("*"),) + RETURN_NAMES = ("?",) + FUNCTION = "execute" + CATEGORY = "EasyUse/🚫 Deprecated" + + def execute(self, *args, **kwargs): + return (kwargs['if'] if kwargs['any'] else kwargs['else'],) +class poseEditor: + @classmethod + def INPUT_TYPES(s): + return {"required": { + "image": ("STRING", {"default":""}) + }} + FUNCTION = "output_pose" + CATEGORY = "EasyUse/🚫 Deprecated" + RETURN_TYPES = () + RETURN_NAMES = () + def output_pose(self, image): + return () NODE_CLASS_MAPPINGS = { "easy string": String, @@ -587,18 +1142,33 @@ def empty_cache(self, anything, unique_id=None, extra_pnginfo=None): "easy float": Float, "easy rangeFloat": RangeFloat, "easy boolean": Boolean, + "easy mathString": mathStringOperation, + "easy mathInt": mathIntOperation, + "easy mathFloat": mathFloatOperation, "easy compare": Compare, "easy imageSwitch": imageSwitch, "easy textSwitch": textSwitch, - "easy if": If, + "easy anythingIndexSwitch": anythingIndexSwitch, + "easy imageIndexSwitch": imageIndexSwitch, + "easy textIndexSwitch": textIndexSwitch, + "easy conditioningIndexSwitch": conditioningIndexSwitch, + "easy whileLoopStart": whileLoopStart, + "easy whileLoopEnd": whileLoopEnd, + "easy forLoopStart": forLoopStart, + "easy forLoopEnd": forLoopEnd, + "easy ifElse": IfElse, + "easy isNone": isNone, "easy isSDXL": isSDXL, "easy xyAny": xyAny, - "easy convertAnything": ConvertAnything, + "easy batchAnything": batchAnything, + "easy convertAnything": convertAnything, "easy showAnything": showAnything, "easy showTensorShape": showTensorShape, "easy clearCacheKey": clearCacheKey, "easy clearCacheAll": clearCacheAll, "easy cleanGpuUsed": cleanGPUUsed, + "easy if": If, + "easy poseEditor": poseEditor } NODE_DISPLAY_NAME_MAPPINGS = { "easy string": "String", @@ -608,15 +1178,30 @@ def empty_cache(self, anything, unique_id=None, extra_pnginfo=None): "easy rangeFloat": "Range(Float)", "easy boolean": "Boolean", "easy compare": "Compare", + "easy mathString": "Math String", + "easy mathInt": "Math Int", + "easy mathFloat": "Math Float", "easy imageSwitch": "Image Switch", "easy textSwitch": "Text Switch", - "easy if": "If", + "easy anythingIndexSwitch": "Any Index Switch", + "easy imageIndexSwitch": "Image Index Switch", + "easy textIndexSwitch": "Text Index Switch", + "easy conditioningIndexSwitch": "Conditioning Index Switch", + "easy whileLoopStart": "While Loop Start", + "easy whileLoopEnd": "While Loop End", + "easy forLoopStart": "For Loop Start", + "easy forLoopEnd": "For Loop End", + "easy ifElse": "If else", + "easy isNone": "Is None", "easy isSDXL": "Is SDXL", "easy xyAny": "XYAny", + "easy batchAnything": "Batch Any", "easy convertAnything": "Convert Any", "easy showAnything": "Show Any", "easy showTensorShape": "Show Tensor Shape", "easy clearCacheKey": "Clear Cache Key", "easy clearCacheAll": "Clear Cache All", - "easy cleanGpuUsed": "Clean GPU Used" + "easy cleanGpuUsed": "Clean GPU Used", + "easy if": "If (🚫Deprecated)", + "easy poseEditor": "PoseEditor (🚫Deprecated)" } \ No newline at end of file diff --git a/web_version/v2/assets/extensions-DjHfjjgA.js b/web_version/v2/assets/extensions-DjHfjjgA.js new file mode 100644 index 0000000..ac35b6c --- /dev/null +++ b/web_version/v2/assets/extensions-DjHfjjgA.js @@ -0,0 +1 @@ +var e,t,n,s,o,i,a,l,r,d,u,c,p,h,m,g=Object.defineProperty,f=(e,t,n)=>((e,t,n)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);import{d as y,h as _}from"./vendor-DT1J-jWa.js";import{c as v}from"./lodash-CZi7izHi.js";let w=(null==(t=null==(e=window.comfyAPI)?void 0:e.app)?void 0:t.app)||null,b=(null==(s=null==(n=window.comfyAPI)?void 0:n.api)?void 0:s.api)||null,L=(null==(i=null==(o=window.comfyAPI)?void 0:o.ui)?void 0:i.$el)||null,S=(null==(l=null==(a=window.comfyAPI)?void 0:a.dialog)?void 0:l.ComfyDialog)||null,E=(null==(d=null==(r=window.comfyAPI)?void 0:r.widgets)?void 0:d.ComfyWidgets)||null,C=(null==(c=null==(u=window.comfyAPI)?void 0:u.utils)?void 0:c.applyTextReplacements)||null,A=(null==(h=null==(p=window.comfyAPI)?void 0:p.groupNode)?void 0:h.GroupNodeConfig)||null;const k=(e,t=void 0)=>{var n,s;return e?null==(s=null==(n=null==w?void 0:w.ui)?void 0:n.settings)?void 0:s.getSettingValue(e,t):null};function I(e,t=null,n=void 0){try{let s=e?k(e,n):null;return void 0===s&&t&&(s=localStorage[e]),s}catch(s){return null}}function x(e,t=e=>{}){var n;const s=null==(n=w.ui.settings.settingsLookup)?void 0:n[e];s&&(s.onChange=e=>t(e))}async function N(e,t,n=null){var s,o;try{(null==(o=null==(s=null==w?void 0:w.ui)?void 0:s.settings)?void 0:o.setSettingValue)?w.ui.settings.setSettingValue(e,t):await b.storeSetting(e,t),n&&(localStorage[n]="object"==typeof t?JSON.stringify(t):t)}catch(i){}}function T(e){w.ui.settings.addSetting(e)}function O(e,t){if(e="number"==typeof e?e:e instanceof Date?e.getTime():parseInt(e),isNaN(e))return null;let n=new Date(e);(e=n.toString().split(/[\s\:]/g).slice(0,-2))[1]=["01","02","03","04","05","06","07","08","09","10","11","12"][n.getMonth()];let s={MM:1,dd:2,yyyy:3,hh:4,mm:5,ss:6};return t.replace(/([Mmdhs]|y{2})\1/g,(t=>e[s[t]]))}const D="comfyui-easyuse-",R="dark-theme",G="#236692",M={PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd",FLOW_CONTROL:"#373780"},P=0x4000000000000,F=["loaders","latent","image","mask","sampling","_for_testing","advanced","utils","api"],U={ALWAYS:0,NEVER:2,BYPASS:4},B="easyuse_nodes_map",z=LGraphCanvas.node_colors.bgcolor,W={ColorPalette:{version:105,id:"obsidian",name:"Obsidian",colors:{node_slot:{CLIP:"#FFD500",CLIP_VISION:"#A8DADC",CLIP_VISION_OUTPUT:"#ad7452",CONDITIONING:"#FFA931",CONTROL_NET:"#6EE7B7",IMAGE:"#64B5F6",LATENT:"#FF9CF9",MASK:"#81C784",MODEL:"#B39DDB",STYLE_MODEL:"#C2FFAE",VAE:"#FF6E6E",TAESD:"#DCC274",PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},litegraph_base:{BACKGROUND_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQBJREFUeNrs1rEKwjAUhlETUkj3vP9rdmr1Ysammk2w5wdxuLgcMHyptfawuZX4pJSWZTnfnu/lnIe/jNNxHHGNn//HNbbv+4dr6V+11uF527arU7+u63qfa/bnmh8sWLBgwYJlqRf8MEptXPBXJXa37BSl3ixYsGDBMliwFLyCV/DeLIMFCxYsWLBMwSt4Be/NggXLYMGCBUvBK3iNruC9WbBgwYJlsGApeAWv4L1ZBgsWLFiwYJmCV/AK3psFC5bBggULloJX8BpdwXuzYMGCBctgwVLwCl7Be7MMFixYsGDBsu8FH1FaSmExVfAxBa/gvVmwYMGCZbBg/W4vAQYA5tRF9QYlv/QAAAAASUVORK5CYII=",CLEAR_BACKGROUND_COLOR:"#222222",NODE_TITLE_COLOR:"#d4d4d8",NODE_SELECTED_TITLE_COLOR:"#ffffff",NODE_TEXT_SIZE:14,NODE_TEXT_COLOR:"#ffffff",NODE_SUBTEXT_SIZE:12,NODE_DEFAULT_COLOR:"#09090b",NODE_DEFAULT_BGCOLOR:"rgba(24,24,27,.9)",NODE_DEFAULT_BOXCOLOR:"rgba(255,255,255,.75)",NODE_DEFAULT_SHAPE:"box",NODE_BOX_OUTLINE_COLOR:G,DEFAULT_SHADOW_COLOR:"rgba(0,0,0,0)",DEFAULT_GROUP_FONT:24,WIDGET_BGCOLOR:"#242427",WIDGET_OUTLINE_COLOR:"#3f3f46",WIDGET_TEXT_COLOR:"#d4d4d8",WIDGET_SECONDARY_TEXT_COLOR:"#d4d4d8",LINK_COLOR:"#9A9",EVENT_LINK_COLOR:"#A86",CONNECTING_LINK_COLOR:"#AFA"},comfy_base:{"fg-color":"#fff","bg-color":"#09090b","comfy-menu-bg":"rgba(24,24,24,.9)","comfy-input-bg":"#262626","input-text":"#ddd","descrip-text":"#999","drag-text":"#ccc","error-text":"#ff4444","border-color":"#29292c","tr-even-bg-color":"rgba(28,28,28,.9)","tr-odd-bg-color":"rgba(19,19,19,.9)"}}},NODE_COLORS:{red:{color:"#af3535",bgcolor:z,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:z,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:z,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:z,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:z,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:z,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:z,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:z,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:z,groupcolor:"#444"}}};let j=JSON.parse(JSON.stringify(W));delete j.NODE_COLORS,j.ColorPalette.id="obsidian_dark",j.ColorPalette.name="Obsidian Dark",j.ColorPalette.colors.litegraph_base.BACKGROUND_IMAGE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGlmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDEgNzkuMTQ2Mjg5OSwgMjAyMy8wNi8yNS0yMDowMTo1NSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAyMy0xMS0xM1QwMDoxODowMiswMTowMCIgeG1wOk1vZGlmeURhdGU9IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIHhtcDpNZXRhZGF0YURhdGU9IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmIyYzRhNjA5LWJmYTctYTg0MC1iOGFlLTk3MzE2ZjM1ZGIyNyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjk0ZmNlZGU4LTE1MTctZmQ0MC04ZGU3LWYzOTgxM2E3ODk5ZiIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjIzMWIxMGIwLWI0ZmItMDI0ZS1iMTJlLTMwNTMwM2NkMDdjOCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6MjMxYjEwYjAtYjRmYi0wMjRlLWIxMmUtMzA1MzAzY2QwN2M4IiBzdEV2dDp3aGVuPSIyMDIzLTExLTEzVDAwOjE4OjAyKzAxOjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjUuMSAoV2luZG93cykiLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjQ4OWY1NzlmLTJkNjUtZWQ0Zi04OTg0LTA4NGE2MGE1ZTMzNSIgc3RFdnQ6d2hlbj0iMjAyMy0xMS0xNVQwMjowNDo1OSswMTowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIiBzdEV2dDpjaGFuZ2VkPSIvIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpiMmM0YTYwOS1iZmE3LWE4NDAtYjhhZS05NzMxNmYzNWRiMjciIHN0RXZ0OndoZW49IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCAyNS4xIChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4OTe6GAAAAx0lEQVR42u3WMQoAIQxFwRzJys77X8vSLiRgITif7bYbgrwYc/mKXyBoY4VVBgsWLFiwYFmOlTv+9jfDOjHmr8u6eVkGCxYsWLBgmc5S8ApewXvgYRksWLBgKXidpeBdloL3wMOCBctgwVLwCl7BuyyDBQsWLFiwTGcpeAWv4D3wsAwWLFiwFLzOUvAuS8F74GHBgmWwYCl4Ba/gXZbBggULFixYprMUvIJX8B54WAYLFixYCl5nKXiXpeA98LBgwTJYsGC9tg1o8f4TTtqzNQAAAABJRU5ErkJggg==",j.ColorPalette.colors.litegraph_base.CLEAR_BACKGROUND_COLOR="#09090b";const V=LGraphCanvas.node_colors.bgcolor,Y={ColorPalette:{id:"milk_white",name:"Milk White",colors:{node_slot:{CLIP:"#FFA726",CLIP_VISION:"#5C6BC0",CLIP_VISION_OUTPUT:"#8D6E63",CONDITIONING:"#EF5350",CONTROL_NET:"#66BB6A",IMAGE:"#42A5F5",LATENT:"#AB47BC",MASK:"#9CCC65",MODEL:"#7E57C2",STYLE_MODEL:"#D4E157",VAE:"#FF7043",PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},litegraph_base:{BACKGROUND_IMAGE:"data:image/gif;base64,R0lGODlhZABkALMAAAAAAP///+vr6+rq6ujo6Ofn5+bm5uXl5d3d3f///wAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAkALAAAAABkAGQAAAT/UMhJq7046827HkcoHkYxjgZhnGG6si5LqnIM0/fL4qwwIMAg0CAsEovBIxKhRDaNy2GUOX0KfVFrssrNdpdaqTeKBX+dZ+jYvEaTf+y4W66mC8PUdrE879f9d2mBeoNLfH+IhYBbhIx2jkiHiomQlGKPl4uZe3CaeZifnnijgkESBqipqqusra6vsLGys62SlZO4t7qbuby7CLa+wqGWxL3Gv3jByMOkjc2lw8vOoNSi0czAncXW3Njdx9Pf48/Z4Kbbx+fQ5evZ4u3k1fKR6cn03vHlp7T9/v8A/8Gbp4+gwXoFryXMB2qgwoMMHyKEqA5fxX322FG8tzBcRnMW/zlulPbRncmQGidKjMjyYsOSKEF2FBlJQMCbOHP6c9iSZs+UnGYCdbnSo1CZI5F64kn0p1KnTH02nSoV3dGTV7FFHVqVq1dtWcMmVQZTbNGu72zqXMuW7danVL+6e4t1bEy6MeueBYLXrNO5Ze36jQtWsOG97wIj1vt3St/DjTEORss4nNq2mDP3e7w4r1bFkSET5hy6s2TRlD2/mSxXtSHQhCunXo26NevCpmvD/UU6tuullzULH76q92zdZG/Ltv1a+W+osI/nRmyc+fRi1Xdbh+68+0vv10dH3+77KD/i6IdnX669/frn5Zsjh4/2PXju8+8bzc9/6fj27LFnX11/+IUnXWl7BJfegm79FyB9JOl3oHgSklefgxAC+FmFGpqHIYcCfkhgfCohSKKJVo044YUMttggiBkmp6KFXw1oII24oYhjiDByaKOOHcp3Y5BD/njikSkO+eBREQAAOw==",CLEAR_BACKGROUND_COLOR:"lightgray",NODE_TITLE_COLOR:"#222",NODE_SELECTED_TITLE_COLOR:"#000",NODE_TEXT_SIZE:14,NODE_TEXT_COLOR:"#444",NODE_SUBTEXT_SIZE:12,NODE_DEFAULT_COLOR:"#F7F7F7",NODE_DEFAULT_BGCOLOR:"#F5F5F5",NODE_DEFAULT_BOXCOLOR:"#555",NODE_DEFAULT_SHAPE:"box",NODE_BOX_OUTLINE_COLOR:"#000",DEFAULT_SHADOW_COLOR:"rgba(0,0,0,0.1)",DEFAULT_GROUP_FONT:24,WIDGET_BGCOLOR:"#D4D4D4",WIDGET_OUTLINE_COLOR:"#999",WIDGET_TEXT_COLOR:"#222",WIDGET_SECONDARY_TEXT_COLOR:"#555",LINK_COLOR:"#9A9",EVENT_LINK_COLOR:"#FF9800",CONNECTING_LINK_COLOR:"#222"},comfy_base:{"fg-color":"#222","bg-color":"#DDD","comfy-menu-bg":"#F5F5F5","comfy-input-bg":"#C9C9C9","input-text":"#222","descrip-text":"#444","drag-text":"#555","error-text":"#F44336","border-color":"#bbb","tr-even-bg-color":"#f9f9f9","tr-odd-bg-color":"#fff","content-bg":"#e0e0e0","content-fg":"#222","content-hover-bg":"#adadad","content-hover-fg":"#222"}}},NODE_COLORS:{red:{color:"#af3535",bgcolor:V,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:V,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:V,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:V,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:V,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:V,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:V,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:V,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:V,groupcolor:"#444"}}},H={"Workflow created by":"工作流创建者","Watch more video content":"观看更多视频内容","Workflow Guide":"工作流指南","💎 View Checkpoint Info...":"💎 查看 Checkpoint 信息...","💎 View Lora Info...":"💎 查看 Lora 信息...","🔃 Reload Node":"🔃 刷新节点","Updated At:":"最近更新:","Created At:":"首次发布:","✏️ Edit":"✏️ 编辑","💾 Save":"💾 保存","No notes":"当前还没有备注内容","Saving Notes...":"正在保存备注...","Type your notes here":"在这里输入备注内容",ModelName:"模型名称","Models Required":"所需模型","Download Model":"下载模型","Source Url":"模型源地址",Notes:"备注",Type:"类型","Trained Words":"训练词",BaseModel:"基础算法",Details:"详情",Description:"描述",Download:"下载量",Source:"来源","Saving Preview...":"正在保存预览图...","Saving Succeed":"保存成功","Clean SuccessFully":"清理成功","Clean Failed":"清理失败","Saving Failed":"保存失败","No COMBO link":"沒有找到COMBO连接","Reboot ComfyUI":"重启ComfyUI","Are you sure you'd like to reboot the server?":"是否要重启ComfyUI?","Nodes Map":"管理节点组","Nodes map sorting mode":"管理节点组排序模式","No Nodes":"未找到节点","No nodes found in the map":"在工作流程中没有找到节点","Expand All":"展开所有组","Collapse All":"折叠所有组",Close:"关闭","Default automatic sorting, if set to manual, groups can be dragged and dropped and the sorting results saved.":"默认自动排序,如果设置为手动,组可以拖放并保存排序结果。","For drag and drop sorting, please find Nodes map sorting mode in Settings->EasyUse and change it to manual":"如需拖拽排序请在设置->EasyUse节点中找到管理节点组排序模式并修改成 manual",Queue:"队列","Cleanup Of VRAM Usage":"清理显存占用","Please stop all running tasks before cleaning GPU":"请在清理GPU之前停止所有运行中的任务",Always:"启用中",Bypass:"已忽略",Never:"已停用","Auto Sorting":"自动排序","Toggle `Show/Hide` can set mode of group, LongPress can set group nodes to never":"点击`启用中/已忽略`可设置组模式, 长按可停用该组节点","Enable Shift+Up/Down/Left/Right key to align selected nodes":"启用 `Shift+上/下/左/右` 键对齐选中的节点","Enable Shift+g to add selected nodes to a group":"启用 `Shift+g` 键将选中的节点添加一个组","Enable Shift+r to unload models and node cache":"启用 `Shift+r` 键卸载模型和节点缓存","Enable Up/Down/Left/Right key to jump nearest nodes":"启用 `上/下/左/右` 键跳转到最近的前后节点","Enable ALT+1~9 to paste nodes from nodes template":"启用 `ALT+1~9` 从节点模板粘贴到工作流中","Enable contextMenu auto nest subdirectories":"启用上下文菜单自动嵌套子目录","Enable right-click menu to add node A~Z sorting":"启用右键菜单中新建节点A~Z排序","Enable model thumbnails display":"启动模型预览图显示","Enable nodes runtime display":"启动节点运行时间显示","Enable chain get node and set node with parent nodes":"启用将获取点和设置点与父节点链在一起","Maximum number of model thumbnails displayed":"显示的模型缩略图的最大数量","Too many thumbnails will affect the first loading time, set the maximum value to not load the thumbnail function when there are too many models's thumbnail":"太多的缩略图会影响首次加载时间,当模型缩略图太多时,设置最大值以不加载缩略图功能","Too many thumbnails, have closed the display":"模型缩略图太多啦,为您关闭了显示","Get styles list Failed":"获取样式列表失败","Get style image Failed":"获取样式图片失败","Empty All":"清空所有","Type here to search styles ...":"在此处输入以搜索样式 ...","Loading UserInfo...":"正在获取用户信息...","Please set the APIKEY first":"请先设置APIKEY","Setting APIKEY":"设置APIKEY","Save Account Info":"保存账号信息",Choose:"选择",Delete:"删除",Edit:"编辑","At least one account is required":"删除失败: 至少需要一个账户","APIKEY is not Empty":"APIKEY 不能为空","Add Account":"添加账号","Getting Your APIKEY":"获取您的APIKEY","Choose Selected Images":"选择选中的图片","Choose images to continue":"选择图片以继续",Background:"背景",Hat:"帽子",Hair:"头发",Body:"身体",Face:"脸部",Clothes:"衣服",Others:"其他",Glove:"手套",Sunglasses:"太阳镜","Upper-clothes":"上衣",Dress:"连衣裙",Coat:"外套",Socks:"袜子",Pants:"裤子",Jumpsuits:"连体衣",Scarf:"围巾",Skirt:"裙子","Left-arm":"左臂","Right-arm":"右臂","Left-leg":"左腿","Right-leg":"右腿","Left-shoe":"左鞋","Right-shoe":"右鞋",s:"秒","No Node Templates Found":"未找到节点模板预设","Get Node Templates File Failed":"获取节点模板文件失败","Node template with {key} not set":"未设置快捷键为{key}的节点预设","ComfyUI Basic":"ComfyUI 基础节点","Recommend Nodes":"推荐节点","Others A~Z":"其他节点 A~Z"},X=I("AGL.Locale"),Z=(e,t=!1)=>"zh-CN"===(t?navigator.language:X)&&H[e]||e,K={addGroup:{id:"EasyUse.Hotkeys.AddGroup",name:Z("Enable Shift+g to add selected nodes to a group"),type:"boolean",defaultValue:!0},cleanVRAMUsed:{id:"EasyUse.Hotkeys.cleanVRAMUsed",name:Z("Enable Shift+r to unload models and node cache"),type:"boolean",defaultValue:!0},alignSelectedNodes:{id:"EasyUse.Hotkeys.AlignSelectedNodes",name:Z("Enable Shift+Up/Down/Left/Right key to align selected nodes"),type:"boolean",defaultValue:!0},nodesTemplate:{id:"EasyUse.Hotkeys.NodesTemplate",name:Z("Enable ALT+1~9 to paste nodes from nodes template"),type:"boolean",defaultValue:!0},jumpNearestNodes:{id:"EasyUse.Hotkeys.JumpNearestNodes",name:Z("Enable Up/Down/Left/Right key to jump nearest nodes"),type:"boolean",defaultValue:!0},subDirectories:{id:"EasyUse.ContextMenu.SubDirectories",name:Z("Enable contextMenu auto nest subdirectories"),type:"boolean",defaultValue:!1},modelsThumbnails:{id:"EasyUse.ContextMenu.ModelsThumbnails",name:Z("Enable model thumbnails display"),type:"boolean",defaultValue:!1},modelsThumbnailsLimit:{id:"EasyUse.ContextMenu.ModelsThumbnailsLimit",name:Z("Maximum number of model thumbnails displayed"),tooltip:Z("Too many thumbnails will affect the first loading time, set the maximum value to not load the thumbnail function when there are too many models's thumbnail"),type:"slider",attrs:{min:0,max:5e3,step:100},defaultValue:500},rightMenuNodesSort:{id:"EasyUse.ContextMenu.NodesSort",name:Z("Enable right-click menu to add node A~Z sorting"),type:"boolean",defaultValue:!0},nodesRuntime:{id:"EasyUse.Nodes.Runtime",name:Z("Enable nodes runtime display"),type:"boolean",defaultValue:!0},chainGetSet:{id:"EasyUse.Nodes.ChainGetSet",name:Z("Enable chain get node and set node with parent nodes"),type:"boolean",defaultValue:!0},nodesMap:{id:"EasyUse.NodesMap.Sorting",name:Z("Nodes map sorting mode"),tooltip:Z("Default automatic sorting, if set to manual, groups can be dragged and dropped and the sorting results saved."),type:"combo",options:["Auto sorting","Manual drag&drop sorting"],defaultValue:"Auto sorting"}};function J(e=100,t){return new Promise((n=>{setTimeout((()=>{n(t)}),e)}))}const $=new class{constructor(){f(this,"element",L(`div.${D}toast`)),f(this,"children",HTMLElement),f(this,"container",document.body),this.container.appendChild(this.element)}async show(e){let t=L(`div.${D}toast-container`,[L("div",[L("span",[...e.icon?[L("i",{className:e.icon})]:[],L("span",e.content)])])]);t.setAttribute("toast-id",e.id),this.element.replaceChildren(t),this.container.appendChild(this.element),await J(64),t.style.marginTop=`-${t.offsetHeight}px`,await J(64),t.classList.add("show"),e.duration&&(await J(e.duration),this.hide(e.id))}async hide(e){const t=document.querySelector(`.${D}toast > [toast-id="${e}"]`);(null==t?void 0:t.classList.contains("show"))&&(t.classList.remove("show"),await J(750)),t&&t.remove()}async clearAllMessages(){let e=document.querySelector(`.${D}container`);e&&(e.innerHTML="")}async info(e,t=3e3,n=[]){this.show({id:"toast-info",icon:`mdi mdi-information ${D}theme`,content:e,duration:t})}async success(e,t=3e3){this.show({id:"toast-success",icon:`mdi mdi-check-circle ${D}success`,content:e,duration:t})}async error(e,t=3e3){this.show({id:"toast-error",icon:`mdi mdi-close-circle ${D}error`,content:e,duration:t})}async warn(e,t=3e3){this.show({id:"toast-warn",icon:`mdi mdi-alert-circle ${D}warning`,content:e,duration:t})}async showLoading(e,t=0){this.show({id:"toast-loading",icon:"mdi mdi-rotate-right loading",content:e,duration:t})}async hideLoading(){this.hide("toast-loading")}},q=async()=>{try{const{Running:e,Pending:t}=await b.getQueue();if(e.length>0||t.length>0)return void $.error(Z("Clean Failed")+":"+Z("Please stop all running tasks before cleaning GPU"));200==(await b.fetchApi("/easyuse/cleangpu",{method:"POST"})).status?$.success(Z("Clean SuccessFully")):$.error(Z("Clean Failed"))}catch(e){}},Q=y("groups",{state:e=>({groups:[],nodes:[],nodesDefs:{},agl:{},isWatching:!1}),getters:{groups_nodes(){var e;let t=[],n=[];if((null==(e=this.nodes)?void 0:e.length)>0){this.nodes.map((e=>{let s=e.pos,o=!1;for(let n=0;ni.pos[0]&&s[0]i.pos[1]&&s[1]e.pos[0]-t.pos[0])).sort(((e,t)=>e.pos[1]-t.pos[1])))},setNodes(e){this.nodes=v(e)},update(){(w.extensionManager.activeSidebarTab===B||this.isWatching)&&setTimeout((e=>{this.setGroups(w.canvas.graph._groups),this.setNodes(w.canvas.graph._nodes)}),1)},watchGraph(e=!1){e&&(this.isWatching=!0);let t=this;this.update();const n=w.graph.onNodeAdded;w.graph.onNodeAdded=function(e){t.update();const s=e.onRemoved;return e.onRemoved=function(){return t.update(),null==s?void 0:s.apply(this,arguments)},null==n?void 0:n.apply(this,arguments)},w.canvas.onNodeMoved=function(e){t.update()};const s=LGraphCanvas.onNodeAlign;LGraphCanvas.onNodeAlign=function(e){return t.update(),null==s?void 0:s.apply(this,arguments)};const o=LGraphCanvas.onGroupAdd;LGraphCanvas.onGroupAdd=function(){return t.update(),null==o?void 0:o.apply(this,arguments)};const i=LGraphCanvas.onGroupAlign;LGraphCanvas.onGroupAlign=function(e){return t.update(),null==i?void 0:i.apply(this,arguments)};const a=LGraphCanvas.onMenuNodeRemove;LGraphCanvas.onMenuNodeRemove=function(e){return t.update(),null==a?void 0:a.apply(this,arguments)}},unwatchGraph(){this.isWatching=!1},async getNodesDef(){this.agl=await(async()=>{let e=new FormData;e.append("locale",X);const t=await b.fetchApi("/agl/get_translation",{method:"POST",body:e});if(200==t.status){const e=await t.json();return e&&"{}"!=e?{nodeCategory:e.NodeCategory,nodes:e.Nodes}:null}return null})(),await b.getNodeDefs()}}});let ee=null;const te=["custom_obsidian","custom_obsidian_dark","custom_milk_white"],ne={"easy positive":"green","easy negative":"red","easy promptList":"cyan","easy promptLine":"cyan","easy promptConcat":"cyan","easy promptReplace":"cyan","easy forLoopStart":"blue","easy forLoopEnd":"blue"};let se=LGraphCanvas.node_colors,oe=null,ie=null,ae=null,le=null;for(let vn in K)"Disabled"==I("Comfy.UseNewMenu")?T({...K[vn],name:"👽 "+K[vn].name}):T(K[vn]);function re(e,t=!1){let n="after",s="before";t&&([s,n]=[n,s]),e.label=(e.label??e.name).replace(s,n),e.name=e.label}function de(e,t,n,s,o,i,a){t.strokeStyle=s,t.fillStyle=o;let l=LiteGraph.NODE_TITLE_HEIGHT,r=this.ds.scale<.5,d=e._shape||e.constructor.shape||LiteGraph.ROUND_SHAPE,u=e.constructor.title_mode,c=!0;u==LiteGraph.TRANSPARENT_TITLE||u==LiteGraph.NO_TITLE?c=!1:u==LiteGraph.AUTOHIDE_TITLE&&mouse_over&&(c=!0);let p=new Float32Array(4);p=[0,c?-l:0,n[0]+1,c?n[1]+l:n[1]];let h=t.globalAlpha;if(t.lineWidth=1,t.beginPath(),d==LiteGraph.BOX_SHAPE||r?t.fillRect(p[0],p[1],p[2],p[3]):d==LiteGraph.ROUND_SHAPE||d==LiteGraph.CARD_SHAPE?t.roundRect(p[0],p[1],p[2],p[3],d==LiteGraph.CARD_SHAPE?[this.round_radius,this.round_radius,0,0]:[this.round_radius]):d==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*n[0],.5*n[1],.5*n[0],0,2*Math.PI),t.strokeStyle=LiteGraph.WIDGET_OUTLINE_COLOR,t.stroke(),t.strokeStyle=s,t.fill(),!e.flags.collapsed&&c&&(t.shadowColor="transparent",t.fillStyle="rgba(0,0,0,0.2)",t.fillRect(0,-1,p[2],2)),t.shadowColor="transparent",e.onDrawBackground&&e.onDrawBackground(t,this,this.canvas,this.graph_mouse),c||u==LiteGraph.TRANSPARENT_TITLE){const o="dark"==function(e){let t=e.replace("#","");return n=parseInt(t.substring(0,2),16),s=parseInt(t.substring(2,4),16),o=parseInt(t.substring(4,6),16),.299*n+.587*s+.114*o>127.5?"light":"dark";var n,s,o}((null==e?void 0:e.color)||"#ffffff");if(e.onDrawTitleBar)e.onDrawTitleBar(t,l,n,this.ds.scale,s);else if(u!=LiteGraph.TRANSPARENT_TITLE&&(e.constructor.title_color||this.render_title_colored)){let o=e.constructor.title_color||s;if(e.flags.collapsed&&(t.shadowColor=LiteGraph.DEFAULT_SHADOW_COLOR),this.use_gradients){let e=LGraphCanvas.gradients[o];e||(e=LGraphCanvas.gradients[o]=t.createLinearGradient(0,0,400,0),e.addColorStop(0,o),e.addColorStop(1,"#000")),t.fillStyle=e}else t.fillStyle=o;t.beginPath(),d==LiteGraph.BOX_SHAPE||r?t.rect(0,-l,n[0]+1,l):d!=LiteGraph.ROUND_SHAPE&&d!=LiteGraph.CARD_SHAPE||t.roundRect(0,-l,n[0]+1,l,e.flags.collapsed?[this.round_radius]:[this.round_radius,this.round_radius,0,0]),t.fill(),t.shadowColor="transparent"}let a=!1;LiteGraph.node_box_coloured_by_mode&&LiteGraph.NODE_MODES_COLORS[e.mode]&&(a=LiteGraph.NODE_MODES_COLORS[e.mode]),LiteGraph.node_box_coloured_when_on&&(a=e.action_triggered?"#FFF":e.execute_triggered?"#AAA":a);let c=10;if(e.onDrawTitleBox)e.onDrawTitleBox(t,l,n,this.ds.scale);else if(d==LiteGraph.ROUND_SHAPE||d==LiteGraph.CIRCLE_SHAPE||d==LiteGraph.CARD_SHAPE){const n=o?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR,s=o?"#eeeeee":e.boxcolor||a||LiteGraph.NODE_DEFAULT_BOXCOLOR;t.fillStyle=i?n:s,t.beginPath(),t.fillRect(10,0-1.05*c-1,1.1*c,.125*c),t.fillRect(10,0-1.45*c-1,1.1*c,.125*c),t.fillRect(10,0-1.85*c-1,1.1*c,.125*c)}else t.fillStyle=e.boxcolor||a||LiteGraph.NODE_DEFAULT_BOXCOLOR,t.fillRect(.5*(l-c),-.5*(l+c),c,c);if(t.globalAlpha=h,e.onDrawTitleText&&e.onDrawTitleText(t,l,n,this.ds.scale,this.title_text_font,i),!r){t.font=this.title_text_font;let n=String(e.getTitle());n&&(t.fillStyle=i?o?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR:o?"#ffffff":e.constructor.title_text_color||this.node_title_color,e.flags.collapsed?(t.textAlign="left",t.measureText(n),t.fillText(n.substr(0,20),l,LiteGraph.NODE_TITLE_TEXT_Y-l),t.textAlign="left"):(t.textAlign="left",t.fillText(n,l,LiteGraph.NODE_TITLE_TEXT_Y-l)))}if(!e.flags.collapsed&&e.subgraph&&!e.skip_subgraph_button){let n=LiteGraph.NODE_TITLE_HEIGHT,s=e.size[0]-n,o=LiteGraph.isInsideRectangle(this.graph_mouse[0]-e.pos[0],this.graph_mouse[1]-e.pos[1],s+2,2-n,n-4,n-4);t.fillStyle=o?"#888":"#555",d==LiteGraph.BOX_SHAPE||r?t.fillRect(s+2,2-n,n-4,n-4):(t.beginPath(),t.roundRect(s+2,2-n,n-4,n-4,[4]),t.fill()),t.fillStyle="#333",t.beginPath(),t.moveTo(s+.2*n,.6*-n),t.lineTo(s+.8*n,.6*-n),t.lineTo(s+.5*n,.3*-n),t.fill()}e.onDrawTitle&&e.onDrawTitle(t)}if(i){e.onBounding&&e.onBounding(p),u==LiteGraph.TRANSPARENT_TITLE&&(p[1]-=l,p[3]+=l),t.lineWidth=2,t.globalAlpha=.8,t.beginPath();let o=0,i=0,a=1;d==LiteGraph.BOX_SHAPE?t.rect(o+p[0],o+p[1],i+p[2],i+p[3]):d==LiteGraph.ROUND_SHAPE||d==LiteGraph.CARD_SHAPE&&e.flags.collapsed?t.roundRect(o+p[0],o+p[1],i+p[2],i+p[3],[this.round_radius*a]):d==LiteGraph.CARD_SHAPE?t.roundRect(o+p[0],o+p[1],i+p[2],i+p[3],[this.round_radius*a,a,this.round_radius*a,a]):d==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*n[0],.5*n[1],.5*n[0]+6,0,2*Math.PI),t.strokeStyle=LiteGraph.NODE_BOX_OUTLINE_COLOR,t.stroke(),t.strokeStyle=s,t.globalAlpha=1}e.execute_triggered>0&&e.execute_triggered--,e.action_triggered>0&&e.action_triggered--}function ue(e,t,n,s){if(!e.widgets||!e.widgets.length)return 0;let o=e.size[0],i=e.widgets;t+=2;let a=LiteGraph.NODE_WIDGET_HEIGHT,l=this.ds.scale>.5;n.save(),n.globalAlpha=this.editor_alpha;let r=LiteGraph.WIDGET_OUTLINE_COLOR,d=LiteGraph.WIDGET_BGCOLOR,u=LiteGraph.WIDGET_TEXT_COLOR,c=LiteGraph.WIDGET_SECONDARY_TEXT_COLOR,p=12;for(let h=0;h1&&(o=1),n.fillStyle=m.options.hasOwnProperty("slider_color")?m.options.slider_color:s==m?r:G,n.beginPath(),n.roundRect(p,g,o*(f-24),a,[.25*a]),n.fill(),m.marker){let e=(m.marker-m.options.min)/t;e<0&&(e=0),e>1&&(e=1),n.fillStyle=m.options.hasOwnProperty("marker_color")?m.options.marker_color:"#AA9",n.roundRect(p+e*(f-24),g,2,a,[.25*a])}if(l){n.textAlign="center",n.fillStyle=u;let e=(m.label||m.name)+": "+Number(m.value).toFixed(null!=m.options.precision?m.options.precision:3).toString();n.fillText(e,.5*f,g+.7*a)}break;case"number":case"combo":if(n.textAlign="left",n.strokeStyle=r,n.fillStyle=d,n.beginPath(),l?n.roundRect(p,g,f-24,a,[.25*a]):n.rect(p,g,f-24,a),n.fill(),l){m.disabled||n.stroke(),n.fillStyle=u,m.disabled||(n.beginPath(),n.moveTo(24,g+6.5),n.lineTo(18,g+.5*a),n.lineTo(24,g+a-6.5),n.fill(),n.beginPath(),n.moveTo(f-p-12,g+6.5),n.lineTo(f-p-6,g+.5*a),n.lineTo(f-p-12,g+a-6.5),n.fill()),n.fillStyle=c,n.font="10px Inter",n.fillText(m.label||m.name,29,g+.7*a),n.fillStyle=u,n.textAlign="right";let e=6;if("number"==m.type)n.font="10px Inter",n.fillText(Number(m.value).toFixed(void 0!==m.options.precision?m.options.precision:3),f-24-e,g+.7*a);else{let t=m.value;if(m.options.values){let e=m.options.values;e.constructor===Function&&(e=e()),e&&e.constructor!==Array&&(t=e[m.value])}n.fillText(t,f-24-e,g+.7*a)}}break;case"string":case"text":if(n.textAlign="left",n.strokeStyle=r,n.fillStyle=d,n.beginPath(),l?n.roundRect(p,g,f-24,a,[.25*a]):n.rect(p,g,f-24,a),n.fill(),l){m.disabled||n.stroke(),n.save(),n.beginPath(),n.rect(p,g,f-24,a),n.clip(),n.fillStyle=c;const e=m.label||m.name;n.font="10px Inter",null!=e&&n.fillText(e,24,g+.7*a),n.fillStyle=u,n.textAlign="right",n.fillText(String(m.value).substr(0,30),f-24,g+.7*a),n.restore()}break;default:m.draw&&m.draw(n,e,f,g,a)}t+=(m.computeSize?m.computeSize(f)[1]:a)+4,n.globalAlpha=this.editor_alpha}n.restore(),n.textAlign="left"}function ce(e,t,n,s,o){return new LiteGraph.ContextMenu(LiteGraph.NODE_MODES,{event:n,callback:function(e){if(!o)return;var t=Object.values(LiteGraph.NODE_MODES).indexOf(e),n=function(e){t>=0&&LiteGraph.NODE_MODES[t]?e.changeMode(t):e.changeMode(LiteGraph.ALWAYS),ee||(ee=Q()),ee.update()},s=LGraphCanvas.active_canvas;if(!s.selected_nodes||Object.keys(s.selected_nodes).length<=1)n(o);else for(var i in s.selected_nodes)n(s.selected_nodes[i])},parentMenu:s,node:o}),!1}function pe(e,t,n,s,o){if(!o)throw"no node for color";var i=[];for(var a in i.push({value:null,content:"No color"}),LGraphCanvas.node_colors){var l=LGraphCanvas.node_colors[a];e={value:a,content:""+a+""};i.push(e)}return new LiteGraph.ContextMenu(i,{event:n,callback:function(e){if(!o)return;var t=e.value?LGraphCanvas.node_colors[e.value]:null,n=function(e){t?e.constructor===LiteGraph.LGraphGroup?e.color=t.groupcolor:(e.color=t.color,e.bgcolor=t.bgcolor):(delete e.color,delete e.bgcolor),ee||(ee=Q()),ee.update()},s=LGraphCanvas.active_canvas;if(!s.selected_nodes||Object.keys(s.selected_nodes).length<=1)n(o);else for(var i in s.selected_nodes)n(s.selected_nodes[i]);o.setDirtyCanvas(!0,!0)},parentMenu:s,node:o}),!1}function he(e,t,n,s,o){var i=e.property||"title",a=o[i],l=document.createElement("div");l.is_modified=!1,l.className="graphdialog",l.innerHTML="",l.close=function(){l.parentNode&&l.parentNode.removeChild(l)},l.querySelector(".name").innerText=i;var r=l.querySelector(".value");r&&(r.value=a,r.addEventListener("blur",(function(e){this.focus()})),r.addEventListener("keydown",(function(e){if(l.is_modified=!0,27==e.keyCode)l.close();else if(13==e.keyCode)m();else if(13!=e.keyCode&&"textarea"!=e.target.localName)return;e.preventDefault(),e.stopPropagation()})));var d=LGraphCanvas.active_canvas.canvas,u=d.getBoundingClientRect(),c=-20,p=-20;u&&(c-=u.left,p-=u.top),event?(l.style.left=event.clientX+c+"px",l.style.top=event.clientY+p+"px"):(l.style.left=.5*d.width+c+"px",l.style.top=.5*d.height+p+"px"),l.querySelector("button").addEventListener("click",m),d.parentNode.appendChild(l),r&&r.focus();var h=null;function m(){r&&function(t){"Number"==e.type?t=Number(t):"Boolean"==e.type&&(t=Boolean(t));o[i]=t,l.parentNode&&l.parentNode.removeChild(l);o.setDirtyCanvas(!0,!0),ee||(ee=Q());ee.update()}(r.value)}l.addEventListener("mouseleave",(function(e){LiteGraph.dialog_close_on_mouse_leave&&!l.is_modified&&LiteGraph.dialog_close_on_mouse_leave&&(h=setTimeout(l.close,LiteGraph.dialog_close_on_mouse_leave_delay))})),l.addEventListener("mouseenter",(function(e){LiteGraph.dialog_close_on_mouse_leave&&h&&clearTimeout(h)}))}w.registerExtension({name:"Comfy.EasyUse.UI",init(){var e,t;const n="Comfy.CustomColorPalettes",s="Comfy.Settings.Comfy.CustomColorPalettes";if(ie||(ie=I(n,s)),ae||(ae=I("Comfy.ColorPalette","Comfy.Settings.Comfy.ColorPalette")||"dark"),(!(null==(e=null==ie?void 0:ie.obsidian)?void 0:e.version)||ie.obsidian.version{(null==e?void 0:e.value)&&(null==e?void 0:e.oldValue)&&(await J(1),Object.assign(w.canvas.default_connection_color_byType,M),Object.assign(LGraphCanvas.link_type_colors,M)),"custom_milk_white"==e.value&&document.body.classList.remove(R)})),setTimeout((e=>ge(I("Comfy.UseNewMenu")||"Disabled")),1)},async nodeCreated(e){var t;if(ne.hasOwnProperty(e.comfyClass)){const t=ne[e.comfyClass],n=se[t];if(!n)return;n.color&&(e.color=n.color),n.bgcolor&&(e.bgcolor=n.bgcolor)}if(oe||(oe=I("Comfy.WidgetControlMode")),"before"==oe){const n="before"==oe;if((null==(t=e.widgets)?void 0:t.length)>0)for(const t of e.widgets)if(["control_before_generate","control_after_generate"].includes(t.name)&&(await re(t,n),t.linkedWidgets))for(const e of t.linkedWidgets)await re(e,n)}}});const me=null==(m=w.ui.settings.settingsLookup)?void 0:m["Comfy.UseNewMenu"];me&&(me.onChange=e=>ge(e));const ge=e=>{var t;const n=(null==(t=document.getElementById("crystools-root"))?void 0:t.children)||null;if((null==n?void 0:n.length)>0){if(!le)for(let e=0;ee.widgets.find((e=>e.name===t)),_e=(e,t,n=!1,s="")=>{var o;if(!t||((e,t)=>!!e.inputs&&e.inputs.some((e=>e.name===t)))(e,t.name))return;fe[t.name]||(fe[t.name]={origType:t.type,origComputeSize:t.computeSize});const i=e.size;t.type=n?fe[t.name].origType:"easyHidden"+s,t.computeSize=n?fe[t.name].origComputeSize:()=>[0,-4],null==(o=t.linkedWidgets)||o.forEach((s=>_e(e,s,":"+t.name,n)));const a=n?Math.max(e.computeSize()[1],i[1]):e.size[1];e.setSize([e.size[0],a])},ve=(e,t=0)=>{var n,s;if(e)return(null==(n=e.widgets)?void 0:n[t])?e.widgets[t].value:e.widgets_values?null==(s=e.widgets_values)?void 0:s[t]:void 0},we=e=>e.setSize([e.size[0],e.computeSize()[1]]),be=(e,t)=>graph.getNodeById(e),Le=e=>{var t;try{return Object.values(null==(t=null==graph?void 0:graph.list_of_graphcanvas[0])?void 0:t.selected_nodes)}catch(n){return[]}};function Se(e,t,n){return e+(s=n,(.5-.5*Math.cos(Math.PI*s))*(t-e));var s}const Ee=(e,t=!0)=>{var n,s;const o=(null==(s=null==(n=e.graph)?void 0:n.list_of_graphcanvas)?void 0:s[0])||null;if(!o)return;const[i,a]=e.pos,[l,r]=e.size;(([e,t],n)=>{const s=n.ds,o=document.body.clientWidth,i=document.body.clientHeight,a=s.scale,l=.5*o/a-e,r=.5*i/a-t,d=Date.now()+250,u=s.offset[0],c=s.offset[1],p=()=>{const e=d-Date.now();if(!(Date.now(){const t=be(e);t&&Ee(t)},Ae=(e,t=(()=>graph.links??[])())=>t[e],ke=e=>e.toLowerCase().replace(/_./g,(e=>e.replace("_","").toUpperCase())),Ie=e=>"easy getNode"===e.type,xe=e=>"easy setNode"===e.type,Ne=e=>Ie(e)||xe(e),Te=(e=(()=>graph._nodes??[])())=>e.filter((e=>Ne(e))),Oe=(e,t,n=0)=>{e.widgets_values||(e.widgets_values=[]),e.widgets_values[n]=t,e.widgets[n].value=t},De=e=>graph.add(e),Re=e=>graph.remove(e),Ge=(e,t=0)=>{var n,s;if("Reroute"!==e.type)return[e,t];const o=e,i=null==(s=null==(n=o.inputs)?void 0:n[0])?void 0:s.link;if(!i)return[o,t];const a=Ae(i);if(!a)return[o,t];const l=be(a.origin_id);return l?(setTimeout((()=>{Re(o)})),Ge(l,a.origin_slot)):[o,t]},Me=e=>{var t,n,s;if("Reroute"!==e.type)return e;const o=e,i=null==(n=null==(t=o.outputs)?void 0:t[0])?void 0:n.links;if(!i)return o;const a=i[0];if(!a)return o;const l=Ae(a);if(!l)return o;const r=be(l.target_id);return r?(1===(null==(s=o.outputs[0].links)?void 0:s.length)&&setTimeout((()=>{Re(o)})),Me(r)):o},Pe=["rescale_after_model","rescale","lora_name","upscale_method","image_output","add_noise","info","sampler_name","ckpt_B_name","ckpt_C_name","save_model","refiner_ckpt_name","num_loras","num_controlnet","mode","toggle","resolution","ratio","target_parameter","input_count","replace_count","downscale_mode","range_mode","text_combine_mode","input_mode","lora_count","ckpt_count","conditioning_mode","preset","use_tiled","use_batch","num_embeds","easing_mode","guider","scheduler","inpaint_mode","t5_type","rem_mode"],Fe=["LIGHT - SD1.5 only (low strength)","STANDARD (medium strength)","VIT-G (medium strength)","PLUS (high strength)","PLUS FACE (portraits)","FULL FACE - SD1.5 only (portraits stronger)"],Ue=["FACEID","FACEID PLUS - SD1.5 only","FACEID PLUS V2","FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"],Be=["easy seed","easy latentNoisy","easy wildcards","easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingSdTurbo","easy preSamplingCascade","easy preSamplingDynamicCFG","easy preSamplingLayerDiffusion","easy fullkSampler","easy fullCascadeKSampler"],ze=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy hyditLoader","easy pixArtLoader"],We=["easy imageSize","easy imageSizeBySide","easy imageSizeByLongerSide","easy imageSizeShow","easy imageRatio","easy imagePixelPerfect"],je=["easy forLoopStart","easy forLoopEnd","easy whileLoopStart","easy whileLoopEnd"],Ve=["easy anythingIndexSwitch","easy imageIndexSwitch","easy textIndexSwitch","easy conditioningIndexSwitch"],Ye=[...je,...Ve],He={"easy anythingIndexSwitch":"value","easy imageIndexSwitch":"image","easy textIndexSwitch":"text","easy conditioningIndexSwitch":"cond"};function Xe(e,t){const n=e.comfyClass,s=t.value;switch(t.name){case"range_mode":_e(e,ye(e,"step"),"step"==s),_e(e,ye(e,"num_steps"),"num_steps"==s),we(e);break;case"text_combine_mode":_e(e,ye(e,"replace_text"),"replace"==s);break;case"lora_name":["lora_model_strength","lora_clip_strength"].map((t=>_e(e,ye(e,t),"None"!==s)));break;case"resolution":"自定义 x 自定义"===s&&(t.value="width x height (custom)"),["empty_latent_width","empty_latent_height"].map((t=>_e(e,ye(e,t),"width x height (custom)"===s)));break;case"ratio":["empty_latent_width","empty_latent_height"].map((t=>_e(e,ye(e,t),"custom"===s)));break;case"num_loras":var o=s+1,i=ye(e,"mode").value;for(let t=0;t_e(e,ye(e,t),"simple"!==i)));for(let t=o;t<21;t++)["lora_"+t+"_name","lora_"+t+"_strength","lora_"+t+"_model_strength","lora_"+t+"_clip_strength"].map((t=>_e(e,ye(e,t),!1)));we(e);break;case"num_controlnet":o=s+1,i=ye(e,"mode").value;for(let t=0;t_e(e,ye(e,t),!0))),["start_percent_"+t,"end_percent_"+t].map((t=>_e(e,ye(e,t),"simple"!==i)));for(let t=o;t<21;t++)["controlnet_"+t,"controlnet_"+t+"_strength","scale_soft_weight_"+t,"start_percent_"+t,"end_percent_"+t].map((t=>_e(e,ye(e,t),!1)));we(e);break;case"mode":switch(null==e?void 0:e.comfyClass){case"easy loraStack":o=ye(e,"num_loras").value+1,i=s;for(let t=0;t_e(e,ye(e,t),"simple"!==i)));we(e);break;case"easy controlnetStack":o=ye(e,"num_controlnet").value+1,i=s;for(let t=0;t_e(e,ye(e,t),"simple"!==i)));we(e);break;case"easy icLightApply":i=s;["lighting","remove_bg"].map((t=>_e(e,ye(e,t),"Foreground"===i))),_e(e,ye(e,"source"),"Foreground"!==i),we(e)}break;case"toggle":t.type="toggle",t.options={on:"Enabled",off:"Disabled"};break;case"t5_type":["clip_name","padding"].map((t=>_e(e,ye(e,t),"sd3"==s))),["t5_name","device","dtype"].map((t=>_e(e,ye(e,t),"t5v11"==s))),we(e);break;case"preset":if(Fe.includes(s)){let t=ye(e,"use_tiled");_e(e,ye(e,"lora_strength")),_e(e,ye(e,"provider")),_e(e,ye(e,"weight_faceidv2")),_e(e,ye(e,"weight_kolors")),_e(e,ye(e,"use_tiled"),!0),_e(e,ye(e,"sharpening"),t&&t.value)}else Ue.includes(s)&&(_e(e,ye(e,"weight_faceidv2"),!!["FACEID PLUS V2","FACEID PLUS KOLORS"].includes(s)),_e(e,ye(e,"weight_kolors"),!!["FACEID PLUS KOLORS"].includes(t.value)),["FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"].includes(s)?_e(e,ye(e,"lora_strength"),!1):_e(e,ye(e,"lora_strength"),!0),_e(e,ye(e,"provider"),!0),_e(e,ye(e,"use_tiled")),_e(e,ye(e,"sharpening")));we(e);break;case"use_tiled":_e(e,ye(e,"sharpening"),!!s),we(e);break;case"num_embeds":o=s+1;for(let t=0;t_e(e,ye(e,t),!1)));break;case"brushnet_random":case"brushnet_segmentation":["dtype","scale","start_at","end_at"].map((t=>_e(e,ye(e,t),!0))),["fitting","function"].map((t=>_e(e,ye(e,t),!1)));break;case"powerpaint":["dtype","fitting","function","scale","start_at","end_at"].map((t=>_e(e,ye(e,t),!0)))}we(e);break;case"image_output":_e(e,ye(e,"link_id"),!!["Sender","Sender&Save"].includes(s)),_e(e,ye(e,"decode_vae_name"),!!["Hide","Hide&Save"].includes(s)),["save_prefix","output_path","embed_workflow","number_padding","overwrite_existing"].map((t=>_e(e,ye(e,t),!!["Save","Hide&Save","Sender&Save"].includes(s))));break;case"add_noise":var a=ye(e,"control_before_generate"),l=ye(e,"control_after_generate")||a;"disable"===s?(_e(e,ye(e,"seed")),l&&(l.last_value=l.value,l.value="fixed",_e(e,l))):(_e(e,ye(e,"seed"),!0),l&&((null==l?void 0:l.last_value)&&(l.value=l.last_value),_e(e,l,!0))),we(e);break;case"guider":switch(s){case"Basic":["cfg","cfg_negative"].map((t=>_e(e,ye(e,t))));break;case"CFG":_e(e,ye(e,"cfg"),!0),_e(e,ye(e,"cfg_negative"));break;case"IP2P+DualCFG":case"DualCFG":["cfg","cfg_negative"].map((t=>_e(e,ye(e,t),!0)))}we(e);break;case"scheduler":["karrasADV","exponentialADV","polyExponential"].includes(s)?(["sigma_max","sigma_min"].map((t=>_e(e,ye(e,t),!0))),["denoise","beta_d","beta_min","eps_s","coeff"].map((t=>_e(e,ye(e,t))),!1),_e(e,ye(e,"rho"),"exponentialADV"!=s)):"vp"==s?(["sigma_max","sigma_min","denoise","rho","coeff"].map((t=>_e(e,ye(e,t)))),["beta_d","beta_min","eps_s"].map((t=>_e(e,ye(e,t),!0)))):(["sigma_max","sigma_min","beta_d","beta_min","eps_s","rho"].map((t=>_e(e,ye(e,t)))),_e(e,ye(e,"coeff"),"gits"==s),_e(e,ye(e,"denoise"),!0)),we(e);break;case"conditioning_mode":["replace","concat","combine"].includes(s)?["average_strength","old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>_e(e,ye(e,t)))):"average"==s?(_e(e,ye(e,"average_strength"),!0),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>_e(e,ye(e,t),!1)))):"timestep"==s&&(["average_strength"].map((t=>_e(e,ye(e,t),!1))),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>_e(e,ye(e,t)))));break;case"rescale":ye(e,"rescale_after_model").value,_e(e,ye(e,"width"),"to Width/Height"===s),_e(e,ye(e,"height"),"to Width/Height"===s),_e(e,ye(e,"percent"),"by percentage"===s),_e(e,ye(e,"longer_side"),"to longer side - maintain aspect"===s),we(e);break;case"upscale_method":["factor","crop"].map((t=>_e(e,ye(e,t),"None"!==s)));break;case"target_parameter":switch(n){case"easy XYInputs: Steps":["first_step","last_step"].map((t=>_e(e,ye(e,t),"steps"==s))),["first_start_step","last_start_step"].map((t=>_e(e,ye(e,t),"start_at_step"==s))),["first_end_step","last_end_step"].map((t=>_e(e,ye(e,t),"end_at_step"==s)));break;case"easy XYInputs: Sampler/Scheduler":let t=ye(e,"input_count").value+1;for(let n=0;n_e(e,ye(e,t),"strength"==s))),["first_start_percent","last_start_percent"].map((t=>_e(e,ye(e,t),"start_percent"==s))),["first_end_percent","last_end_percent"].map((t=>_e(e,ye(e,t),"end_percent"==s))),["strength","start_percent","end_percent"].map((t=>_e(e,ye(e,t),s!=t))),we(e)}case"replace_count":o=s+1;for(let t=0;t_e(e,ye(e,t),!r)));for(let t=o;t<11;t++)["lora_name_"+t,"model_str_"+t,"clip_str_"+t].map((t=>_e(e,ye(e,t),!1)));we(e);break;case"ckpt_count":o=s+1;var d=-1!=ye(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=ye(e,"input_mode").value.indexOf("VAE");for(let t=0;t_e(e,ye(e,t),!1)));we(e);break;case"input_count":o=s+1;var c=ye(e,"target_parameter").value;for(let t=0;t_e(e,ye(e,n),!t)));["model_strength","clip_strength"].map((n=>_e(e,ye(e,n),!t)));break;case"easy XYInputs: Checkpoint":o=ye(e,"ckpt_count").value+1,d=-1!=ye(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=ye(e,"input_mode").value.indexOf("VAE");for(let n=0;ne.name===t));if(-1!==e){for(let t=e;t{var e;const t=this.computeSize();t[0]"info"===e.name));if(-1!==e&&this.widgets[e]){this.widgets[e].value=t}}requestAnimationFrame((()=>{var e;const t=this.computeSize();t[0]"prompt"==e.name));this.addWidget("button","get values from COMBO link","",(()=>{var t,s;const o=(null==(s=null==(t=this.outputs[1])?void 0:t.links)?void 0:s.length)>0?this.outputs[1].links[0]:null,i=n.graph._nodes.find((e=>{var t;return null==(t=e.inputs)?void 0:t.find((e=>e.link==o))}));if(o&&i){const t=i.inputs.find((e=>e.link==o)).widget.name,n=i.widgets.find((e=>e.name==t));let s=(null==n?void 0:n.options.values)||null;s&&(s=s.join("\n"),e.value=s)}else $.error(Z("No COMBO link"),3e3)}),{serialize:!1})}),ze.includes(t.name)){let t=function(e){var t="";for(let n=0;ne.name===t+"_prompt")),s="comfy-multiline-input wildcard_"+t+"_"+this.id.toString();if(-1==n&&e){const n=document.createElement("textarea");n.className=s,n.placeholder="Wildcard Prompt ("+t+")";const o=this.addDOMWidget(t+"_prompt","customtext",n,{getValue:e=>n.value,setValue(e){n.value=e},serialize:!1});o.inputEl=n,o.inputEl.readOnly=!0,n.addEventListener("input",(()=>{var e;null==(e=o.callback)||e.call(o,o.value)})),o.value=e}else if(this.widgets[n])if(e){this.widgets[n].value=e}else{this.widgets.splice(n,1);const e=document.getElementsByClassName(s);e&&e[0]&&e[0].remove()}}};e.prototype.onExecuted=function(e){null==l||l.apply(this,arguments);const s=t(e.positive),o=t(e.negative);n.call(this,s,"positive"),n.call(this,o,"negative")}}if(["easy sv3dLoader"].includes(t.name)){let t=function(e,t,n){switch(e){case"azimuth":return n.readOnly=!0,n.style.opacity=.6,"0:(0.0,0.0)"+(t>1?`\n${t-1}:(360.0,0.0)`:"");case"elevation":return n.readOnly=!0,n.style.opacity=.6,"0:(-90.0,0.0)"+(t>1?`\n${t-1}:(90.0,0.0)`:"");case"custom":return n.readOnly=!1,n.style.opacity=1,"0:(0.0,0.0)\n9:(180.0,0.0)\n20:(360.0,0.0)"}};e.prototype.onNodeCreated=async function(){i&&i.apply(this,[]);const e=this.widgets.find((e=>"easing_mode"==e.name)),n=this.widgets.find((e=>"batch_size"==e.name)),s=this.widgets.find((e=>"scheduler"==e.name));setTimeout((o=>{s.value||(s.value=t(e.value,n.value,s.inputEl))}),1),e.callback=e=>{s.value=t(e,n.value,s.inputEl)},n.callback=n=>{s.value=t(e.value,n,s.inputEl)}}}if(Be.includes(s)&&(e.prototype.onNodeCreated=async function(){i&&i.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),s=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));if("easy seed"==t.name){const t=this.addWidget("button","🎲 Manual Random Seed",null,(t=>{"fixed"!=s.value&&(s.value="fixed"),e.value=Math.floor(Math.random()*P),n.queuePrompt(0,1)}),{serialize:!1});e.linkedWidgets=[t,s]}},e.prototype.onAdded=async function(){o&&o.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),t=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));setTimeout((n=>{"control_before_generate"==t.name&&0===e.value&&(e.value=Math.floor(Math.random()*P))}),1)}),"easy convertAnything"==s&&(e.prototype.onNodeCreated=async function(){i&&i.apply(this,[]);const e=this.widgets.find((e=>"output_type"==e.name)),t=t=>{this.outputs[0].type=e.value.toUpperCase(),this.outputs[0].name=e.value,this.outputs[0].label=e.value};setTimeout((e=>t()),10),e.callback=e=>t()}),"easy imageInsetCrop"==s){let t=function(e){const t=e.widgets[0];for(let n=1;n<=4;n++)"Pixels"===t.value?(e.widgets[n].options.step=80,e.widgets[n].options.max=8192):(e.widgets[n].options.step=10,e.widgets[n].options.max=99)};e.prototype.onAdded=async function(e){const n=this.widgets[0];let s=n.callback;n.callback=(...e)=>{t(this),s&&s.apply(n,[...e])},setTimeout((e=>{t(this)}),1)}}if(Ye.includes(s)){const t=e=>{switch(s){case"easy forLoopStart":return e+1;case"easy forLoopEnd":return e}},n=e=>{switch(s){case"easy forLoopStart":return e+3;case"easy forLoopEnd":return e}},o=e=>{switch(s){case"easy forLoopStart":return 0;case"easy forLoopEnd":return 1}};e.prototype.onNodeCreated=async function(){if(je.includes(s)){const e=this.inputs.findIndex((e=>"flow"===e.name)),t=this.outputs.findIndex((e=>"flow"===e.name));-1!==e&&(this.inputs[e].shape=5),-1!==t&&(this.outputs[t].shape=5);let s=this.inputs.findLastIndex((e=>e.link));this.inputs=this.inputs.filter(((e,t)=>t<=s+1)),this.outputs=this.outputs.filter(((e,t)=>t<=n(s))),we(this)}return null==i?void 0:i.apply(this,arguments)},e.prototype.onConnectionsChange=function(e,i,a,l){if("easy whileLoopStart"!=s&&"easy whileLoopEnd"!=s&&l&&1==e){let e=this.inputs.every((e=>null!==e.link));if(je.includes(s)){if(e){if(this.inputs.length>=10)return void $.warn(Z("The maximum number of inputs is 10"));let e=t(this.inputs.length),n="initial_value"+e,s="value"+e;this.addInput(n,"*"),this.addOutput(s,"*")}else if(!a){const e=o(),t=n(i);i>=e&&i==this.inputs.length-2&&(this.removeInput(i+1),this.removeOutput(t))}}else if(Ve.includes(s))if(e){if(this.inputs.length>=10)return void $.warn(Z("The maximum number of inputs is 10"));let e=He[s]+this.inputs.length;this.addInput(e,"*")}else a||i==this.inputs.length-2&&this.removeInput(i+1)}}}},nodeCreated(e){if(e.comfyClass.startsWith("easy ")){if(e.widgets)for(const n of e.widgets){if(!Pe.includes(n.name))continue;let t=n.value;Xe(e,n),Object.defineProperty(n,"value",{get:e=>t,set(s){s!==t&&(t=s,Xe(e,n))}})}const t=e.comfyClass;if("easy preDetailerFix"==t){const t=e.widgets.find((e=>"customtext"===e.type));if(!t)return;t.dynamicPrompts=!1,t.inputEl.placeholder="wildcard spec: if kept empty, this option will be ignored",t.serializeValue=()=>t.value}if("easy wildcards"==t){const t=e.widgets.find((e=>"text"==e.name));let n=1;Object.defineProperty(e.widgets[n],"value",{set:e=>{if((new Error).stack.includes("inner_value_change")&&"Select the LoRA to add to the text"!=e){let n=e;n.endsWith(".safetensors")&&(n=n.slice(0,-12)),t.value+=``}},get:e=>"Select the LoRA to add to the text"}),Object.defineProperty(e.widgets[n+1],"value",{set:e=>{(new Error).stack.includes("inner_value_change")&&"Select the Wildcard to add to the text"!=e&&(""!=t.value&&(t.value+=", "),t.value+=e)},get:e=>"Select the Wildcard to add to the text"}),e.widgets[n].serializeValue=e=>"Select the LoRA to add to the text",e.widgets[n+1].serializeValue=e=>"Select the Wildcard to add to the text"}if(We.includes(t)){const t=document.createElement("textarea");t.className="comfy-multiline-input",t.readOnly=!0;const n=e.addDOMWidget("info","customtext",t,{getValue:e=>t.value,setValue:e=>t.value=e,serialize:!1});n.inputEl=t,t.addEventListener("input",(()=>{var e;null==(e=n.callback)||e.call(n,n.value)}))}}}}),w.registerExtension({name:"easy bookmark",registerCustomNodes(){class e{constructor(){f(this,"type","easy bookmark"),f(this,"title","🔖"),f(this,"slot_start_y",-20),f(this,"___collapsed_width",0),f(this,"isVirtualNode",!0),f(this,"serialize_widgets",!0),f(this,"keypressBound",null),this.addWidget("text","shortcut_key","1",(e=>{""!==(e=e.trim()[0]||"1")&&(this.title="🔖 "+e)}),{y:8}),this.addWidget("number","zoom",1,(e=>{}),{y:8+LiteGraph.NODE_WIDGET_HEIGHT+4,max:2,min:.5,precision:2}),this.keypressBound=this.onKeypress.bind(this)}get _collapsed_width(){return this.___collapsed_width}set _collapsed_width(e){const t=w.canvas,n=t.canvas.getContext("2d");if(n){const e=n.font;n.font=t.title_text_font,this.___collapsed_width=40+n.measureText(this.title).width,n.font=e}}onAdded(){setTimeout((e=>{const t=this.widgets[0].value;t&&(this.title="🔖 "+t)}),1),window.addEventListener("keydown",this.keypressBound)}onRemoved(){window.removeEventListener("keydown",this.keypressBound)}onKeypress(e){const t=e.target;["input","textarea"].includes(t.localName)||this.widgets[0]&&e.key.toLocaleLowerCase()===this.widgets[0].value.toLocaleLowerCase()&&this.canvasToBookmark()}canvasToBookmark(){var e,t;const n=w.canvas;(null==(e=null==n?void 0:n.ds)?void 0:e.offset)&&(n.ds.offset[0]=16-this.pos[0],n.ds.offset[1]=40-this.pos[1]),null!=(null==(t=null==n?void 0:n.ds)?void 0:t.scale)&&(n.ds.scale=Number(this.widgets[1].value||1)),n.setDirty(!0,!0)}}LiteGraph.registerNodeType("easy bookmark",Object.assign(e,{title:"Bookmark 🔖"})),e.category="EasyUse/Util"}}),w.registerExtension({name:"Comfy.EasyUse.ChainNode",init(){w.canvas._mousemove_callback=e=>{if(!I("EasyUse.Nodes.ChainGetSet",null,!0))return;((e,t=!1,n={})=>{var s,o,i,a,l;if(0===e.length)return;const r=n.inputX||160,d=n.ouputX||60;if(e.filter((e=>Ne(e))).length>1)return;for(const c of e){let a=0,l=0;const u=n.inputY||10,p=n.outputY||30,h=[];if(c.graph){for(const e of c.inputs??[]){const t=e.link;if(!t)continue;const{origin_id:n,target_slot:s}=Ae(t),o=be(n);if(!o)continue;if(!Ne(o))continue;const i=c.getConnectionPos(!0,s);o.pos=[i[0]-r,i[1]+15+a*u],a+=1,h.push(o),o.flags.collapsed=!0}for(const e of c.outputs??[])if(e.links&&c.graph)for(const t of e.links){const{target_id:e}=Ae(t),n=be(e);if(!n)continue;if(!Ne(n))continue;const o=null==(s=n.outputs)?void 0:s.links;if((null==o?void 0:o.length)>1)return;const i=c.getConnectionPos(!1,0);n.pos=[i[0]+d,i[1]+15+l*p],l+=1,h.push(n),n.flags.collapsed=!0}if(t&&1===e.length){const e=[c,...h];(null==(i=null==(o=c.graph)?void 0:o.list_of_graphcanvas)?void 0:i[0]).selectNodes(e)}}}const u=e[0];if(!u)return;(null==(l=null==(a=u.graph)?void 0:a.list_of_graphcanvas)?void 0:l[0]).setDirty(!0,!0)})(Le())};const e=LGraphCanvas.prototype.showLinkMenu;LGraphCanvas.prototype.showLinkMenu=function(t,n){return n.shiftKey?(((e,t=!1)=>{var n,s,o,i,a,l,r,d,u,c;const{type:p}=e;if("*"===p)return;let{origin_id:h,target_id:m,origin_slot:g,target_slot:f}=e,y=be(h),_=be(m);if(!y||!_)return!1;if("Reroute"===y.type){let e=0;[y,e]=Ge(y),h=null==y?void 0:y.id,g=e,void 0!==g&&-1!==g||(g=0)}if("Reroute"===_.type&&(_=Me(_),m=null==_?void 0:_.id,f=null==_?void 0:_.inputs.findIndex((e=>e.type===p)),void 0!==f&&-1!==f||(f=0)),void 0===h||void 0===m||!y||!_)return!1;if(t&&(Ne(y)||Ne(_)))return!1;let v=ke((null==(n=_.getInputInfo(f))?void 0:n.name)??p.toLowerCase());v||(v=ke((null==(o=null==(s=null==y?void 0:y.outputs)?void 0:s[g])?void 0:o.name)??(null==(a=null==(i=null==y?void 0:y.outputs)?void 0:i[g])?void 0:a.type.toString())??v+`_from_${h}_to_${m}`));let w,b=!1,L=!1;if(Ne(y))v=ve(y),L=!0;else{const e=null==(r=null==(l=y.outputs)?void 0:l[g])?void 0:r.links;if(e)for(const t of e){const e=be((null==(d=Ae(t))?void 0:d.target_id)??-1);e&&Ne(e)&&xe(e)&&(v=ve(e),L=!0)}if(!L){for(const e of Te()){if(v!==ve(e)||!xe(e))continue;const t=null==(u=e.inputs[0])?void 0:u.link;(null==(c=Ae(t))?void 0:c.origin_id)===y.id?L=!0:b=!0}b&&(v+=`_from_${h}_to_${m}`)}}if(!L){w=LiteGraph.createNode("easy setNode"),w.is_auto_link=!0;const e=y.getConnectionPos(!1,g);w.pos=[e[0]+20,e[1]],w.inputs[0].name=v,w.inputs[0].type=p,w.inputs[0].widget=_.inputs[f].widget,Oe(w,v),De(w),w.flags.collapsed=!0;let t=[];y.widgets?t=Object.values(y.widgets).map((e=>e.value)):y.widgets_values&&(t=JSON.parse(JSON.stringify(y.widgets_values))),y.connect(g,w,0),y.widgets_values=t,"PrimitiveNode"===y.type&&setTimeout((()=>{if(y){y.connect(g,w,0);for(const[e,n]of t.entries())Oe(y,n,e);null!==w&&w.setSize(w.computeSize())}}))}const S=LiteGraph.createNode("easy getNode"),E=_.getConnectionPos(!0,f);S.pos=[E[0]-150,E[1]],S.outputs[0].name=v,S.outputs[0].type=p,S.outputs[0].widget=_.inputs[f].widget,De(S),Oe(S,v),null===S||(S.flags.collapsed=!0,S.setSize(S.computeSize()),S.connect(0,_,f))})(t),!1):(e.apply(this,[t,n]),!1)}}});let Ze=[];function Ke(e,t,n,s,o){var i=LGraphCanvas.active_canvas,a=i.getCanvasWindow(),l=i.graph;if(l)return function e(t,s){var r=LiteGraph.getNodeTypesCategories(i.filter||l.filter).filter((function(e){return e.startsWith(t)})),d=[];r.map((function(n){if(n){var s=new RegExp("^("+t+")"),o=n.replace(s,"").split("/")[0],i=""===t?o+"/":t+o+"/",a=o;-1!=a.indexOf("::")&&(a=a.split("::")[1]),-1===d.findIndex((function(e){return e.value===i}))&&d.push({value:i,content:a,has_submenu:!0,callback:function(t,n,s,o){e(t.value,o)}})}})),LiteGraph.getNodeTypesInCategory(t.slice(0,-1),i.filter||l.filter).map((function(e){if(!e.skip_list){var t={value:e.type,content:e.title,has_submenu:!1,callback:function(e,t,n,s){var a=s.getFirstEvent();i.graph.beforeChange();var l=LiteGraph.createNode(e.value);l&&(l.pos=i.convertEventToCanvasOffset(a),i.graph.add(l)),o&&o(l),i.graph.afterChange()}};d.push(t)}}));const u=I("EasyUse.ContextMenu.NodesSort",null,!0);""===t&&u&&(d=function(e){let t=[],n=[];return e.forEach((e=>{(null==e?void 0:e.value)&&F.includes(e.value.split("/")[0])?t.push(e):n.push(e)})),[{title:Z("ComfyUI Basic"),is_category_title:!0},...t,{title:Z("Others A~Z"),is_category_title:!0},...n.sort(((e,t)=>e.content.localeCompare(t.content)))]}(d)),new LiteGraph.ContextMenu(d,{event:n,parentMenu:s},a)}("",s),!1}w.registerExtension({name:"Comfy.EasyUse.ContextMenu",async setup(){LGraphCanvas.onMenuAdd=Ke;const e=I("EasyUse.ContextMenu.ModelsThumbnailsLimit",null,500),t=await b.fetchApi(`/easyuse/models/thumbnail?limit=${e}`);if(200===t.status){let e=await t.json();Ze=e}else $.error(Z("Too many thumbnails, have closed the display"));const n=LiteGraph.ContextMenu;LiteGraph.ContextMenu=function(e,t){if(I("EasyUse.ContextMenu.SubDirectories",null,!1)&&(null==t?void 0:t.callback)&&!e.some((e=>"string"!=typeof e))){const s=function(e,t){const n=e,s=[...n],o={},i=[],a=[],l=["ckpt","pt","bin","pth","safetensors"];if((null==e?void 0:e.length)>0){const t=Qe(e[e.length-1]);if(!l.includes(t))return null}for(const r of n){const e=r.indexOf("/")>-1?"/":"\\",t=r.split(e);if(t.length>1){const n=t.shift();o[n]=o[n]||[],o[n].push(t.join(e))}else"CHOOSE"===r||r.startsWith("DISABLE ")?i.push(r):a.push(r)}if(Object.values(o).length>0){const e=t.callback;t.callback=null;const n=(t,n)=>{["None","无","無","なし"].includes(t.content)?e("None",n):e(s.find((e=>e.endsWith(t.content)),n))},r=(e,t="")=>{const s=t?t+"\\"+qe(e):qe(e),o=Qe(e),i=(new Date).getTime();let a,r="";if(l.includes(o))for(let n=0;n{let n=[],s=[];const i=e.map((e=>{const i={},a=e.indexOf("/")>-1?"/":"\\",l=e.split(a);if(l.length>1){const e=l.shift();i[e]=i[e]||[],i[e].push(l.join(a))}if(Object.values(o).length>0){let t=Object.keys(i)[0];t&&i[t]?n.push({key:t,value:i[t][0]}):s.push(r(e,t))}return r(e,t)}));if(n.length>0){let e={};return n.forEach((t=>{e[t.key]=e[t.key]||[],e[t.key].push(t.value)})),[...Object.entries(e).map((e=>({content:e[0],has_submenu:!0,callback:()=>{},submenu:{options:u(e[1],e[0])}}))),...s]}return i};for(const[t,s]of Object.entries(o))d.push({content:t,has_submenu:!0,callback:()=>{},submenu:{options:u(s,t)}});return d.push(...a.map((e=>r(e,"")))),i.length>0&&d.push(...i.map((e=>r(e,"")))),d}return null}(e,t);return s?n.call(this,s,t):n.apply(this,[...arguments])}return t.parentMenu||t.extra||t.scale||t.hasOwnProperty("extra")&&(e.unshift(null),s=window.location.host,["192.168.","10.","127.",/^172\.((1[6-9]|2[0-9]|3[0-1])\.)/].some((e=>"string"==typeof e?s.startsWith(e):e.test(s)))&&e.unshift({content:`${Z("Reboot ComfyUI")}`,callback:e=>(async()=>{if(confirm(Z("Are you sure you'd like to reboot the server?")))try{b.fetchApi("/easyuse/reboot")}catch(e){}})()}),e.unshift({content:`${Z("Cleanup Of VRAM Usage")}`,callback:e=>q()})),n.apply(this,[...arguments]);var s},LiteGraph.ContextMenu.prototype=n.prototype,I("EasyUse.ContextMenu.NodesSort",null,!0)&&(LiteGraph.ContextMenu.prototype.addItem=$e)}});const Je=e=>e&&"object"==typeof e&&"image"in e&&e.content;function $e(e,t,n){var s=this;n=n||{};var o=document.createElement("div");o.className="litemenu-entry submenu";var i,a=!1;function l(e){var t=this.value,o=!0;(s.current_submenu&&s.current_submenu.close(e),n.callback)&&(!0===n.callback.call(this,t,n,e,s,n.node)&&(o=!1));if(t){if(t.callback&&!n.ignore_item_callbacks&&!0!==t.disabled)!0===t.callback.call(this,t,n,e,s,n.extra)&&(o=!1);if(t.submenu){if(!t.submenu.options)throw"ContextMenu submenu needs options";new s.constructor(t.submenu.options,{callback:t.submenu.callback,event:e,parentMenu:s,ignore_item_callbacks:t.submenu.ignore_item_callbacks,title:t.submenu.title,extra:t.submenu.extra,autoopen:n.autoopen}),o=!1}}o&&!s.lock&&s.close()}return null===t?o.classList.add("separator"):t.is_category_title?(o.classList.remove("litemenu-entry"),o.classList.remove("submenu"),o.classList.add("litemenu-title"),o.innerHTML=t.title):(o.innerHTML=t&&t.title?t.title:e,o.value=t,t&&(t.disabled&&(a=!0,o.classList.add("disabled")),(t.submenu||t.has_submenu)&&o.classList.add("has_submenu")),"function"==typeof t?(o.dataset.value=e,o.onclick_callback=t):o.dataset.value=t,t.className&&(o.className+=" "+t.className)),o&&Je(t)&&(null==t?void 0:t.image)&&!t.submenu&&(o.textContent+=" *",L("div.pysssss-combo-image",{parent:o,style:{backgroundImage:`url(/pysssss/view/${i=t.image,encodeURIComponent(i).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))})`}})),this.root.appendChild(o),a||o.addEventListener("click",l),!a&&n.autoopen&&LiteGraph.pointerListenerAdd(o,"enter",(function(e){var t=this.value;if(!t||!t.has_submenu)return;l.call(this,e)})),o}function qe(e){return null==e?void 0:e.substring(0,e.lastIndexOf("."))}function Qe(e){return null==e?void 0:e.substring(e.lastIndexOf(".")+1)}class et extends S{constructor(){super(),this.element.classList.add("easyuse-model-metadata")}show(e){super.show(L("div",Object.keys(e).map((t=>L("div",[L("label",{textContent:t}),L("span",{textContent:e[t]})])))))}}class tt extends S{constructor(e){super(),this.name=e,this.element.classList.add("easyuse-model-info")}get customNotes(){return this.metadata["easyuse.notes"]}set customNotes(e){this.metadata["easyuse.notes"]=e}get hash(){return this.metadata["easyuse.sha256"]}async show(e,t){this.type=e;const n=b.fetchApi("/easyuse/metadata/"+encodeURIComponent(`${e}/${t}`));this.info=L("div",{style:{flex:"auto"}}),this.imgCurrent=0,this.imgList=L("div.easyuse-preview-list",{style:{display:"none"}}),this.imgWrapper=L("div.easyuse-preview",[L("div.easyuse-preview-group",[this.imgList])]),this.main=L("main",{style:{display:"flex"}},[this.imgWrapper,this.info]),this.content=L("div.easyuse-model-content",[L("div.easyuse-model-header",[L("h2",{textContent:this.name})]),this.main]);const s=L("div",{textContent:"ℹ️ Loading...",parent:this.content});super.show(this.content),this.metadata=await(await n).json(),this.viewMetadata.style.cursor=this.viewMetadata.style.opacity="",this.viewMetadata.removeAttribute("disabled"),s.remove(),this.addInfo()}createButtons(){const e=super.createButtons();return this.viewMetadata=L("button",{type:"button",textContent:"View raw metadata",disabled:"disabled",style:{opacity:.5,cursor:"not-allowed"},onclick:e=>{this.metadata&&(new et).show(this.metadata)}}),e.unshift(this.viewMetadata),e}parseNote(){if(!this.customNotes)return[];let e=[];const t=new RegExp("(\\bhttps?:\\/\\/[^\\s]+)","g");let n,s=0;do{let o;n=t.exec(this.customNotes);let i=0;n?(o=n.index,i=n.index+n[0].length):o=this.customNotes.length;let a=this.customNotes.substring(s,o);a&&(a=a.replaceAll("\n","
"),e.push(L("span",{innerHTML:a}))),n&&e.push(L("a",{href:n[0],textContent:n[0],target:"_blank"})),s=i}while(n);return e}addInfoEntry(e,t){return L("p",{parent:this.info},["string"==typeof e?L("label",{textContent:e+": "}):e,"string"==typeof t?L("span",{textContent:t}):t])}async getCivitaiDetails(){const e=await fetch("https://civitai.com/api/v1/model-versions/by-hash/"+this.hash);if(200===e.status)return await e.json();throw 404===e.status?new Error("Model not found"):new Error(`Error loading info (${e.status}) ${e.statusText}`)}addCivitaiInfo(){const e=this.getCivitaiDetails(),t=L("span",{textContent:"ℹ️ Loading..."});return this.addInfoEntry(L("label",[L("img",{style:{width:"18px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),L("span",{textContent:"Civitai: "})]),t),e.then((e=>{var t,n;this.imgWrapper.style.display="block";let s=this.element.querySelector(".easyuse-model-header");s&&s.replaceChildren(L("h2",{textContent:this.name}),L("div.easyuse-model-header-remark",[L("h5",{textContent:Z("Updated At:")+O(new Date(e.updatedAt),"yyyy/MM/dd")}),L("h5",{textContent:Z("Created At:")+O(new Date(e.updatedAt),"yyyy/MM/dd")})]));let o=null,i=this.parseNote.call(this),a=Z("✏️ Edit"),l=L("div.easyuse-model-detail-textarea",[L("p",(null==i?void 0:i.length)>0?i:{textContent:Z("No notes")})]);if(i&&0!=i.length?l.classList.remove("empty"):l.classList.add("empty"),this.info.replaceChildren(L("div.easyuse-model-detail",[L("div.easyuse-model-detail-head.flex-b",[L("span",Z("Notes")),L("a",{textContent:a,href:"#",style:{fontSize:"12px",float:"right",color:"var(--warning-color)",textDecoration:"none"},onclick:async e=>{if(e.preventDefault(),o){if(o.value!=this.customNotes){toast.showLoading(Z("Saving Notes...")),this.customNotes=o.value;const e=await b.fetchApi("/easyuse/metadata/notes/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:this.customNotes});if(toast.hideLoading(),200!==e.status)return toast.error(Z("Saving Failed")),void alert(`Error saving notes (${e.status}) ${e.statusText}`);toast.success(Z("Saving Succeed")),i=this.parseNote.call(this),l.replaceChildren(L("p",(null==i?void 0:i.length)>0?i:{textContent:Z("No notes")})),o.value?l.classList.remove("empty"):l.classList.add("empty")}else l.replaceChildren(L("p",{textContent:Z("No notes")})),l.classList.add("empty");e.target.textContent=a,o.remove(),o=null}else e.target.textContent="💾 Save",o=L("textarea",{placeholder:Z("Type your notes here"),style:{width:"100%",minWidth:"200px",minHeight:"50px",height:"100px"},textContent:this.customNotes}),l.replaceChildren(o),o.focus()}})]),l]),L("div.easyuse-model-detail",[L("div.easyuse-model-detail-head",{textContent:Z("Details")}),L("div.easyuse-model-detail-body",[L("div.easyuse-model-detail-item",[L("div.easyuse-model-detail-item-label",{textContent:Z("Type")}),L("div.easyuse-model-detail-item-value",{textContent:e.model.type})]),L("div.easyuse-model-detail-item",[L("div.easyuse-model-detail-item-label",{textContent:Z("BaseModel")}),L("div.easyuse-model-detail-item-value",{textContent:e.baseModel})]),L("div.easyuse-model-detail-item",[L("div.easyuse-model-detail-item-label",{textContent:Z("Download")}),L("div.easyuse-model-detail-item-value",{textContent:(null==(t=e.stats)?void 0:t.downloadCount)||0})]),L("div.easyuse-model-detail-item",[L("div.easyuse-model-detail-item-label",{textContent:Z("Trained Words")}),L("div.easyuse-model-detail-item-value",{textContent:(null==e?void 0:e.trainedWords.join(","))||"-"})]),L("div.easyuse-model-detail-item",[L("div.easyuse-model-detail-item-label",{textContent:Z("Source")}),L("div.easyuse-model-detail-item-value",[L("label",[L("img",{style:{width:"14px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),L("a",{href:"https://civitai.com/models/"+e.modelId,textContent:"View "+e.model.name,target:"_blank"})])])])])])),null==(n=e.images)?void 0:n.length){this.imgCurrent=0,this.isSaving=!1,e.images.map((e=>e.url&&this.imgList.appendChild(L("div.easyuse-preview-slide",[L("div.easyuse-preview-slide-content",[L("img",{src:e.url}),L("div.save",{textContent:"Save as preview",onclick:async()=>{if(this.isSaving)return;this.isSaving=!0,toast.showLoading(Z("Saving Preview..."));const t=await(await fetch(e.url)).blob(),n="temp_preview."+new URL(e.url).pathname.split(".")[1],s=new FormData;s.append("image",new File([t],n)),s.append("overwrite","true"),s.append("type","temp");if(200!==(await b.fetchApi("/upload/image",{method:"POST",body:s})).status)return this.isSaving=!1,toast.error(Z("Saving Failed")),toast.hideLoading(),void alert(`Error saving preview (${req.status}) ${req.statusText}`);await b.fetchApi("/easyuse/save/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:JSON.stringify({filename:n,type:"temp"}),headers:{"content-type":"application/json"}}).then((e=>{toast.success(Z("Saving Succeed")),toast.hideLoading()})),this.isSaving=!1,app.refreshComboInNodes()}})])]))));let t=this;this.imgDistance=(-660*this.imgCurrent).toString(),this.imgList.style.display="",this.imgList.style.transform="translate3d("+this.imgDistance+"px, 0px, 0px)",this.slides=this.imgList.querySelectorAll(".easyuse-preview-slide"),this.slideLeftButton=L("button.left",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{e.images.length<=2||(t.imgList.classList.remove("no-transition"),0==t.imgCurrent?(t.imgCurrent=e.images.length/2-1,this.slides[this.slides.length-1].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d(660px, 0px, 0px)",setTimeout((e=>{this.slides[this.slides.length-1].style.transform="translate3d(0px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)):(t.imgCurrent=t.imgCurrent-1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"))}}),this.slideRightButton=L("button.right",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{if(!(e.images.length<=2))if(t.imgList.classList.remove("no-transition"),t.imgCurrent>=e.images.length/2-1){t.imgCurrent=0;const n=e.images.length/2;this.slides[0].style.transform="translate3d("+(660*n).toString()+"px, 0px, 0px)",this.slides[1].style.transform="translate3d("+(660*n).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d("+(-660*n).toString()+"px, 0px, 0px)",setTimeout((e=>{this.slides[0].style.transform="translate3d(0px, 0px, 0px)",this.slides[1].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)}else t.imgCurrent=t.imgCurrent+1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"}})}return e.description&&L("div",{parent:this.content,innerHTML:e.description,style:{marginTop:"10px"}}),e})).catch((e=>{this.imgWrapper.style.display="none",t.textContent="⚠️ "+e.message})).finally((e=>{}))}}class nt extends tt{async addInfo(){await this.addCivitaiInfo()}}class st extends tt{getTagFrequency(){if(!this.metadata.ss_tag_frequency)return[];const e=JSON.parse(this.metadata.ss_tag_frequency),t={};for(const n in e){const s=e[n];for(const e in s)e in t?t[e]+=s[e]:t[e]=s[e]}return Object.entries(t).sort(((e,t)=>t[1]-e[1]))}getResolutions(){let e=[];if(this.metadata.ss_bucket_info){const t=JSON.parse(this.metadata.ss_bucket_info);if(null==t?void 0:t.buckets)for(const{resolution:n,count:s}of Object.values(t.buckets))e.push([s,`${n.join("x")} * ${s}`])}e=e.sort(((e,t)=>t[0]-e[0])).map((e=>e[1]));let t=this.metadata.ss_resolution;if(t){const n=t.split(","),s=n[0].replace("(",""),o=n[1].replace(")","");e.push(`${s.trim()}x${o.trim()} (Base res)`)}else(t=this.metadata["modelspec.resolution"])&&e.push(t+" (Base res");return e.length||e.push("⚠️ Unknown"),e}getTagList(e){return e.map((e=>L("li.easyuse-model-tag",{dataset:{tag:e[0]},$:e=>{e.onclick=()=>{e.classList.toggle("easyuse-model-tag--selected")}}},[L("p",{textContent:e[0]}),L("span",{textContent:e[1]})])))}addTags(){let e,t=this.getTagFrequency();if(null==t?void 0:t.length){const n=t.length;let s;n>500&&(t=t.slice(0,500),e=L("p",[L("span",{textContent:"⚠️ Only showing first 500 tags "}),L("a",{href:"#",textContent:`Show all ${n}`,onclick:()=>{s.replaceChildren(...this.getTagList(this.getTagFrequency())),e.remove()}})])),s=L("ol.easyuse-model-tags-list",this.getTagList(t)),this.tags=L("div",[s])}else this.tags=L("p",{textContent:"⚠️ No tag frequency metadata found"});this.content.append(this.tags),e&&this.content.append(e)}async addInfo(){const e=this.addCivitaiInfo();this.addTags();const t=await e;t&&L("div",{parent:this.content,innerHTML:t.description,style:{maxHeight:"250px",overflow:"auto"}})}createButtons(){const e=super.createButtons();function t(e,t){const n=L("textarea",{parent:document.body,style:{position:"fixed"},textContent:t.map((e=>e.dataset.tag)).join(", ")});n.select();try{document.execCommand("copy"),e.target.dataset.text||(e.target.dataset.text=e.target.textContent),e.target.textContent="Copied "+t.length+" tags",setTimeout((()=>{e.target.textContent=e.target.dataset.text}),1e3)}catch(s){prompt("Copy to clipboard: Ctrl+C, Enter",text)}finally{document.body.removeChild(n)}}return e.unshift(L("button",{type:"button",textContent:"Copy Selected",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag--selected")])}}),L("button",{type:"button",textContent:"Copy All",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag")])}})),e}}const ot=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy kolorsLoader","easy hunyuanDiTLoader","easy pixArtLoader"],it=["easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingLayerDiffusion","easy fullkSampler"],at=["KSamplerSelect","SamplerEulerAncestral","SamplerEulerAncestralCFG++","SamplerLMS","SamplerDPMPP_3M_SDE","SamplerDPMPP_2M_SDE","SamplerDPMPP_SDE","SamplerDPMAdaptative","SamplerLCMUpscale","SamplerTCD","SamplerTCD EulerA"],lt=["BasicScheduler","KarrasScheduler","ExponentialScheduler","PolyexponentialScheduler","VPScheduler","BetaSamplingScheduler","SDTurboScheduler","SplitSigmas","SplitSigmasDenoise","FlipSigmas","AlignYourStepsScheduler","GITSScheduler"],rt=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerLayerDiffusion"],dt=["easy controlnetLoader","easy controlnetLoaderADV","easy controlnetLoader++","easy instantIDApply","easy instantIDApplyADV"],ut=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition","easy ipadapterApplyFromParams","easy pulIDApply","easy pulIDApplyADV"],ct=["easy positive","easy wildcards"],pt=["easy loadImageBase64","LoadImage","LoadImageMask"],ht=["easy applyBrushNet","easy applyPowerPaint","easy applyInpaint"],mt={positive_prompt:{text:"positive",positive:"text"},loaders:{ckpt_name:"ckpt_name",vae_name:"vae_name",clip_skip:"clip_skip",lora_name:"lora_name",resolution:"resolution",empty_latent_width:"empty_latent_width",empty_latent_height:"empty_latent_height",positive:"positive",negative:"negative",batch_size:"batch_size",a1111_prompt_style:"a1111_prompt_style"},preSampling:{steps:"steps",cfg:"cfg",cfg_scale_min:"cfg",sampler_name:"sampler_name",scheduler:"scheduler",denoise:"denoise",seed_num:"seed_num",seed:"seed"},kSampler:{image_output:"image_output",save_prefix:"save_prefix",link_id:"link_id"},controlnet:{control_net_name:"control_net_name",strength:["strength","cn_strength"],scale_soft_weights:["scale_soft_weights","cn_soft_weights"],cn_strength:["strength","cn_strength"],cn_soft_weights:["scale_soft_weights","cn_soft_weights"]},ipadapter:{preset:"preset",lora_strength:"lora_strength",provider:"provider",weight:"weight",weight_faceidv2:"weight_faceidv2",start_at:"start_at",end_at:"end_at",cache_mode:"cache_mode",use_tiled:"use_tiled",insightface:"insightface",pulid_file:"pulid_file"},load_image:{image:"image",base64_data:"base64_data",channel:"channel"},inpaint:{dtype:"dtype",fitting:"fitting",function:"function",scale:"scale",start_at:"start_at",end_at:"end_at"},sampler:{},sigmas:{}},gt={loaders:{optional_lora_stack:"optional_lora_stack",positive:"positive",negative:"negative"},preSampling:{pipe:"pipe",image_to_latent:"image_to_latent",latent:"latent"},kSampler:{pipe:"pipe",model:"model"},controlnet:{pipe:"pipe",image:"image",image_kps:"image_kps",control_net:"control_net",positive:"positive",negative:"negative",mask:"mask"},positive_prompt:{},ipadapter:{model:"model",image:"image",image_style:"image",attn_mask:"attn_mask",optional_ipadapter:"optional_ipadapter"},inpaint:{pipe:"pipe",image:"image",mask:"mask"},sampler:{},sigmas:{}},ft={loaders:{pipe:"pipe",model:"model",vae:"vae",clip:null,positive:null,negative:null,latent:null},preSampling:{pipe:"pipe"},kSampler:{pipe:"pipe",image:"image"},controlnet:{pipe:"pipe",positive:"positive",negative:"negative"},positive_prompt:{text:"positive",positive:"text"},load_image:{IMAGE:"IMAGE",MASK:"MASK"},ipadapter:{model:"model",tiles:"tiles",masks:"masks",ipadapter:"ipadapter"},inpaint:{pipe:"pipe"},sampler:{SAMPLER:"SAMPLER"},sigmas:{SIGMAS:"SIGMAS"}};function yt(e,t,n){return function(){!function(e,t,n){const s=LiteGraph.createNode(t);if(s){if(w.graph.add(s),s.pos=e.pos.slice(),s.size=e.size.slice(),e.widgets.forEach((e=>{if(mt[n][e.name]){const o=mt[n][e.name];if(o){const n=(t=o,s.widgets.find((e=>"object"==typeof t?t.includes(e.name):e.name===t)));n&&(n.value=e.value,"seed_num"==e.name&&(n.linkedWidgets[0].value=e.linkedWidgets[0].value),"converted-widget"==e.type&&Et(s,n,e))}}var t})),e.inputs&&e.inputs.forEach(((t,o)=>{if(t&&t.link&>[n][t.name]){const o=gt[n][t.name];if(null===o)return;const i=s.findInputSlot(o);if(-1!==i){const n=e.graph.links[t.link];if(n){const t=e.graph.getNodeById(n.origin_id);t&&t.connect(n.origin_slot,s,i)}}}})),e.outputs&&e.outputs.forEach(((t,o)=>{if(t&&t.links&&ft[n]&&ft[n][t.name]){const o=ft[n][t.name];if(null===o)return;const i=s.findOutputSlot(o);-1!==i&&t.links.forEach((t=>{const n=e.graph.links[t];if(n){const t=e.graph.getNodeById(n.target_id);t&&s.connect(i,t,n.target_slot)}}))}})),w.graph.remove(e),"easy fullkSampler"==s.type){const e=s.outputs[0].links;if(e&&e[0]){const t=w.graph._nodes.find((t=>t.inputs&&t.inputs[0]&&t.inputs[0].link==e[0]));t&&w.graph.remove(t)}}else if(it.includes(s.type)){const e=s.outputs[0].links;if(!e||!e[0]){const e=LiteGraph.createNode("easy kSampler");w.graph.add(e),e.pos=s.pos.slice(),e.pos[0]=e.pos[0]+s.size[0]+20;const t=s.findInputSlot("pipe");-1!==t&&s&&s.connect(0,e,t)}}s.setSize([s.size[0],s.computeSize()[1]])}}(e,t,n)}}const _t=(e,t)=>{const n=e.prototype.getExtraMenuOptions;e.prototype.getExtraMenuOptions=function(){const e=n.apply(this,arguments);return t.apply(this,arguments),e}},vt=(e,t,n,s,o=!0)=>{_t(s,(function(s,i){i.unshift({content:e,has_submenu:o,callback:(e,s,o,i,a)=>wt(e,s,o,i,a,t,n)}),"loaders"==t&&(i.unshift({content:Z("💎 View Lora Info..."),callback:(e,t,n,s,o)=>{let i=o.widgets.find((e=>"lora_name"==e.name)).value;i&&"None"!=i&&new st(i).show("loras",i)}}),i.unshift({content:Z("💎 View Checkpoint Info..."),callback:(e,t,n,s,o)=>{let i=o.widgets[0].value;i&&"None"!=i&&new nt(i).show("checkpoints",i)}}))}))},wt=(e,t,n,s,o,i,a)=>{const l=[];return a.map((e=>{o.type!==e&&l.push({content:`${e}`,callback:yt(o,e,i)})})),new LiteGraph.ContextMenu(l,{event:n,callback:null,parentMenu:s,node:o}),!1},bt="converted-widget",Lt=Symbol();function St(e,t,n=""){if(t.origType=t.type,t.origComputeSize=t.computeSize,t.origSerializeValue=t.serializeValue,t.computeSize=()=>[0,-4],t.type=bt+n,t.serializeValue=()=>{if(!e.inputs)return;let n=e.inputs.find((e=>{var n;return(null==(n=e.widget)?void 0:n.name)===t.name}));return n&&n.link?t.origSerializeValue?t.origSerializeValue():t.value:void 0},t.linkedWidgets)for(const s of t.linkedWidgets)St(e,s,":"+t.name)}function Et(e,t,n){St(e,t);const{type:s}=function(e){let t=e[0];t instanceof Array&&(t="COMBO");return{type:t}}(n),o=e.size;t.options&&t.options.forceInput||e.addInput(t.name,s,{widget:{name:t.name,[Lt]:()=>n}});for(const i of e.widgets)i.last_y+=LiteGraph.NODE_SLOT_HEIGHT;e.setSize([Math.max(o[0],e.size[0]),Math.max(o[1],e.size[1])])}const Ct=function(e){var t,n,s,o;const i=e.constructor.type,a=e.properties.origVals||{},l=a.title||e.title,r=a.color||e.color,d=a.bgcolor||e.bgcolor,u=e,c={size:[...e.size],color:r,bgcolor:d,pos:[...e.pos]};let p=[],h=[];if(e.inputs)for(const y of e.inputs)if(y.link){const t=y.name,n=e.findInputSlot(t),s=e.getInputNode(n),o=e.getInputLink(n);p.push([o.origin_slot,s,t])}if(e.outputs)for(const y of e.outputs)if(y.links){const e=y.name;for(const t of y.links){const n=graph.links[t],s=graph._nodes_by_id[n.target_id];h.push([e,s,n.target_slot])}}w.graph.remove(e);const m=w.graph.add(LiteGraph.createNode(i,l,c));function g(){if(u.widgets)for(let e of u.widgets)if("converted-widget"===e.type){const t=m.widgets.find((t=>t.name===e.name));for(let n of u.inputs)n.name===e.name&&Et(m,t,n.widget)}for(let e of p){const[t,n,s]=e;n.connect(t,m.id,s)}for(let e of h){const[t,n,s]=e;m.connect(t,n,s)}}let f=u.widgets_values;if(!f&&(null==(t=m.widgets)?void 0:t.length)>0)return m.widgets.forEach(((e,t)=>{const n=u.widgets[t];e.name===n.name&&e.type===n.type&&(e.value=n.value)})),void g();if(f){let e=function(e,t){var n,s,o,i,a,l;if(!0===e||!1===e){if((null==(n=t.options)?void 0:n.on)&&(null==(s=t.options)?void 0:s.off))return{value:e,pass:!0}}else if("number"==typeof e){if((null==(o=t.options)?void 0:o.min)<=e&&e<=(null==(i=t.options)?void 0:i.max))return{value:e,pass:!0}}else{if(null==(l=null==(a=t.options)?void 0:a.values)?void 0:l.includes(e))return{value:e,pass:!0};if(t.inputEl&&"string"==typeof e)return{value:e,pass:!0}}return{value:t.value,pass:!1}},t=!1;const i=(null==f?void 0:f.length)<=(null==(n=m.widgets)?void 0:n.length);let a=i?0:f.length-1;const l=n=>{var s;const o=u.widgets[n];let l=m.widgets[n];if(l.name===o.name&&l.type===o.type){for(;(i?a=0)&&!t;){let{value:t,pass:n}=e(f[a],l);if(n&&null!==t){l.value=t;break}a+=i?1:-1}a++,i||(a=f.length-((null==(s=m.widgets)?void 0:s.length)-1-n))}};if(i&&(null==(s=m.widgets)?void 0:s.length)>0)for(let n=0;n0)for(let n=m.widgets.length-1;n>=0;n--)l(n)}g()};w.registerExtension({name:"Comfy.EasyUse.ExtraMenu",async beforeRegisterNodeDef(e,t,n){_t(e,(function(e,n){n.unshift({content:Z("🔃 Reload Node"),callback:(e,t,n,s,o)=>{let i=LGraphCanvas.active_canvas;if(!i.selected_nodes||Object.keys(i.selected_nodes).length<=1)Ct(o);else for(let a in i.selected_nodes)Ct(i.selected_nodes[a])}}),"easy ckptNames"==t.name&&n.unshift({content:Z("💎 View Checkpoint Info..."),callback:(e,t,n,s,o)=>{o.widgets[0].value}})})),ct.includes(t.name)&&vt("↪️ Swap EasyPrompt","positive_prompt",ct,e),ot.includes(t.name)&&vt("↪️ Swap EasyLoader","loaders",ot,e),it.includes(t.name)&&vt("↪️ Swap EasyPreSampling","preSampling",it,e),rt.includes(t.name)&&vt("↪️ Swap EasyKSampler","preSampling",rt,e),at.includes(t.name)&&vt("↪️ Swap Custom Sampler","sampler",at,e),lt.includes(t.name)&&vt("↪️ Swap Custom Sigmas","sigmas",lt,e),dt.includes(t.name)&&vt("↪️ Swap EasyControlnet","controlnet",dt,e),ut.includes(t.name)&&vt("↪️ Swap EasyAdapater","ipadapter",ut,e),pt.includes(t.name)&&vt("↪️ Swap LoadImage","load_image",pt,e),ht.includes(t.name)&&vt("↪️ Swap InpaintNode","inpaint",ht,e)}});const At="➡️";w.registerExtension({name:"easy setNode",registerCustomNodes(){class e{constructor(){f(this,"defaultVisibility",!0),f(this,"serialize_widgets",!0),this.properties||(this.properties={previousName:""}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("text","Constant","",((e,n,s,o,i)=>{t.validateName(t.graph),""!==this.widgets[0].value&&(this.title=At+this.widgets[0].value),this.update(),this.properties.previousName=this.widgets[0].value}),{}),this.addInput("*","*"),this.onConnectionsChange=function(e,n,s,o,i){if(1!=e||s||(this.inputs[n].type="*",this.inputs[n].name="*",this.title="Set"),o&&t.graph&&1==e&&s){const e=t.graph._nodes.find((e=>e.id==o.origin_id)).outputs[o.origin_slot],n=e.type,s=t.is_auto_link?this.widgets[0].value:e.name;"Set"===this.title&&(this.title=At+s,this.widgets[0].value=s),"*"===this.widgets[0].value&&(this.widgets[0].value=s),this.validateName(t.graph),this.inputs[0].type=n,this.inputs[0].name=s,setTimeout((e=>{this.title=At+this.widgets[0].value}),1)}this.update()},this.validateName=function(e){let n=t.widgets[0].value;if(""!=n){let s=0,o=[];do{o=e._nodes.filter((e=>e!=this&&("easy setNode"==e.type&&e.widgets[0].value===n))),o.length>0&&(n=t.widgets[0].value+s),s++}while(o.length>0);t.widgets[0].value=n,this.update()}},this.clone=function(){const t=e.prototype.clone.apply(this);return t.inputs[0].name="*",t.inputs[0].type="*",t.properties.previousName="",t.size=t.computeSize(),t},this.onAdded=function(e){this.validateName(e)},this.update=function(){if(t.graph){this.findGetters(t.graph).forEach((e=>{e.setType(this.inputs[0].type)})),this.widgets[0].value&&this.findGetters(t.graph,!0).forEach((e=>{e.setName(this.widgets[0].value)}));t.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues()}))}},this.findGetters=function(e,t){const n=t?this.properties.previousName:this.widgets[0].value;return e._nodes.filter((e=>"easy getNode"==e.type&&e.widgets[0].value===n&&""!=n))},this.isVirtualNode=!0}onRemoved(){this.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues([this])}))}}LiteGraph.registerNodeType("easy setNode",Object.assign(e,{title:"Set"})),e.category="EasyUse/Util"}}),w.registerExtension({name:"easy getNode",registerCustomNodes(){class e{constructor(){f(this,"defaultVisibility",!0),f(this,"serialize_widgets",!0),this.properties||(this.properties={}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("combo","Constant","",(e=>{this.onRename()}),{values:()=>t.graph._nodes.filter((e=>"easy setNode"==e.type)).map((e=>e.widgets[0].value)).sort()}),this.addOutput("*","*"),this.onConnectionsChange=function(e,t,n,s,o){this.validateLinks(),2!=e||n?(this.onRename(),setTimeout((e=>{this.title="⬅️"+this.widgets[0].value}),1)):(this.outputs[t].type="*",this.outputs[t].name="*",this.title="Get")},this.setName=function(e){t.widgets[0].value=e,t.onRename(),t.serialize()},this.onRename=function(e=0){const n=this.findSetter(t.graph);if(n){const t=n.inputs[0].type,s=n.inputs[0].name;this.setType(t,s),this.outputs[e].type=t,this.outputs[e].name=s,this.title="⬅️"+n.widgets[0].value}else this.setType("*","*"),this.outputs[e].type="*",this.outputs[e].name="*"},this.clone=function(){const t=e.prototype.clone.apply(this);return t.size=t.computeSize(),t},this.validateLinks=function(){"*"!=this.outputs[0].type&&this.outputs[0].links&&this.outputs[0].links.forEach((e=>{const n=t.graph.links[e];n&&n.type!=this.outputs[0].type&&"*"!=n.type&&t.graph.removeLink(e)}))},this.setType=function(e,t){this.outputs[0].name=t,this.outputs[0].type=e,this.validateLinks()},this.findSetter=function(e){const t=this.widgets[0].value;return e._nodes.find((e=>"easy setNode"==e.type&&e.widgets[0].value===t&&""!=t))},this.isVirtualNode=!0}getInputLink(e){const t=this.findSetter(this.graph);if(t){const n=t.inputs[e];return this.graph.links[n.link]}throw new Error("No setter found for "+this.widgets[0].value+"("+this.type+")")}onAdded(e){}}LiteGraph.registerNodeType("easy getNode",Object.assign(e,{title:"Get"})),e.category="EasyUse/Util"}}),b.addEventListener("easyuse-global-seed",(function(e){let t=app.graph._nodes_by_id;for(let n in t){let s=t[n];if("easy globalSeed"==s.type){if(s.widgets){const t=s.widgets.find((e=>"value"==e.name));s.widgets.find((e=>"last_seed"==e.name)).value=t.value,t.value=e.detail.value}}else if(s.widgets){const t=s.widgets.find((e=>"seed_num"==e.name||"seed"==e.name||"noise_seed"==e.name));t&&null!=e.detail.seed_map[s.id]&&(t.value=e.detail.seed_map[s.id])}}}));const kt=b.queuePrompt;b.queuePrompt=async function(e,{output:t,workflow:n}){n.seed_widgets={};for(let s in app.graph._nodes_by_id){let e=app.graph._nodes_by_id[s].widgets;if(e)for(let t in e)"seed_num"!=e[t].name&&"seed"!=e[t].name&&"noise_seed"!=e[t].name||"converted-widget"==e[t].type||(n.seed_widgets[s]=parseInt(t))}return await kt.call(b,e,{output:t,workflow:n})};const It=["easy imageSave","easy fullkSampler","easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo","easy detailerFix"];w.registerExtension({name:"Comfy.EasyUse.SaveImageExtraOutput",async beforeRegisterNodeDef(e,t,n){if(It.includes(t.name)){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0,s=this.widgets.find((e=>"filename_prefix"===e.name||"save_prefix"===e.name));return s.serializeValue=()=>C(n,s.value),e}}else{const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0;return this.properties&&"Node name for S&R"in this.properties||this.addProperty("Node name for S&R",this.constructor.type,"string"),e}}}});const xt=["easy wildcards","easy positive","easy negative","easy stylesSelector","easy promptConcat","easy promptReplace"],Nt=["easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingDynamicCFG","easy preSamplingSdTurbo","easy preSamplingLayerDiffusion"],Tt=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo"],Ot=["easy controlnetLoader","easy controlnetLoaderADV"],Dt=["easy instantIDApply","easy instantIDApplyADV"],Rt=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition"],Gt=["easy pipeIn","easy pipeOut","easy pipeEdit"],Mt=["easy XYPlot","easy XYPlotAdvanced"],Pt=["easy setNode"],Ft=["Reroute","RescaleCFG","LoraLoaderModelOnly","LoraLoader","FreeU","FreeU_v2",...Rt,...Pt],Ut={"easy seed":{from:{INT:["Reroute",...Nt,"easy fullkSampler"]}},"easy positive":{from:{STRING:["Reroute",...xt]}},"easy negative":{from:{STRING:["Reroute",...xt]}},"easy wildcards":{from:{STRING:["Reroute","easy showAnything",...xt]}},"easy stylesSelector":{from:{STRING:["Reroute","easy showAnything",...xt]}},"easy promptConcat":{from:{STRING:["Reroute","easy showAnything",...xt]}},"easy promptReplace":{from:{STRING:["Reroute","easy showAnything",...xt]}},"easy fullLoader":{from:{PIPE_LINE:["Reroute",...Nt,"easy fullkSampler",...Gt,...Pt],MODEL:Ft},to:{STRING:["Reroute",...xt]}},"easy a1111Loader":{from:{PIPE_LINE:["Reroute",...Nt,...Ot,...Dt,...Gt,...Pt],MODEL:Ft},to:{STRING:["Reroute",...xt]}},"easy comfyLoader":{from:{PIPE_LINE:["Reroute",...Nt,...Ot,...Dt,...Gt,...Pt],MODEL:Ft},to:{STRING:["Reroute",...xt]}},"easy hunyuanDiTLoader":{from:{PIPE_LINE:["Reroute",...Nt,...Ot,...Dt,...Gt,...Pt],MODEL:Ft},to:{STRING:["Reroute",...xt]}},"easy kolorsLoader":{from:{PIPE_LINE:["Reroute",...Nt,...Ot,...Dt,...Gt,...Pt],MODEL:Ft},to:{STRING:["Reroute",...xt]}},"easy pixArtLoader":{from:{PIPE_LINE:["Reroute",...Nt,...Ot,...Dt,...Gt,...Pt],MODEL:Ft},to:{STRING:["Reroute",...xt]}},"easy svdLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Gt,...Pt],MODEL:Ft},to:{STRING:["Reroute",...xt]}},"easy zero123Loader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Gt,...Pt],MODEL:Ft},to:{STRING:["Reroute",...xt]}},"easy sv3dLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Gt,...Pt],MODEL:Ft},to:{STRING:["Reroute",...xt]}},"easy preSampling":{from:{PIPE_LINE:["Reroute",...Tt,...Gt,...Ot,...Mt,...Pt]}},"easy preSamplingAdvanced":{from:{PIPE_LINE:["Reroute",...Tt,...Gt,...Ot,...Mt,...Pt]}},"easy preSamplingDynamicCFG":{from:{PIPE_LINE:["Reroute",...Tt,...Gt,...Ot,...Mt,...Pt]}},"easy preSamplingCustom":{from:{PIPE_LINE:["Reroute",...Tt,...Gt,...Ot,...Mt,...Pt]}},"easy preSamplingLayerDiffusion":{from:{PIPE_LINE:["Reroute","easy kSamplerLayerDiffusion",...Tt,...Gt,...Ot,...Mt,...Pt]}},"easy preSamplingNoiseIn":{from:{PIPE_LINE:["Reroute",...Tt,...Gt,...Ot,...Mt,...Pt]}},"easy fullkSampler":{from:{PIPE_LINE:["Reroute",...Gt.reverse(),"easy preDetailerFix","easy preMaskDetailerFix",...Nt,...Pt]}},"easy kSampler":{from:{PIPE_LINE:["Reroute",...Gt.reverse(),"easy preDetailerFix","easy preMaskDetailerFix","easy hiresFix",...Nt,...Pt]}},"easy controlnetLoader":{from:{PIPE_LINE:["Reroute",...Nt,...Ot,...Dt,...Gt,...Pt]}},"easy controlnetLoaderADV":{from:{PIPE_LINE:["Reroute",...Nt,...Ot,...Dt,...Gt,...Pt]}},"easy instantIDApply":{from:{PIPE_LINE:["Reroute",...Nt,...Ot,...Dt,...Gt,...Pt],MODEL:Ft},to:{COMBO:["Reroute","easy promptLine"]}},"easy instantIDApplyADV":{from:{PIPE_LINE:["Reroute",...Nt,...Ot,...Dt,...Gt,...Pt],MODEL:Ft},to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApply":{to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApplyADV":{to:{STRING:["Reroute","easy sliderControl",...xt],COMBO:["Reroute","easy promptLine"]}},"easy ipadapterStyleComposition":{to:{COMBO:["Reroute","easy promptLine"]}},"easy preDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Gt,...Pt]},to:{PIPE_LINE:["Reroute","easy ultralyticsDetectorPipe","easy samLoaderPipe","easy kSampler","easy fullkSampler"]}},"easy preMaskDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Gt,...Pt]}},"easy samLoaderPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Gt,...Pt]}},"easy ultralyticsDetectorPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Gt,...Pt]}},"easy cascadeLoader":{from:{PIPE_LINE:["Reroute","easy fullCascadeKSampler","easy preSamplingCascade",...Ot,...Gt,...Pt],MODEL:Ft.filter((e=>!Rt.includes(e)))}},"easy fullCascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Gt,...Pt]}},"easy preSamplingCascade":{from:{PIPE_LINE:["Reroute","easy cascadeKSampler",...Gt,...Pt]}},"easy cascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Gt,...Pt]}}};w.registerExtension({name:"Comfy.EasyUse.Suggestions",async setup(e){LGraphCanvas.prototype.createDefaultNodeForSlot=function(e){e=e||{};var t,n=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,position:[],nodeType:null,posAdd:[0,0],posSizeFix:[0,0]},e),s=n.nodeFrom&&null!==n.slotFrom,o=!s&&n.nodeTo&&null!==n.slotTo;if(!s&&!o)return!1;if(!n.nodeType)return!1;var i=s?n.nodeFrom:n.nodeTo,a=s?n.slotFrom:n.slotTo,l=i.type,r=!1;switch(typeof a){case"string":r=s?i.findOutputSlot(a,!1):i.findInputSlot(a,!1),a=s?i.outputs[a]:i.inputs[a];break;case"object":r=s?i.findOutputSlot(a.name):i.findInputSlot(a.name);break;case"number":r=a,a=s?i.outputs[a]:i.inputs[a];break;default:return!1}var d=a.type==LiteGraph.EVENT?"_event_":a.type,u=s?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in;if(u&&u[d]){a.link;let e=!1;const o=s?"from":"to";if(Ut[l]&&Ut[l][o]&&(null==(t=Ut[l][o][d])?void 0:t.length)>0){for(var c in Ut[l][o][d])if(n.nodeType==Ut[l][o][d][c]||"AUTO"==n.nodeType){e=Ut[l][o][d][c];break}}else if("object"==typeof u[d]||"array"==typeof u[d]){for(var c in u[d])if(n.nodeType==u[d][c]||"AUTO"==n.nodeType){e=u[d][c];break}}else n.nodeType!=u[d]&&"AUTO"!=n.nodeType||(e=u[d]);if(e){var p=!1;"object"==typeof e&&e.node&&(p=e,e=e.node);var h=LiteGraph.createNode(e);if(h){if(p){if(p.properties)for(var m in p.properties)h.addProperty(m,p.properties[m]);if(p.inputs)for(var m in h.inputs=[],p.inputs)h.addOutput(p.inputs[m][0],p.inputs[m][1]);if(p.outputs)for(var m in h.outputs=[],p.outputs)h.addOutput(p.outputs[m][0],p.outputs[m][1]);p.title&&(h.title=p.title),p.json&&h.configure(p.json)}return this.graph.add(h),h.pos=[n.position[0]+n.posAdd[0]+(n.posSizeFix[0]?n.posSizeFix[0]*h.size[0]:0),n.position[1]+n.posAdd[1]+(n.posSizeFix[1]?n.posSizeFix[1]*h.size[1]:0)],s?n.nodeFrom.connectByType(r,h,d):n.nodeTo.connectByTypeOutput(r,h,d),!0}}}return!1},LGraphCanvas.prototype.showConnectionMenu=function(e){e=e||{};var t,n=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,e:null},e),s=this,o=n.nodeFrom&&n.slotFrom,i=!o&&n.nodeTo&&n.slotTo;if(!o&&!i)return!1;var a=o?n.nodeFrom:n.nodeTo,l=o?n.slotFrom:n.slotTo,r=!1;switch(typeof l){case"string":r=o?a.findOutputSlot(l,!1):a.findInputSlot(l,!1),l=o?a.outputs[l]:a.inputs[l];break;case"object":r=o?a.findOutputSlot(l.name):a.findInputSlot(l.name);break;case"number":r=l,l=o?a.outputs[l]:a.inputs[l];break;default:return!1}var d=["Add Node",null];s.allow_searchbox&&(d.push("Search"),d.push(null));var u=l.type==LiteGraph.EVENT?"_event_":l.type,c=o?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in,p=a.type;if(c&&c[u]){const e=o?"from":"to";if(Ut[p]&&Ut[p][e]&&(null==(t=Ut[p][e][u])?void 0:t.length)>0)for(var h in Ut[p][e][u])d.push(Ut[p][e][u][h]);else if("object"==typeof c[u]||"array"==typeof c[u])for(var h in c[u])d.push(c[u][h]);else d.push(c[u])}var m=new LiteGraph.ContextMenu(d,{event:n.e,title:(l&&""!=l.name?l.name+(u?" | ":""):"")+(l&&u?u:""),callback:function(e,t,i){switch(e){case"Add Node":LGraphCanvas.onMenuAdd(null,null,i,m,(function(e){o?n.nodeFrom.connectByType(r,e,u):n.nodeTo.connectByTypeOutput(r,e,u)}));break;case"Search":o?s.showSearchBox(i,{node_from:n.nodeFrom,slot_from:l,type_filter_in:u}):s.showSearchBox(i,{node_to:n.nodeTo,slot_from:l,type_filter_out:u});break;default:s.createDefaultNodeForSlot(Object.assign(n,{position:[n.e.canvasX,n.e.canvasY],nodeType:e}))}}});return!1}}}),w.registerExtension({name:"Comfy.EasyUse.TimeTaken",setup(){const e=new Map;let t=0;b.addEventListener("executing",(n=>{if(!I("EasyUse.Nodes.Runtime",null,!0))return;const s=(null==n?void 0:n.node)||(null==n?void 0:n.detail)||null,o=be(s);o&&(o.executionDuration="");const i=e.get(t);if(e.delete(t),t&&i){const e=Date.now()-i,n=be(t);n&&(n.executionDuration=`${(e/1e3).toFixed(2)}${Z("s")}`)}t=s,e.set(s,Date.now())}))},beforeRegisterNodeDef(e,t){const n=e.prototype.onDrawForeground;e.prototype.onDrawForeground=function(...e){const[t]=e;return function(e,t){if(!t)return;e.save(),e.fillStyle=LiteGraph.NODE_DEFAULT_BGCOLOR,function(e,t,n,s,o,i){e.beginPath(),e.moveTo(t+i,n),e.lineTo(t+s-i,n),e.arcTo(t+s,n,t+s,n+i,i),e.lineTo(t+s,n+o-i),e.arcTo(t+s,n+o,t+s-i,n+o,i),e.lineTo(t+i,n+o),e.arcTo(t,n+o,t,n+o-i,i),e.lineTo(t,n+i),e.arcTo(t,n,t+i,n,i),e.closePath()}(e,0,-LiteGraph.NODE_TITLE_HEIGHT-20,e.measureText(t).width+10,LiteGraph.NODE_TITLE_HEIGHT-10,4),e.fill(),function(e,t,n,s,o="#000",i=12,a="Inter"){e.font=`${i}px ${a}`,e.fillStyle=o,e.fillText(t,n,s)}(e,t,8,-LiteGraph.NODE_TITLE_HEIGHT-6,LiteGraph.NODE_TITLE_COLOR),e.restore()}(t,this.executionDuration||""),null==n?void 0:n.apply(this,e)}}});let Bt=null;w.registerExtension({name:"Comfy.EasyUse.HotKeys",setup(){if(void 0!==_){_("up,down,left,right",(function(e,t){var n,s,o,i,a,l,r,d,u,c,p,h,m,g,f;e.preventDefault();if(!I("EasyUse.Hotkeys.JumpNearestNodes",null,!0))return;const y=Le();if(0===y.length)return;const _=y[0];switch(t.key){case"up":case"left":let e=null;if(Ie(_)){const e=null==(n=_.widgets_values)?void 0:n[0],t=null==(s=_.graph)?void 0:s._nodes,o=null==t?void 0:t.find((t=>{var n;if(xe(t)){if((null==(n=t.widgets_values)?void 0:n[0])===e)return t}return null}));o&&Ee(o)}else if((null==(o=_.inputs)?void 0:o.length)>0){for(let t=0;t<_.inputs.length;t++)if(_.inputs[t].link){e=_.inputs[t].link;break}if(e){const t=null==(i=_.graph)?void 0:i.links;if(t[e]){const n=null==(a=t[e])?void 0:a.origin_id,s=null==(r=null==(l=_.graph)?void 0:l._nodes_by_id)?void 0:r[n];s&&Ee(s)}}}break;case"down":case"right":let t=null;if(xe(_)){const e=null==(d=_.widgets_values)?void 0:d[0],t=null==(u=_.graph)?void 0:u._nodes,n=null==t?void 0:t.find((t=>{var n;if(Ie(t)){if((null==(n=t.widgets_values)?void 0:n[0])===e)return t}return null}));n&&Ee(n)}else if((null==(c=_.outputs)?void 0:c.length)>0){for(let e=0;e<_.outputs.length;e++)if((null==(p=_.outputs[e].links)?void 0:p.length)>0&&_.outputs[e].links[0]){t=_.outputs[e].links[0];break}if(t){const e=null==(h=_.graph)?void 0:h.links;if(e[t]){const n=null==(m=e[t])?void 0:m.target_id,s=null==(f=null==(g=_.graph)?void 0:g._nodes_by_id)?void 0:f[n];s&&Ee(s)}}}}})),_("shift+up,shift+down,shift+left,shift+right",(function(e,t){e.preventDefault();if(!I("EasyUse.Hotkeys.AlignSelectedNodes",null,!0))return;const n=Le();if(n.length<=1)return;const s=n;switch(t.key){case"shift+up":LGraphCanvas.alignNodes(s,"top",s[0]);break;case"shift+down":LGraphCanvas.alignNodes(s,"bottom",s[0]);break;case"shift+left":LGraphCanvas.alignNodes(s,"left",s[0]);break;case"shift+right":LGraphCanvas.alignNodes(s,"right",s[0])}Bt||(Bt=Q()),Bt&&Bt.update()})),_("shift+g",(function(e,t){e.preventDefault();I("EasyUse.Hotkeys.AddGroup",null,!0)&&(Wt(),Bt||(Bt=Q()),Bt&&Bt.update())})),_("shift+r",(function(e,t){e.preventDefault();I("EasyUse.Hotkeys.cleanVRAMused",null,!0)&&q()}));const e=[];Array.from(Array(10).keys()).forEach((t=>e.push(`alt+${t}`))),_(e.join(","),(async function(e,t){e.preventDefault();if(!I("EasyUse.Hotkeys.NodesTemplate",null,!0))return;const n=t.key;let s=parseInt(n.split("+")[1]);const o=await b.getUserData("comfy.templates.json");let i=null;if(200==o.status)try{i=await o.json()}catch(l){$.error(Z("Get Node Templates File Failed"))}else localStorage["Comfy.NodeTemplates"]?i=JSON.parse(localStorage["Comfy.NodeTemplates"]):$.warn(Z("No Node Templates Found"));if(!i)return void $.warn(Z("No Node Templates Found"));s=0===s?9:s-1;const a=i[s];if(a)try{const e=(null==a?void 0:a.name)||"Group",t=(null==a?void 0:a.data)?JSON.parse(a.data):[];zt((async()=>{await A.registerFromWorkflow(t.groupNodes,{}),localStorage.litegrapheditor_clipboard=a.data,w.canvas.pasteFromClipboard(),t.groupNodes||Wt(e)}))}catch(l){$.error(l)}else $.warn(Z("Node template with {key} not set").replace("{key}",n))}));const t=async function(e){if(("b"===e.key||"m"==e.key)&&(e.metaKey||e.ctrlKey)){if(0===Le().length)return;Bt||(Bt=Q()),Bt&&Bt.update()}};window.addEventListener("keydown",t,!0)}}});const zt=async e=>{const t=localStorage.litegrapheditor_clipboard;await e(),localStorage.litegrapheditor_clipboard=t},Wt=e=>{const t=Le();if(0===t.length)return;const n=t;let s=new LiteGraph.LGraphGroup;s.title=e||"Group",((e,t=[],n=20)=>{var s,o,i,a,l,r,d,u,c,p;for(var h of(o=i=a=l=-1,r=d=u=c=-1,[e._nodes,t]))for(var m in h)r=(p=h[m]).pos[0],d=p.pos[1],u=p.pos[0]+p.size[0],c=p.pos[1]+p.size[1],"Reroute"!=p.type&&(d-=LiteGraph.NODE_TITLE_HEIGHT),(null==(s=p.flags)?void 0:s.collapsed)&&(c=d+LiteGraph.NODE_TITLE_HEIGHT,(null==p?void 0:p._collapsed_width)&&(u=r+Math.round(p._collapsed_width))),(-1==o||ra)&&(a=u),(-1==l||c>l)&&(l=c);i-=Math.round(1.4*e.font_size),e.pos=[o-n,i-n],e.size=[a-o+2*n,l-i+2*n]})(s,n),w.canvas.graph.add(s)};function jt(e,t,n,s){const o=[];return e.workflow.links.forEach((e=>{n&&e[1]===t&&!o.includes(e[3])&&o.push(e[3]),s&&e[3]===t&&!o.includes(e[1])&&o.push(e[1])})),o}async function Vt(e,t=!1){const n=structuredClone(await w.graphToPrompt()),s=[];if(n.workflow.nodes.forEach((e=>{s.push(e.id)})),n.workflow.links=n.workflow.links.filter((e=>s.includes(e[1])&&s.includes(e[3]))),t)for(;!w.graph._nodes_by_id[e].isChooser;)e=jt(n,e,!0,!1)[0];const o=function(e,t){const n=[],s=[t];for(;s.length>0;){const t=s.pop();n.push(t),s.push(...jt(e,t,!0,!1).filter((e=>!(n.includes(e)||s.includes(e)))))}s.push(...n.filter((e=>e!=t)));const o=[t];for(;s.length>0;){const t=s.pop();o.push(t),s.push(...jt(e,t,!1,!0).filter((e=>!(o.includes(e)||s.includes(e)))))}const i=[];return i.push(...n),i.push(...o.filter((e=>!i.includes(e)))),i}(n,e);n.workflow.nodes=n.workflow.nodes.filter((t=>(t.id===e&&t.inputs.forEach((e=>{e.link=null})),o.includes(t.id)))),n.workflow.links=n.workflow.links.filter((e=>o.includes(e[1])&&o.includes(e[3])));const i={};for(const[r,d]of Object.entries(n.output))o.includes(parseInt(r))&&(i[r]=d);const a={};for(const[r,d]of Object.entries(i[e.toString()].inputs))Array.isArray(d)||(a[r]=d);i[e.toString()].inputs=a,n.output=i;const l=w.graphToPrompt;w.graphToPrompt=()=>(w.graphToPrompt=l,n),w.queuePrompt(0)}const Yt=new class{constructor(){this.current_node_id=void 0,this.class_of_current_node=null,this.current_node_is_chooser=!1}update(){var e,t;return w.runningNodeId!=this.current_node_id&&(this.current_node_id=w.runningNodeId,this.current_node_id?(this.class_of_current_node=null==(t=null==(e=w.graph)?void 0:e._nodes_by_id[w.runningNodeId.toString()])?void 0:t.comfyClass,this.current_node_is_chooser="easy imageChooser"===this.class_of_current_node):(this.class_of_current_node=void 0,this.current_node_is_chooser=!1),!0)}},Ht=class e{constructor(){}static idle(){return!w.runningNodeId}static paused(){return!0}static paused_here(t){return e.here(t)}static running(){return!e.idle()}static here(e){return w.runningNodeId==e}static state(){return"Paused"}};f(Ht,"cancelling",!1);let Xt=Ht;function Zt(e,t){const n=new FormData;n.append("message",t),n.append("id",e),b.fetchApi("/easyuse/image_chooser_message",{method:"POST",body:n})}function Kt(){Zt(-1,"__cancel__"),Xt.cancelling=!0,b.interrupt(),Xt.cancelling=!1}var Jt=0;function $t(){Jt+=1}const qt=["easy kSampler","easy kSamplerTiled","easy fullkSampler"];function Qt(e){const t=w.graph._nodes_by_id[e.detail.id];if(t){t.selected=new Set,t.anti_selected=new Set;const n=function(e,t){var n;return e.imgs=[],t.forEach((t=>{const n=new Image;e.imgs.push(n),n.onload=()=>{w.graph.setDirtyCanvas(!0)},n.src=`/view?filename=${encodeURIComponent(t.filename)}&type=temp&subfolder=${w.getPreviewFormatParam()}`})),null==(n=e.setSizeForImage)||n.call(e),e.imgs}(t,e.detail.urls);return{node:t,image:n,isKSampler:qt.includes(t.type)}}}function en(e,t,n){var s;if(e.imageRects)s=e.imageRects[t];else{const t=e.imagey;s=[1,t+1,e.size[0]-2,e.size[1]-t-2]}n.strokeRect(s[0]+1,s[1]+1,s[2]-2,s[3]-2)}class tn extends S{constructor(){super(),this.node=null,this.select_index=[],this.dialog_div=null}show(e,t){this.select_index=[],this.node=t;const n=e.map(((e,n)=>{const s=L("img",{src:e.src,onclick:e=>{this.select_index.includes(n)?(this.select_index=this.select_index.filter((e=>e!==n)),s.classList.remove("selected")):(this.select_index.push(n),s.classList.add("selected")),t.selected.has(n)?t.selected.delete(n):t.selected.add(n)}});return s}));super.show(L("div.comfyui-easyuse-chooser-dialog",[L("h5.comfyui-easyuse-chooser-dialog-title",Z("Choose images to continue")),L("div.comfyui-easyuse-chooser-dialog-images",n)]))}createButtons(){const e=super.createButtons();return e[0].onclick=e=>{Xt.running()&&Kt(),super.close()},e.unshift(L("button",{type:"button",textContent:Z("Choose Selected Images"),onclick:e=>{Zt(this.node.id,[...this.node.selected,-1,...this.node.anti_selected]),Xt.idle()&&($t(),Vt(this.node.id).then((()=>{Zt(this.node.id,[...this.node.selected,-1,...this.node.anti_selected])}))),super.close()}})),e}}function nn(){const e=w.graph._nodes_by_id[this.node_id];if(e){const t=[...e.selected];(null==t?void 0:t.length)>0&&e.setProperty("values",t),Zt(e.id,[...e.selected,-1,...e.anti_selected]),Xt.idle()&&($t(),Vt(e.id).then((()=>{Zt(e.id,[...e.selected,-1,...e.anti_selected])})))}}function sn(){Xt.running()&&Kt()}function on(e){Object.defineProperty(e,"clicked",{get:function(){return this._clicked},set:function(e){this._clicked=e&&""!=this.name}})}function an(e){e.options||(e.options={}),e.options.serialize=!1}w.registerExtension({name:"Comfy.EasyUse.imageChooser",init(){window.addEventListener("beforeunload",Kt,!0)},setup(e){const t=LGraphCanvas.prototype.draw;LGraphCanvas.prototype.draw=function(){Yt.update()&&e.graph._nodes.forEach((e=>{e.update&&e.update()})),t.apply(this,arguments)},b.addEventListener("easyuse-image-choose",(function(e){const{node:t,image:n,isKSampler:s}=Qt(e);if(s){(new tn).show(n,t)}}));const n=b.interrupt;b.interrupt=function(){Xt.cancelling||Kt(),n.apply(this,arguments)},b.addEventListener("execution_start",(function(){(Jt>0?(Jt-=1,0):(Zt(-1,"__start__"),1))&&e.graph._nodes.forEach((e=>{(e.selected||e.anti_selected)&&(e.selected.clear(),e.anti_selected.clear(),e.update())}))}))},async nodeCreated(e,t){if("easy imageChooser"==e.comfyClass){e.setProperty("values",[]),void 0===(null==e?void 0:e.imageIndex)&&Object.defineProperty(e,"imageIndex",{get:function(){return null},set:function(t){e.overIndex=t}}),void 0===(null==e?void 0:e.imagey)&&Object.defineProperty(e,"imagey",{get:function(){return null},set:function(t){return e.widgets[e.widgets.length-1].last_y+LiteGraph.NODE_WIDGET_HEIGHT}});const t=e.onMouseDown;e.onMouseDown=function(n,s,o){if(n.isPrimary){const t=function(e,t){var n,s;if((null==(n=e.imgs)?void 0:n.length)>1)for(var o=0;o0&&n0&&se.imagey)return 0;return-1}(e,s);t>=0&&this.imageClicked(t)}return t&&t.apply(this,arguments)},e.send_button_widget=e.addWidget("button","","",nn),e.cancel_button_widget=e.addWidget("button","","",sn),on(e.cancel_button_widget),on(e.send_button_widget),an(e.cancel_button_widget),an(e.send_button_widget)}},beforeRegisterNodeDef(e,t,n){if("easy imageChooser"==(null==t?void 0:t.name)){const t=e.prototype.onDrawBackground;e.prototype.onDrawBackground=function(e){t.apply(this,arguments),function(e,t){var n,s;if(e.imgs){if(e.imageRects)for(let n=0;n{en(e,n,t)})),t.strokeStyle="#F88",null==(s=null==e?void 0:e.anti_selected)||s.forEach((n=>{en(e,n,t)}))}}(this,e)},e.prototype.imageClicked=function(t){"easy imageChooser"===(null==e?void 0:e.comfyClass)&&(this.selected.has(t)?this.selected.delete(t):this.selected.add(t),this.update())};const n=e.prototype.update;e.prototype.update=function(){var e;if(n&&n.apply(this,arguments),this.send_button_widget){this.send_button_widget.node_id=this.id;const t=(this.selected?this.selected.size:0)+(this.anti_selected?this.anti_selected.size:0),n=(null==(e=this.imgs)?void 0:e.length)||0;Xt.paused_here(this.id)&&t>0?this.send_button_widget.name=t>1?"Progress selected ("+t+"/"+n+")":"Progress selected image":this.send_button_widget.name=t>0?t>1?"Progress selected ("+t+"/"+n+")":"Progress selected image as restart":""}if(this.cancel_button_widget){const e=Xt.running();this.cancel_button_widget.name=e?"Cancel current run":""}this.setDirtyCanvas(!0,!0)}}}}),Number.prototype.div=function(e){return function(e,t){let n,s,o=0,i=0,a="string"==typeof e?e:e.toString(),l="string"==typeof t?t:t.toString();try{o=a.toString().split(".")[1].length}catch(r){}try{i=l.toString().split(".")[1].length}catch(r){}return n=Number(a.toString().replace(".","")),s=Number(l.toString().replace(".","")),n/s*Math.pow(10,i-o)}(this,e)};let ln=[],rn=0;const dn={sd3:6.5,"sd3-turbo":4};class un extends S{constructor(){super(),this.lists=[],this.dialog_div=null,this.user_div=null}addItem(e,t){return L("div.easyuse-account-dialog-item",[L("input",{type:"text",placeholder:"Enter name",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);ln[t].name=e.target.value},value:ln[e].name}),L("input.key",{type:"text",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);ln[t].key=e.target.value},placeholder:"Enter APIKEY",value:ln[e].key}),L("button.choose",{textContent:Z("Choose"),onclick:async e=>{var n,s,o;const i=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);let a=ln[i].name,l=ln[i].key;if(!a)return void $.error(Z("Please enter the account name"));if(!l)return void $.error(Z("Please enter the APIKEY"));let r=!0;for(let t=0;t{(new un).show(t)}},[L("div.user",[L("div.avatar",i?[L("img",{src:i})]:"😀"),L("div.info",[L("h5.name",a),L("h6.remark","Credits: "+l)])]),L("div.edit",{textContent:Z("Edit")})])),$.success(Z("Save Succeed"))}else $.success(Z("Save Succeed"));this.close()}else $.error(Z("Save Failed"))}}),L("button.delete",{textContent:Z("Delete"),onclick:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);ln.length<=1?$.error(Z("At least one account is required")):(ln.splice(t,1),this.dialog_div.removeChild(e.target.parentNode))}})])}show(e){ln.forEach(((t,n)=>{this.lists.push(this.addItem(n,e))})),this.dialog_div=L("div.easyuse-account-dialog",this.lists),super.show(L("div.easyuse-account-dialog-main",[L("div",[L("a",{href:"https://platform.stability.ai/account/keys",target:"_blank",textContent:Z("Getting Your APIKEY")})]),this.dialog_div]))}createButtons(){const e=super.createButtons();return e.unshift(L("button",{type:"button",textContent:Z("Save Account Info"),onclick:e=>{let t=!0;for(let n=0;n{200==e.status?$.success(Z("Save Succeed")):$.error(Z("Save Failed"))}))}else $.error(Z("APIKEY is not Empty"))}})),e.unshift(L("button",{type:"button",textContent:Z("Add Account"),onclick:e=>{const t="Account "+ln.length.toString();ln.push({name:t,key:""});const n=this.addItem(ln.length-1);this.lists.push(n),this.dialog_div.appendChild(n)}})),e}}w.registerExtension({name:"Comfy.EasyUse.API.SD3",async beforeRegisterNodeDef(e,t,n){if("easy stableDiffusion3API"==t.name){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=async function(){var e,n,s;t&&(null==t||t.apply(this,arguments));const o=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),i=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));let a=this.widgets.find((e=>"model"==e.name));a.callback=e=>{l.value="-"+dn[e]};const l=this.addWidget("text","cost_credit","0",(e=>{}),{serialize:!1});l.disabled=!0,setTimeout((e=>{"control_before_generate"==i.name&&0===o.value&&(o.value=Math.floor(4294967294*Math.random())),l.value="-"+dn[a.value]}),100);let r=L("div.easyuse-account-user",[Z("Loading UserInfo...")]);this.addDOMWidget("account","btn",L("div.easyuse-account",r)),b.addEventListener("stable-diffusion-api-generate-succeed",(async({detail:e})=>{var t;let n=r.querySelectorAll(".remark");if(n&&n[0]){const t=(null==e?void 0:e.model)?dn[e.model]:0;if(t){let e=function(e,t){let n,s,o,i,a,l;a="string"==typeof e?e:e.toString(),l="string"==typeof t?t:t.toString();try{n=a.split(".")[1].length}catch(r){n=0}try{s=l.split(".")[1].length}catch(r){s=0}return o=Math.pow(10,Math.max(n,s)),i=n>=s?n:s,((e*o-t*o)/o).toFixed(i)}(parseFloat(n[0].innerText.replace(/Credits: /g,"")),t);e>0&&(n[0].innerText="Credits: "+e.toString())}}await J(1e4);const s=await b.fetchApi("/easyuse/stability/balance");if(200==s.status){const e=await s.json();if(null==e?void 0:e.balance){const s=(null==(t=e.balance)?void 0:t.credits)||0;n&&n[0]&&(n[0].innerText="Credits: "+s)}}}));const d=await b.fetchApi("/easyuse/stability/api_keys");if(200==d.status){let t=await d.json();if(ln=t.keys,rn=t.current,ln.length>0&&void 0!==rn){const t=ln[rn].key,o=ln[rn].name;if(t){const t=await b.fetchApi("/easyuse/stability/user_info");if(200==t.status){const o=await t.json();if((null==o?void 0:o.account)&&(null==o?void 0:o.balance)){const t=(null==(e=o.account)?void 0:e.profile_picture)||null,i=(null==(n=o.account)?void 0:n.email)||null,a=(null==(s=o.balance)?void 0:s.credits)||0;r.replaceChildren(L("div.easyuse-account-user-info",{onclick:e=>{(new un).show(r)}},[L("div.user",[L("div.avatar",t?[L("img",{src:t})]:"😀"),L("div.info",[L("h5.name",i),L("h6.remark","Credits: "+a)])]),L("div.edit",{textContent:Z("Edit")})]))}}}else r.replaceChildren(L("div.easyuse-account-user-info",{onclick:e=>{(new un).show(r)}},[L("div.user",[L("div.avatar","😀"),L("div.info",[L("h5.name",o),L("h6.remark",Z("Click to set the APIKEY first"))])]),L("div.edit",{textContent:Z("Edit")})]))}}}}}});let cn=null;function pn(){cn&&(cn.removeEventListeners(),cn.dropdown.remove(),cn=null)}function hn(e,t,n,s=!1){pn(),new mn(e,t,n,s)}class mn{constructor(e,t,n,s=!1){this.dropdown=document.createElement("ul"),this.dropdown.setAttribute("role","listbox"),this.dropdown.classList.add("easy-dropdown"),this.selectedIndex=-1,this.inputEl=e,this.suggestions=t,this.onSelect=n,this.isDict=s,this.focusedDropdown=this.dropdown,this.buildDropdown(),this.onKeyDownBound=this.onKeyDown.bind(this),this.onWheelBound=this.onWheel.bind(this),this.onClickBound=this.onClick.bind(this),this.addEventListeners()}buildDropdown(){this.isDict?this.buildNestedDropdown(this.suggestions,this.dropdown):this.suggestions.forEach(((e,t)=>{this.addListItem(e,t,this.dropdown)}));const e=this.inputEl.getBoundingClientRect();this.dropdown.style.top=e.top+e.height-10+"px",this.dropdown.style.left=e.left+"px",document.body.appendChild(this.dropdown),cn=this}buildNestedDropdown(e,t){let n=0;Object.keys(e).forEach((s=>{const o=e[s];if("object"==typeof o&&null!==o){const e=document.createElement("ul");e.setAttribute("role","listbox"),e.classList.add("easy-nested-dropdown");const i=document.createElement("li");i.classList.add("folder"),i.textContent=s,i.appendChild(e),i.addEventListener("mouseover",this.onMouseOver.bind(this,n,t)),t.appendChild(i),this.buildNestedDropdown(o,e),n+=1}else{const e=document.createElement("li");e.classList.add("item"),e.setAttribute("role","option"),e.textContent=s,e.addEventListener("mouseover",this.onMouseOver.bind(this,n,t)),e.addEventListener("mousedown",this.onMouseDown.bind(this,s)),t.appendChild(e),n+=1}}))}addListItem(e,t,n){const s=document.createElement("li");s.setAttribute("role","option"),s.textContent=e,s.addEventListener("mouseover",this.onMouseOver.bind(this,t)),s.addEventListener("mousedown",this.onMouseDown.bind(this,e)),n.appendChild(s)}addEventListeners(){document.addEventListener("keydown",this.onKeyDownBound),this.dropdown.addEventListener("wheel",this.onWheelBound),document.addEventListener("click",this.onClickBound)}removeEventListeners(){document.removeEventListener("keydown",this.onKeyDownBound),this.dropdown.removeEventListener("wheel",this.onWheelBound),document.removeEventListener("click",this.onClickBound)}onMouseOver(e,t){t&&(this.focusedDropdown=t),this.selectedIndex=e,this.updateSelection()}onMouseOut(){this.selectedIndex=-1,this.updateSelection()}onMouseDown(e,t){t.preventDefault(),this.onSelect(e),this.dropdown.remove(),this.removeEventListeners()}onKeyDown(e){const t=Array.from(this.focusedDropdown.children),n=t[this.selectedIndex];if(cn)if(38===e.keyCode)e.preventDefault(),this.selectedIndex=Math.max(0,this.selectedIndex-1),this.updateSelection();else if(40===e.keyCode)e.preventDefault(),this.selectedIndex=Math.min(t.length-1,this.selectedIndex+1),this.updateSelection();else if(39===e.keyCode){if(e.preventDefault(),n&&n.classList.contains("folder")){const e=n.querySelector(".easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=0,this.updateSelection())}}else if(37===e.keyCode&&this.focusedDropdown!==this.dropdown){const e=this.focusedDropdown.closest(".easy-dropdown, .easy-nested-dropdown").parentNode.closest(".easy-dropdown, .easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=Array.from(e.children).indexOf(this.focusedDropdown.parentNode),this.updateSelection())}else if((13===e.keyCode||9===e.keyCode)&&this.selectedIndex>=0){e.preventDefault(),n.classList.contains("item")&&(this.onSelect(t[this.selectedIndex].textContent),this.dropdown.remove(),this.removeEventListeners());const s=n.querySelector(".easy-nested-dropdown");s&&(this.focusedDropdown=s,this.selectedIndex=0,this.updateSelection())}else 27===e.keyCode&&(this.dropdown.remove(),this.removeEventListeners())}onWheel(e){const t=parseInt(this.dropdown.style.top);localStorage.getItem("Comfy.Settings.Comfy.InvertMenuScrolling")?this.dropdown.style.top=t+(e.deltaY<0?10:-10)+"px":this.dropdown.style.top=t+(e.deltaY<0?-10:10)+"px"}onClick(e){this.dropdown.contains(e.target)||e.target===this.inputEl||(this.dropdown.remove(),this.removeEventListeners())}updateSelection(){Array.from(this.focusedDropdown.children).forEach(((e,t)=>{t===this.selectedIndex?e.classList.add("selected"):e.classList.remove("selected")}))}}function gn(e){const t=e.min||0,n=e.max||0,s=e.step||1;if(0===s)return[];const o=[];let i=t;for(;i<=n;){if(Number.isInteger(s))o.push(Math.round(i)+"; ");else{let e=i.toFixed(3);-0==e&&(e="0.000"),/\.\d{3}$/.test(e)||(e+="0"),o.push(e+"; ")}i+=s}return n>=0&&t>=0?o:o.reverse()}let fn={},yn={};function _n(e,t){String(e.id);const n=t.name,s=t.value.replace(/^(loader|preSampling):\s/,"");yn[n]?yn[n]!=fn[s]&&(yn[n]=fn[s]):yn={...yn,[n]:fn[s]}}w.registerExtension({name:"Comfy.EasyUse.XYPlot",async beforeRegisterNodeDef(e,t,n){if("easy XYPlot"===t.name){fn=t.input.hidden.plot_dict[0];for(const e in fn){const t=fn[e];if(Array.isArray(t)){let n=[];for(const e of t)n.push(e+"; ");fn[e]=n}else fn[e]="object"==typeof t?"seed"==e?t+"; ":gn(t):t+"; "}fn.None=[],fn["---------------------"]=[]}},nodeCreated(e){"easy XYPlot"===e.comfyClass&&(function(e){if(e.widgets)for(const t of e.widgets)if("x_axis"===t.name||"y_axis"===t.name){let n=t.value;Object.defineProperty(t,"value",{get:()=>n,set(s){s!==n&&(n=s,_n(e,t))}})}}(e),function(e){if(e.widgets){const t=e.widgets.filter((e=>"customtext"===e.type&&!1!==e.dynamicPrompts||e.dynamicPrompts));for(const e of t){let t=function(e,t,s,o){return e&&(t[s]=e),t.map((e=>n(e,o))).filter((e=>""!==e)).join("")},n=function(e,t){if(e=s(e),o(e,t))return e+"; ";let n=i(e,t);return 1===n.length||2===n.length?n[0]:o(a(e),t)?a(e)+"; ":""},s=function(e){return e.replace(/(\n|;| )/g,"")},o=function(e,t){return t.includes(e+"; ")},i=function(e,t){return t.filter((t=>t.toLowerCase().includes(e.toLowerCase())))},a=function(e){return Number(e)?Number(e).toFixed(3):["0","0.","0.0","0.00","00"].includes(e)?"0.000":e};const l=function(){const n=e.name[0]+"_axis";let s=(null==yn?void 0:yn[n])||[];if(0===s.length)return;const o=e.inputEl.value,i=e.inputEl.selectionStart;let a=o.split("; ");const l=o.substring(0,i).split("; ").length-1,r=a[l].replace(/\n/g,"").toLowerCase(),d=s.filter((e=>e.toLowerCase().includes(r))).map((e=>e.replace(/; /g,"")));if(d.length>0)hn(e.inputEl,d,(n=>{const o=t(n,a,l,s);e.inputEl.value=o}));else{pn();const n=t(null,a,l,s);e.inputEl.value=n}};e.inputEl.removeEventListener("input",l),e.inputEl.addEventListener("input",l),e.inputEl.removeEventListener("mouseup",l),e.inputEl.addEventListener("mouseup",l)}}}(e))}});export{Z as $,U as N,b as a,w as b,_e as c,I as d,q as e,B as f,ye as g,x as h,Ce as j,X as l,J as s,$ as t,Q as u}; diff --git a/web_version/v2/assets/lodash-CZi7izHi.js b/web_version/v2/assets/lodash-CZi7izHi.js new file mode 100644 index 0000000..915496d --- /dev/null +++ b/web_version/v2/assets/lodash-CZi7izHi.js @@ -0,0 +1 @@ +var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e=function(){this.__data__=[],this.size=0};var n=function(t,r){return t===r||t!=t&&r!=r},o=n;var a=function(t,r){for(var e=t.length;e--;)if(o(t[e][0],r))return e;return-1},c=a,u=Array.prototype.splice;var i=a;var s=a;var f=a;var p=e,v=function(t){var r=this.__data__,e=c(r,t);return!(e<0)&&(e==r.length-1?r.pop():u.call(r,e,1),--this.size,!0)},l=function(t){var r=this.__data__,e=i(r,t);return e<0?void 0:r[e][1]},b=function(t){return s(this.__data__,t)>-1},y=function(t,r){var e=this.__data__,n=f(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this};function j(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},Mr=k,Tr=Ir,Er=sr,Br={};Br["[object Float32Array]"]=Br["[object Float64Array]"]=Br["[object Int8Array]"]=Br["[object Int16Array]"]=Br["[object Int32Array]"]=Br["[object Uint8Array]"]=Br["[object Uint8ClampedArray]"]=Br["[object Uint16Array]"]=Br["[object Uint32Array]"]=!0,Br["[object Arguments]"]=Br["[object Array]"]=Br["[object ArrayBuffer]"]=Br["[object Boolean]"]=Br["[object DataView]"]=Br["[object Date]"]=Br["[object Error]"]=Br["[object Function]"]=Br["[object Map]"]=Br["[object Number]"]=Br["[object Object]"]=Br["[object RegExp]"]=Br["[object Set]"]=Br["[object String]"]=Br["[object WeakMap]"]=!1;var Dr=function(t){return Er(t)&&Tr(t.length)&&!!Br[Mr(t)]};var $r=function(t){return function(r){return t(r)}},kr={exports:{}};!function(t,r){var e=A,n=r&&!r.nodeType&&r,o=n&&t&&!t.nodeType&&t,a=o&&o.exports===n&&e.process,c=function(){try{var t=o&&o.require&&o.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(r){}}();t.exports=c}(kr,kr.exports);var Rr=kr.exports,Vr=Dr,Cr=$r,Nr=Rr&&Rr.isTypedArray,Wr=Nr?Cr(Nr):Vr,Lr=ir,qr=mr,Gr=Sr,Hr=Pr,Jr=Ur,Kr=Wr,Qr=Object.prototype.hasOwnProperty;var Xr=function(t,r){var e=Gr(t),n=!e&&qr(t),o=!e&&!n&&Hr(t),a=!e&&!n&&!o&&Kr(t),c=e||n||o||a,u=c?Lr(t.length,String):[],i=u.length;for(var s in t)!r&&!Qr.call(t,s)||c&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Jr(s,i))||u.push(s);return u},Yr=Object.prototype;var Zr=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||Yr)};var te=function(t,r){return function(e){return t(r(e))}},re=te(Object.keys,Object),ee=Zr,ne=re,oe=Object.prototype.hasOwnProperty;var ae=W,ce=Ir;var ue=function(t){return null!=t&&ce(t.length)&&!ae(t)},ie=Xr,se=function(t){if(!ee(t))return ne(t);var r=[];for(var e in Object(t))oe.call(t,e)&&"constructor"!=e&&r.push(e);return r},fe=ue;var pe=function(t){return fe(t)?ie(t):se(t)},ve=ur,le=pe;var be=function(t,r){return t&&ve(r,le(r),t)};var ye=R,je=Zr,he=function(t){var r=[];if(null!=t)for(var e in Object(t))r.push(e);return r},_e=Object.prototype.hasOwnProperty;var de=Xr,ge=function(t){if(!ye(t))return he(t);var r=je(t),e=[];for(var n in t)("constructor"!=n||!r&&_e.call(t,n))&&e.push(n);return e},Oe=ue;var we=function(t){return Oe(t)?de(t,!0):ge(t)},Ae=ur,xe=we;var me=function(t,r){return t&&Ae(r,xe(r),t)},Se={exports:{}};!function(t,r){var e=S,n=r&&!r.nodeType&&r,o=n&&t&&!t.nodeType&&t,a=o&&o.exports===n?e.Buffer:void 0,c=a?a.allocUnsafe:void 0;t.exports=function(t,r){if(r)return t.slice();var e=t.length,n=c?c(e):new t.constructor(e);return t.copy(n),n}}(Se,Se.exports);var ze=Se.exports;var Pe=function(t,r){var e=-1,n=t.length;for(r||(r=Array(n));++eet=t,ct=Symbol();function at(t){return t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)&&"function"!=typeof t.toJSON}var it,lt;function ut(){const e=t(!0),r=e.run((()=>n({})));let c=[],a=[];const i=o({install(t){rt(i),i._a=t,t.provide(ct,i),t.config.globalProperties.$pinia=i,a.forEach((t=>c.push(t))),a=[]},use(t){return this._a?c.push(t):a.push(t),this},_p:c,_a:null,_e:e,_s:new Map,state:r});return i}(lt=it||(it={})).direct="direct",lt.patchObject="patch object",lt.patchFunction="patch function";const st=()=>{};function dt(t,n,o,e=st){t.push(n);const r=()=>{const o=t.indexOf(n);o>-1&&(t.splice(o,1),e())};return!o&&l()&&u(r),r}function pt(t,...n){t.slice().forEach((t=>{t(...n)}))}const bt=t=>t(),ft=Symbol(),ht=Symbol();function gt(t,n){t instanceof Map&&n instanceof Map?n.forEach(((n,o)=>t.set(o,n))):t instanceof Set&&n instanceof Set&&n.forEach(t.add,t);for(const o in n){if(!n.hasOwnProperty(o))continue;const e=n[o],r=t[o];at(r)&&at(e)&&t.hasOwnProperty(o)&&!c(e)&&!a(e)?t[o]=gt(r,e):t[o]=e}return t}const vt=Symbol();const{assign:yt}=Object;function mt(o,l,u={},d,p,b){let f;const h=yt({actions:{}},u),g={deep:!0};let v,y,m,x=[],k=[];const w=d.state.value[o];let _;function j(t){let n;v=y=!1,"function"==typeof t?(t(d.state.value[o]),n={type:it.patchFunction,storeId:o,events:m}):(gt(d.state.value[o],t),n={type:it.patchObject,payload:t,storeId:o,events:m});const e=_=Symbol();s().then((()=>{_===e&&(v=!0)})),y=!0,pt(x,n,d.state.value[o])}b||w||(d.state.value[o]={}),n({});const $=b?function(){const{state:t}=u,n=t?t():{};this.$patch((t=>{yt(t,n)}))}:st;const O=(t,n="")=>{if(ft in t)return t[ht]=n,t;const e=function(){rt(d);const n=Array.from(arguments),r=[],c=[];let a;pt(k,{args:n,name:e[ht],store:A,after:function(t){r.push(t)},onError:function(t){c.push(t)}});try{a=t.apply(this&&this.$id===o?this:A,n)}catch(i){throw pt(c,i),i}return a instanceof Promise?a.then((t=>(pt(r,t),t))).catch((t=>(pt(c,t),Promise.reject(t)))):(pt(r,a),a)};return e[ft]=!0,e[ht]=n,e},S={_p:d,$id:o,$onAction:dt.bind(null,k),$patch:j,$reset:$,$subscribe(t,n={}){const r=dt(x,t,n.detached,(()=>c())),c=f.run((()=>e((()=>d.state.value[o]),(e=>{("sync"===n.flush?y:v)&&t({storeId:o,type:it.direct,events:m},e)}),yt({},g,n))));return r},$dispose:function(){f.stop(),x=[],k=[],d._s.delete(o)}},A=r(S);d._s.set(o,A);const E=(d._a&&d._a.runWithContext||bt)((()=>d._e.run((()=>(f=t()).run((()=>l({action:O})))))));for(const t in E){const n=E[t];if(c(n)&&(!c(I=n)||!I.effect)||a(n))b||(!w||at(T=n)&&T.hasOwnProperty(vt)||(c(n)?n.value=w[t]:gt(n,w[t])),d.state.value[o][t]=n);else if("function"==typeof n){const o=O(n,t);E[t]=o,h.actions[t]=n}}var T,I;return yt(A,E),yt(i(A),E),Object.defineProperty(A,"$state",{get:()=>d.state.value[o],set:t=>{j((n=>{yt(n,t)}))}}),d._p.forEach((t=>{yt(A,f.run((()=>t({store:A,app:d._a,pinia:d,options:h}))))})),w&&b&&u.hydrate&&u.hydrate(A.$state,w),v=!0,y=!0,A}function xt(t,n,e){let r,c;const a="function"==typeof n;function i(t,e){const i=f();(t=t||(i?d(ct,null):null))&&rt(t),(t=et)._s.has(r)||(a?mt(r,n,c,t):function(t,n,e){const{state:r,actions:c,getters:a}=n,i=e.state.value[t];let l;l=mt(t,(function(){i||(e.state.value[t]=r?r():{});const n=p(e.state.value[t]);return yt(n,c,Object.keys(a||{}).reduce(((n,r)=>(n[r]=o(b((()=>{rt(e);const n=e._s.get(t);return a[r].call(n,n)}))),n)),{}))}),n,e,0,!0)}(r,c,t));return t._s.get(r)}return"string"==typeof t?(r=t,c=a?e:n):(c=t,r=t.id),i.$id=r,i}function kt(t){{t=i(t);const n={};for(const o in t){const e=t[o];(c(e)||a(e))&&(n[o]=h(t,o))}return n}}var wt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function _t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jt=function(){this.__data__=[],this.size=0};var $t=function(t,n){return t===n||t!=t&&n!=n},Ot=$t;var St=function(t,n){for(var o=t.length;o--;)if(Ot(t[o][0],n))return o;return-1},At=St,Et=Array.prototype.splice;var Tt=St;var It=St;var zt=St;var Bt=jt,Ct=function(t){var n=this.__data__,o=At(n,t);return!(o<0)&&(o==n.length-1?n.pop():Et.call(n,o,1),--this.size,!0)},Lt=function(t){var n=this.__data__,o=Tt(n,t);return o<0?void 0:n[o][1]},Pt=function(t){return It(this.__data__,t)>-1},Mt=function(t,n){var o=this.__data__,e=zt(o,t);return e<0?(++this.size,o.push([t,n])):o[e][1]=n,this};function Dt(t){var n=-1,o=null==t?0:t.length;for(this.clear();++n-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},oe=an,ee=ne,re=Bo,ce={};ce["[object Float32Array]"]=ce["[object Float64Array]"]=ce["[object Int8Array]"]=ce["[object Int16Array]"]=ce["[object Int32Array]"]=ce["[object Uint8Array]"]=ce["[object Uint8ClampedArray]"]=ce["[object Uint16Array]"]=ce["[object Uint32Array]"]=!0,ce["[object Arguments]"]=ce["[object Array]"]=ce["[object ArrayBuffer]"]=ce["[object Boolean]"]=ce["[object DataView]"]=ce["[object Date]"]=ce["[object Error]"]=ce["[object Function]"]=ce["[object Map]"]=ce["[object Number]"]=ce["[object Object]"]=ce["[object RegExp]"]=ce["[object Set]"]=ce["[object String]"]=ce["[object WeakMap]"]=!1;var ae=function(t){return re(t)&&ee(t.length)&&!!ce[oe(t)]};var ie=function(t){return function(n){return t(n)}},le={exports:{}};!function(t,n){var o=Nt,e=n&&!n.nodeType&&n,r=e&&t&&!t.nodeType&&t,c=r&&r.exports===e&&o.process,a=function(){try{var t=r&&r.require&&r.require("util").types;return t||c&&c.binding&&c.binding("util")}catch(n){}}();t.exports=a}(le,le.exports);var ue=le.exports,se=ae,de=ie,pe=ue&&ue.isTypedArray,be=pe?de(pe):se,fe=zo,he=Zo,ge=Jo,ve=Yo,ye=te,me=be,xe=Object.prototype.hasOwnProperty;var ke=function(t,n){var o=ge(t),e=!o&&he(t),r=!o&&!e&&ve(t),c=!o&&!e&&!r&&me(t),a=o||e||r||c,i=a?fe(t.length,String):[],l=i.length;for(var u in t)!n&&!xe.call(t,u)||a&&("length"==u||r&&("offset"==u||"parent"==u)||c&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ye(u,l))||i.push(u);return i},we=Object.prototype;var _e=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||we)};var je=function(t,n){return function(o){return t(n(o))}},$e=je(Object.keys,Object),Oe=_e,Se=$e,Ae=Object.prototype.hasOwnProperty;var Ee=pn,Te=ne;var Ie=function(t){return null!=t&&Te(t.length)&&!Ee(t)},ze=ke,Be=function(t){if(!Oe(t))return Se(t);var n=[];for(var o in Object(t))Ae.call(t,o)&&"constructor"!=o&&n.push(o);return n},Ce=Ie;var Le=function(t){return Ce(t)?ze(t):Be(t)},Pe=Io,Me=Le;var De=function(t,n){return t&&Pe(n,Me(n),t)};var He=ln,Fe=_e,Ue=function(t){var n=[];if(null!=t)for(var o in Object(t))n.push(o);return n},Ke=Object.prototype.hasOwnProperty;var Ve=ke,Re=function(t){if(!He(t))return Ue(t);var n=Fe(t),o=[];for(var e in t)("constructor"!=e||!n&&Ke.call(t,e))&&o.push(e);return o},Ne=Ie;var Ge=function(t){return Ne(t)?Ve(t,!0):Re(t)},We=Io,qe=Ge;var Ze=function(t,n){return t&&We(n,qe(n),t)},Je={exports:{}};!function(t,n){var o=qt,e=n&&!n.nodeType&&n,r=e&&t&&!t.nodeType&&t,c=r&&r.exports===e?o.Buffer:void 0,a=c?c.allocUnsafe:void 0;t.exports=function(t,n){if(n)return t.slice();var o=t.length,e=a?a(o):new t.constructor(o);return t.copy(e),e}}(Je,Je.exports);var Xe=Je.exports;var Ye=function(t,n){var o=-1,e=t.length;for(n||(n=Array(e));++o0;function ca(t,n,o,e){t.addEventListener?t.addEventListener(n,o,e):t.attachEvent&&t.attachEvent("on".concat(n),o)}function aa(t,n,o,e){t.removeEventListener?t.removeEventListener(n,o,e):t.detachEvent&&t.detachEvent("on".concat(n),o)}function ia(t,n){const o=n.slice(0,n.length-1);for(let e=0;e=0;)n[o-1]+=",",n.splice(o,1),o=n.lastIndexOf("");return n}const ua={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":ra?173:189,"=":ra?61:187,";":ra?59:186,"'":222,"[":219,"]":221,"\\":220},sa={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},da={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},pa={16:!1,18:!1,17:!1,91:!1},ba={};for(let Ya=1;Ya<20;Ya++)ua["f".concat(Ya)]=111+Ya;let fa=[],ha=null,ga="all";const va=new Map,ya=t=>ua[t.toLowerCase()]||sa[t.toLowerCase()]||t.toUpperCase().charCodeAt(0);function ma(t){ga=t||"all"}function xa(){return ga||"all"}function ka(t){if(void 0===t)Object.keys(ba).forEach((t=>{Array.isArray(ba[t])&&ba[t].forEach((t=>wa(t))),delete ba[t]})),Oa(null);else if(Array.isArray(t))t.forEach((t=>{t.key&&wa(t)}));else if("object"==typeof t)t.key&&wa(t);else if("string"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),e=1;e{let{key:n,scope:o,method:e,splitKey:r="+"}=t;la(n).forEach((t=>{const n=t.split(r),c=n.length,a=n[c-1],i="*"===a?"*":ya(a);if(!ba[i])return;o||(o=xa());const l=c>1?ia(sa,n):[],u=[];ba[i]=ba[i].filter((t=>{const n=(!e||t.method===e)&&t.scope===o&&function(t,n){const o=t.length>=n.length?t:n,e=t.length>=n.length?n:t;let r=!0;for(let c=0;cOa(t)))}))};function _a(t,n,o,e){if(n.element!==e)return;let r;if(n.scope===o||"all"===n.scope){r=n.mods.length>0;for(const t in pa)Object.prototype.hasOwnProperty.call(pa,t)&&(!pa[t]&&n.mods.indexOf(+t)>-1||pa[t]&&-1===n.mods.indexOf(+t))&&(r=!1);(0!==n.mods.length||pa[16]||pa[18]||pa[17]||pa[91])&&!r&&"*"!==n.shortcut||(n.keys=[],n.keys=n.keys.concat(fa),!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0)))}}function ja(t,n){const o=ba["*"];let e=t.keyCode||t.which||t.charCode;if(!$a.filter.call(this,t))return;if(93!==e&&224!==e||(e=91),-1===fa.indexOf(e)&&229!==e&&fa.push(e),["ctrlKey","altKey","shiftKey","metaKey"].forEach((n=>{const o=da[n];t[n]&&-1===fa.indexOf(o)?fa.push(o):!t[n]&&fa.indexOf(o)>-1?fa.splice(fa.indexOf(o),1):"metaKey"===n&&t[n]&&3===fa.length&&(t.ctrlKey||t.shiftKey||t.altKey||(fa=fa.slice(fa.indexOf(o))))})),e in pa){pa[e]=!0;for(const t in sa)sa[t]===e&&($a[t]=!0);if(!o)return}for(const i in pa)Object.prototype.hasOwnProperty.call(pa,i)&&(pa[i]=t[da[i]]);t.getModifierState&&(!t.altKey||t.ctrlKey)&&t.getModifierState("AltGraph")&&(-1===fa.indexOf(17)&&fa.push(17),-1===fa.indexOf(18)&&fa.push(18),pa[17]=!0,pa[18]=!0);const r=xa();if(o)for(let i=0;i1&&(r=ia(sa,t)),(t="*"===(t=t[t.length-1])?"*":ya(t))in ba||(ba[t]=[]),ba[t].push({keyup:l,keydown:u,scope:c,mods:r,shortcut:e[i],method:o,key:e[i],splitKey:s,element:a});if(void 0!==a&&window){if(!va.has(a)){const t=function(){return ja(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event,a)},n=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event;ja(t,a),function(t){let n=t.keyCode||t.which||t.charCode;const o=fa.indexOf(n);if(o>=0&&fa.splice(o,1),t.key&&"meta"===t.key.toLowerCase()&&fa.splice(0,fa.length),93!==n&&224!==n||(n=91),n in pa){pa[n]=!1;for(const t in sa)sa[t]===n&&($a[t]=!1)}}(t)};va.set(a,{keydownListener:t,keyupListenr:n,capture:d}),ca(a,"keydown",t,d),ca(a,"keyup",n,d)}if(!ha){const t=()=>{fa=[]};ha={listener:t,capture:d},ca(window,"focus",t,d)}}}function Oa(t){const n=Object.values(ba).flat();if(n.findIndex((n=>{let{element:o}=n;return o===t}))<0){const{keydownListener:n,keyupListenr:o,capture:e}=va.get(t)||{};n&&o&&(aa(t,"keyup",o,e),aa(t,"keydown",n,e),va.delete(t))}if(n.length<=0||va.size<=0){if(Object.keys(va).forEach((t=>{const{keydownListener:n,keyupListenr:o,capture:e}=va.get(t)||{};n&&o&&(aa(t,"keyup",o,e),aa(t,"keydown",n,e),va.delete(t))})),va.clear(),Object.keys(ba).forEach((t=>delete ba[t])),ha){const{listener:t,capture:n}=ha;aa(window,"focus",t,n),ha=null}}}const Sa={getPressedKeyString:function(){return fa.map((t=>{return n=t,Object.keys(ua).find((t=>ua[t]===n))||(t=>Object.keys(sa).find((n=>sa[n]===t)))(t)||String.fromCharCode(t);var n}))},setScope:ma,getScope:xa,deleteScope:function(t,n){let o,e;t||(t=xa());for(const r in ba)if(Object.prototype.hasOwnProperty.call(ba,r))for(o=ba[r],e=0;e{let{element:n}=t;return Oa(n)}))}else e++;xa()===t&&ma(n||"all")},getPressedKeyCodes:function(){return fa.slice(0)},getAllKeyCodes:function(){const t=[];return Object.keys(ba).forEach((n=>{ba[n].forEach((n=>{let{key:o,scope:e,mods:r,shortcut:c}=n;t.push({scope:e,shortcut:c,mods:r,keys:o.split("+").map((t=>ya(t)))})}))})),t},isPressed:function(t){return"string"==typeof t&&(t=ya(t)),-1!==fa.indexOf(t)},filter:function(t){const n=t.target||t.srcElement,{tagName:o}=n;let e=!0;const r="INPUT"===o&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(n.type);return(n.isContentEditable||(r||"TEXTAREA"===o||"SELECT"===o)&&!n.readOnly)&&(e=!1),e},trigger:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(ba).forEach((o=>{ba[o].filter((o=>o.scope===n&&o.shortcut===t)).forEach((t=>{t&&t.method&&t.method()}))}))},unbind:ka,keyMap:ua,modifier:sa,modifierMap:da};for(const Ya in Sa)Object.prototype.hasOwnProperty.call(Sa,Ya)&&($a[Ya]=Sa[Ya]);if("undefined"!=typeof window){const t=window.hotkeys;$a.noConflict=n=>(n&&window.hotkeys===$a&&(window.hotkeys=t),$a),window.hotkeys=$a}var Aa={root:function(t){var n=t.props,o=t.instance;return["p-badge p-component",{"p-badge-circle":I(n.value)&&1===String(n.value).length,"p-badge-dot":z(n.value)&&!o.$slots.default,"p-badge-sm":"small"===n.size,"p-badge-lg":"large"===n.size,"p-badge-xl":"xlarge"===n.size,"p-badge-info":"info"===n.severity,"p-badge-success":"success"===n.severity,"p-badge-warn":"warn"===n.severity,"p-badge-danger":"danger"===n.severity,"p-badge-secondary":"secondary"===n.severity,"p-badge-contrast":"contrast"===n.severity}]}},Ea=X.extend({name:"badge",theme:function(t){var n=t.dt;return"\n.p-badge {\n display: inline-flex;\n border-radius: ".concat(n("badge.border.radius"),";\n align-items: center;\n justify-content: center;\n padding: ").concat(n("badge.padding"),";\n background: ").concat(n("badge.primary.background"),";\n color: ").concat(n("badge.primary.color"),";\n font-size: ").concat(n("badge.font.size"),";\n font-weight: ").concat(n("badge.font.weight"),";\n min-width: ").concat(n("badge.min.width"),";\n height: ").concat(n("badge.height"),";\n}\n\n.p-badge-dot {\n width: ").concat(n("badge.dot.size"),";\n min-width: ").concat(n("badge.dot.size"),";\n height: ").concat(n("badge.dot.size"),";\n border-radius: 50%;\n padding: 0;\n}\n\n.p-badge-circle {\n padding: 0;\n border-radius: 50%;\n}\n\n.p-badge-secondary {\n background: ").concat(n("badge.secondary.background"),";\n color: ").concat(n("badge.secondary.color"),";\n}\n\n.p-badge-success {\n background: ").concat(n("badge.success.background"),";\n color: ").concat(n("badge.success.color"),";\n}\n\n.p-badge-info {\n background: ").concat(n("badge.info.background"),";\n color: ").concat(n("badge.info.color"),";\n}\n\n.p-badge-warn {\n background: ").concat(n("badge.warn.background"),";\n color: ").concat(n("badge.warn.color"),";\n}\n\n.p-badge-danger {\n background: ").concat(n("badge.danger.background"),";\n color: ").concat(n("badge.danger.color"),";\n}\n\n.p-badge-contrast {\n background: ").concat(n("badge.contrast.background"),";\n color: ").concat(n("badge.contrast.color"),";\n}\n\n.p-badge-sm {\n font-size: ").concat(n("badge.sm.font.size"),";\n min-width: ").concat(n("badge.sm.min.width"),";\n height: ").concat(n("badge.sm.height"),";\n}\n\n.p-badge-lg {\n font-size: ").concat(n("badge.lg.font.size"),";\n min-width: ").concat(n("badge.lg.min.width"),";\n height: ").concat(n("badge.lg.height"),";\n}\n\n.p-badge-xl {\n font-size: ").concat(n("badge.xl.font.size"),";\n min-width: ").concat(n("badge.xl.min.width"),";\n height: ").concat(n("badge.xl.height"),";\n}\n")},classes:Aa}),Ta={name:"Badge",extends:{name:"BaseBadge",extends:Y,props:{value:{type:[String,Number],default:null},severity:{type:String,default:null},size:{type:String,default:null}},style:Ea,provide:function(){return{$pcBadge:this,$parentInstance:this}}},inheritAttrs:!1};Ta.render=function(t,n,o,e,r,c){return g(),v("span",k({class:t.cx("root")},t.ptmi("root")),[y(t.$slots,"default",{},(function(){return[m(x(t.value),1)]}))],16)};var Ia=X.extend({name:"ripple-directive",theme:function(t){var n=t.dt;return"\n.p-ink {\n display: block;\n position: absolute;\n background: ".concat(n("ripple.background"),";\n border-radius: 100%;\n transform: scale(0);\n pointer-events: none;\n}\n\n.p-ink-active {\n animation: ripple 0.4s linear;\n}\n\n@keyframes ripple {\n 100% {\n opacity: 0;\n transform: scale(2.5);\n }\n}\n")},classes:{root:"p-ink"}});function za(t){return(za="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ba(t){return function(t){if(Array.isArray(t))return Ca(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return Ca(t,n);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Ca(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ca(t,n){(null==n||n>t.length)&&(n=t.length);for(var o=0,e=Array(n);ot.length)&&(n=t.length);for(var o=0,e=Array(n);oi.width||r<0||e<0||e+a>i.height},getTarget:function(t){return J(t,"p-inputwrapper")?q(t,"input"):t},getModifiers:function(t){return t.modifiers&&Object.keys(t.modifiers).length?t.modifiers:t.arg&&"object"===Ga(t.arg)?Object.entries(t.arg).reduce((function(t,n){var o=Va(n,2),e=o[0],r=o[1];return"event"!==e&&"position"!==e||(t[r]=!0),t}),{}):{}}}}),qa={name:"Card",extends:{name:"BaseCard",extends:Y,style:X.extend({name:"card",theme:function(t){var n=t.dt;return"\n.p-card {\n background: ".concat(n("card.background"),";\n color: ").concat(n("card.color"),";\n box-shadow: ").concat(n("card.shadow"),";\n border-radius: ").concat(n("card.border.radius"),";\n display: flex;\n flex-direction: column;\n}\n\n.p-card-caption {\n display: flex;\n flex-direction: column;\n gap: ").concat(n("card.caption.gap"),";\n}\n\n.p-card-body {\n padding: ").concat(n("card.body.padding"),";\n display: flex;\n flex-direction: column;\n gap: ").concat(n("card.body.gap"),";\n}\n\n.p-card-title {\n font-size: ").concat(n("card.title.font.size"),";\n font-weight: ").concat(n("card.title.font.weight"),";\n}\n\n.p-card-subtitle {\n color: ").concat(n("card.subtitle.color"),";\n}\n")},classes:{root:"p-card p-component",header:"p-card-header",body:"p-card-body",caption:"p-card-caption",title:"p-card-title",subtitle:"p-card-subtitle",content:"p-card-content",footer:"p-card-footer"}}),provide:function(){return{$pcCard:this,$parentInstance:this}}},inheritAttrs:!1};qa.render=function(t,n,o,e,r,c){return g(),v("div",k({class:t.cx("root")},t.ptmi("root")),[t.$slots.header?(g(),v("div",k({key:0,class:t.cx("header")},t.ptm("header")),[y(t.$slots,"header")],16)):A("",!0),E("div",k({class:t.cx("body")},t.ptm("body")),[t.$slots.title||t.$slots.subtitle?(g(),v("div",k({key:0,class:t.cx("caption")},t.ptm("caption")),[t.$slots.title?(g(),v("div",k({key:0,class:t.cx("title")},t.ptm("title")),[y(t.$slots,"title")],16)):A("",!0),t.$slots.subtitle?(g(),v("div",k({key:1,class:t.cx("subtitle")},t.ptm("subtitle")),[y(t.$slots,"subtitle")],16)):A("",!0)],16)):A("",!0),E("div",k({class:t.cx("content")},t.ptm("content")),[y(t.$slots,"content")],16),t.$slots.footer?(g(),v("div",k({key:1,class:t.cx("footer")},t.ptm("footer")),[y(t.$slots,"footer")],16)):A("",!0)],16)],16)};var Za=X.extend({name:"inputtext",theme:function(t){var n=t.dt;return"\n.p-inputtext {\n font-family: inherit;\n font-feature-settings: inherit;\n font-size: 1rem;\n color: ".concat(n("inputtext.color"),";\n background: ").concat(n("inputtext.background"),";\n padding: ").concat(n("inputtext.padding.y")," ").concat(n("inputtext.padding.x"),";\n border: 1px solid ").concat(n("inputtext.border.color"),";\n transition: background ").concat(n("inputtext.transition.duration"),", color ").concat(n("inputtext.transition.duration"),", border-color ").concat(n("inputtext.transition.duration"),", outline-color ").concat(n("inputtext.transition.duration"),", box-shadow ").concat(n("inputtext.transition.duration"),";\n appearance: none;\n border-radius: ").concat(n("inputtext.border.radius"),";\n outline-color: transparent;\n box-shadow: ").concat(n("inputtext.shadow"),";\n}\n\n.p-inputtext:enabled:hover {\n border-color: ").concat(n("inputtext.hover.border.color"),";\n}\n\n.p-inputtext:enabled:focus {\n border-color: ").concat(n("inputtext.focus.border.color"),";\n box-shadow: ").concat(n("inputtext.focus.ring.shadow"),";\n outline: ").concat(n("inputtext.focus.ring.width")," ").concat(n("inputtext.focus.ring.style")," ").concat(n("inputtext.focus.ring.color"),";\n outline-offset: ").concat(n("inputtext.focus.ring.offset"),";\n}\n\n.p-inputtext.p-invalid {\n border-color: ").concat(n("inputtext.invalid.border.color"),";\n}\n\n.p-inputtext.p-variant-filled {\n background: ").concat(n("inputtext.filled.background"),";\n}\n\n.p-inputtext.p-variant-filled:enabled:focus {\n background: ").concat(n("inputtext.filled.focus.background"),";\n}\n\n.p-inputtext:disabled {\n opacity: 1;\n background: ").concat(n("inputtext.disabled.background"),";\n color: ").concat(n("inputtext.disabled.color"),";\n}\n\n.p-inputtext::placeholder {\n color: ").concat(n("inputtext.placeholder.color"),";\n}\n\n.p-inputtext-sm {\n font-size: ").concat(n("inputtext.sm.font.size"),";\n padding: ").concat(n("inputtext.sm.padding.y")," ").concat(n("inputtext.sm.padding.x"),";\n}\n\n.p-inputtext-lg {\n font-size: ").concat(n("inputtext.lg.font.size"),";\n padding: ").concat(n("inputtext.lg.padding.y")," ").concat(n("inputtext.lg.padding.x"),";\n}\n\n.p-inputtext-fluid {\n width: 100%;\n}\n")},classes:{root:function(t){var n=t.instance,o=t.props;return["p-inputtext p-component",{"p-filled":n.filled,"p-inputtext-sm":"small"===o.size,"p-inputtext-lg":"large"===o.size,"p-invalid":o.invalid,"p-variant-filled":o.variant?"filled"===o.variant:"filled"===n.$primevue.config.inputStyle||"filled"===n.$primevue.config.inputVariant,"p-inputtext-fluid":n.hasFluid}]}}}),Ja={name:"InputText",extends:{name:"BaseInputText",extends:Y,props:{modelValue:null,size:{type:String,default:null},invalid:{type:Boolean,default:!1},variant:{type:String,default:null},fluid:{type:Boolean,default:null}},style:Za,provide:function(){return{$pcInputText:this,$parentInstance:this}}},inheritAttrs:!1,emits:["update:modelValue"],inject:{$pcFluid:{default:null}},methods:{getPTOptions:function(t){return("root"===t?this.ptmi:this.ptm)(t,{context:{filled:this.filled,disabled:this.$attrs.disabled||""===this.$attrs.disabled}})},onInput:function(t){this.$emit("update:modelValue",t.target.value)}},computed:{filled:function(){return null!=this.modelValue&&this.modelValue.toString().length>0},hasFluid:function(){return z(this.fluid)?!!this.$pcFluid:this.fluid}}},Xa=["value","aria-invalid"];Ja.render=function(t,n,o,e,r,c){return g(),v("input",k({type:"text",class:t.cx("root"),value:t.modelValue,"aria-invalid":t.invalid||void 0,onInput:n[0]||(n[0]=function(){return c.onInput&&c.onInput.apply(c,arguments)})},c.getPTOptions("root")),null,16,Xa)};export{Wa as T,Ua as a,qa as b,ea as c,xt as d,Ja as e,ut as f,$a as h,kt as s}; diff --git a/web_version/v2/assets/vendor-DT1J-jWa.js b/web_version/v2/assets/vendor-DT1J-jWa.js new file mode 100644 index 0000000..4046a1a --- /dev/null +++ b/web_version/v2/assets/vendor-DT1J-jWa.js @@ -0,0 +1,7 @@ +import{f as t,r as n,h as o,w as e,e as r,i as c,j as a,t as i,k as l,l as u,n as s,p as d,q as p,s as b,u as f,v as g,b as h,c as v,x as y,y as m,z as x,m as k,A as w,B as $,C as _,D as S,E,F as O,G as A,d as T,H as C}from"./vue-DjzFgvDF.js";import{h as j,o as B,w as I,x as L,y as z,z as H,A as P,B as K,C as M,D,F,i as U,G as V,H as R,Z as N,I as G,J as Z,f as J,K as X,L as q}from"./primeuix-Be3xdh47.js";import{B as W,s as Y,a as Q,b as tt,U as nt,C as ot}from"./primevue-BSs2m5Wu.js"; +/*! + * pinia v2.2.1 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */ +let et;const rt=t=>et=t,ct=Symbol();function at(t){return t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)&&"function"!=typeof t.toJSON}var it,lt;function ut(){const e=t(!0),r=e.run((()=>n({})));let c=[],a=[];const i=o({install(t){rt(i),i._a=t,t.provide(ct,i),t.config.globalProperties.$pinia=i,a.forEach((t=>c.push(t))),a=[]},use(t){return this._a?c.push(t):a.push(t),this},_p:c,_a:null,_e:e,_s:new Map,state:r});return i}(lt=it||(it={})).direct="direct",lt.patchObject="patch object",lt.patchFunction="patch function";const st=()=>{};function dt(t,n,o,e=st){t.push(n);const r=()=>{const o=t.indexOf(n);o>-1&&(t.splice(o,1),e())};return!o&&l()&&u(r),r}function pt(t,...n){t.slice().forEach((t=>{t(...n)}))}const bt=t=>t(),ft=Symbol(),gt=Symbol();function ht(t,n){t instanceof Map&&n instanceof Map?n.forEach(((n,o)=>t.set(o,n))):t instanceof Set&&n instanceof Set&&n.forEach(t.add,t);for(const o in n){if(!n.hasOwnProperty(o))continue;const e=n[o],r=t[o];at(r)&&at(e)&&t.hasOwnProperty(o)&&!c(e)&&!a(e)?t[o]=ht(r,e):t[o]=e}return t}const vt=Symbol();const{assign:yt}=Object;function mt(o,l,u={},d,p,b){let f;const g=yt({actions:{}},u),h={deep:!0};let v,y,m,x=[],k=[];const w=d.state.value[o];let $;function _(t){let n;v=y=!1,"function"==typeof t?(t(d.state.value[o]),n={type:it.patchFunction,storeId:o,events:m}):(ht(d.state.value[o],t),n={type:it.patchObject,payload:t,storeId:o,events:m});const e=$=Symbol();s().then((()=>{$===e&&(v=!0)})),y=!0,pt(x,n,d.state.value[o])}b||w||(d.state.value[o]={}),n({});const S=b?function(){const{state:t}=u,n=t?t():{};this.$patch((t=>{yt(t,n)}))}:st;const E=(t,n="")=>{if(ft in t)return t[gt]=n,t;const e=function(){rt(d);const n=Array.from(arguments),r=[],c=[];let a;pt(k,{args:n,name:e[gt],store:A,after:function(t){r.push(t)},onError:function(t){c.push(t)}});try{a=t.apply(this&&this.$id===o?this:A,n)}catch(i){throw pt(c,i),i}return a instanceof Promise?a.then((t=>(pt(r,t),t))).catch((t=>(pt(c,t),Promise.reject(t)))):(pt(r,a),a)};return e[ft]=!0,e[gt]=n,e},O={_p:d,$id:o,$onAction:dt.bind(null,k),$patch:_,$reset:S,$subscribe(t,n={}){const r=dt(x,t,n.detached,(()=>c())),c=f.run((()=>e((()=>d.state.value[o]),(e=>{("sync"===n.flush?y:v)&&t({storeId:o,type:it.direct,events:m},e)}),yt({},h,n))));return r},$dispose:function(){f.stop(),x=[],k=[],d._s.delete(o)}},A=r(O);d._s.set(o,A);const T=(d._a&&d._a.runWithContext||bt)((()=>d._e.run((()=>(f=t()).run((()=>l({action:E})))))));for(const t in T){const n=T[t];if(c(n)&&(!c(j=n)||!j.effect)||a(n))b||(!w||at(C=n)&&C.hasOwnProperty(vt)||(c(n)?n.value=w[t]:ht(n,w[t])),d.state.value[o][t]=n);else if("function"==typeof n){const o=E(n,t);T[t]=o,g.actions[t]=n}}var C,j;return yt(A,T),yt(i(A),T),Object.defineProperty(A,"$state",{get:()=>d.state.value[o],set:t=>{_((n=>{yt(n,t)}))}}),d._p.forEach((t=>{yt(A,f.run((()=>t({store:A,app:d._a,pinia:d,options:g}))))})),w&&b&&u.hydrate&&u.hydrate(A.$state,w),v=!0,y=!0,A}function xt(t,n,e){let r,c;const a="function"==typeof n;function i(t,e){const i=f();(t=t||(i?d(ct,null):null))&&rt(t),(t=et)._s.has(r)||(a?mt(r,n,c,t):function(t,n,e){const{state:r,actions:c,getters:a}=n,i=e.state.value[t];let l;l=mt(t,(function(){i||(e.state.value[t]=r?r():{});const n=p(e.state.value[t]);return yt(n,c,Object.keys(a||{}).reduce(((n,r)=>(n[r]=o(b((()=>{rt(e);const n=e._s.get(t);return a[r].call(n,n)}))),n)),{}))}),n,e,0,!0)}(r,c,t));return t._s.get(r)}return"string"==typeof t?(r=t,c=a?e:n):(c=t,r=t.id),i.$id=r,i}function kt(t){{t=i(t);const n={};for(const o in t){const e=t[o];(c(e)||a(e))&&(n[o]=g(t,o))}return n}}const wt="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function $t(t,n,o,e){t.addEventListener?t.addEventListener(n,o,e):t.attachEvent&&t.attachEvent("on".concat(n),o)}function _t(t,n,o,e){t.removeEventListener?t.removeEventListener(n,o,e):t.detachEvent&&t.detachEvent("on".concat(n),o)}function St(t,n){const o=n.slice(0,n.length-1);for(let e=0;e=0;)n[o-1]+=",",n.splice(o,1),o=n.lastIndexOf("");return n}const Ot={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":wt?173:189,"=":wt?61:187,";":wt?59:186,"'":222,"[":219,"]":221,"\\":220},At={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Tt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ct={16:!1,18:!1,17:!1,91:!1},jt={};for(let vn=1;vn<20;vn++)Ot["f".concat(vn)]=111+vn;let Bt=[],It=null,Lt="all";const zt=new Map,Ht=t=>Ot[t.toLowerCase()]||At[t.toLowerCase()]||t.toUpperCase().charCodeAt(0);function Pt(t){Lt=t||"all"}function Kt(){return Lt||"all"}function Mt(t){if(void 0===t)Object.keys(jt).forEach((t=>{Array.isArray(jt[t])&&jt[t].forEach((t=>Dt(t))),delete jt[t]})),Rt(null);else if(Array.isArray(t))t.forEach((t=>{t.key&&Dt(t)}));else if("object"==typeof t)t.key&&Dt(t);else if("string"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),e=1;e{let{key:n,scope:o,method:e,splitKey:r="+"}=t;Et(n).forEach((t=>{const n=t.split(r),c=n.length,a=n[c-1],i="*"===a?"*":Ht(a);if(!jt[i])return;o||(o=Kt());const l=c>1?St(At,n):[],u=[];jt[i]=jt[i].filter((t=>{const n=(!e||t.method===e)&&t.scope===o&&function(t,n){const o=t.length>=n.length?t:n,e=t.length>=n.length?n:t;let r=!0;for(let c=0;cRt(t)))}))};function Ft(t,n,o,e){if(n.element!==e)return;let r;if(n.scope===o||"all"===n.scope){r=n.mods.length>0;for(const t in Ct)Object.prototype.hasOwnProperty.call(Ct,t)&&(!Ct[t]&&n.mods.indexOf(+t)>-1||Ct[t]&&-1===n.mods.indexOf(+t))&&(r=!1);(0!==n.mods.length||Ct[16]||Ct[18]||Ct[17]||Ct[91])&&!r&&"*"!==n.shortcut||(n.keys=[],n.keys=n.keys.concat(Bt),!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0)))}}function Ut(t,n){const o=jt["*"];let e=t.keyCode||t.which||t.charCode;if(!Vt.filter.call(this,t))return;if(93!==e&&224!==e||(e=91),-1===Bt.indexOf(e)&&229!==e&&Bt.push(e),["ctrlKey","altKey","shiftKey","metaKey"].forEach((n=>{const o=Tt[n];t[n]&&-1===Bt.indexOf(o)?Bt.push(o):!t[n]&&Bt.indexOf(o)>-1?Bt.splice(Bt.indexOf(o),1):"metaKey"===n&&t[n]&&3===Bt.length&&(t.ctrlKey||t.shiftKey||t.altKey||(Bt=Bt.slice(Bt.indexOf(o))))})),e in Ct){Ct[e]=!0;for(const t in At)At[t]===e&&(Vt[t]=!0);if(!o)return}for(const i in Ct)Object.prototype.hasOwnProperty.call(Ct,i)&&(Ct[i]=t[Tt[i]]);t.getModifierState&&(!t.altKey||t.ctrlKey)&&t.getModifierState("AltGraph")&&(-1===Bt.indexOf(17)&&Bt.push(17),-1===Bt.indexOf(18)&&Bt.push(18),Ct[17]=!0,Ct[18]=!0);const r=Kt();if(o)for(let i=0;i1&&(r=St(At,t)),(t="*"===(t=t[t.length-1])?"*":Ht(t))in jt||(jt[t]=[]),jt[t].push({keyup:l,keydown:u,scope:c,mods:r,shortcut:e[i],method:o,key:e[i],splitKey:s,element:a});if(void 0!==a&&window){if(!zt.has(a)){const t=function(){return Ut(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event,a)},n=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event;Ut(t,a),function(t){let n=t.keyCode||t.which||t.charCode;const o=Bt.indexOf(n);if(o>=0&&Bt.splice(o,1),t.key&&"meta"===t.key.toLowerCase()&&Bt.splice(0,Bt.length),93!==n&&224!==n||(n=91),n in Ct){Ct[n]=!1;for(const t in At)At[t]===n&&(Vt[t]=!1)}}(t)};zt.set(a,{keydownListener:t,keyupListenr:n,capture:d}),$t(a,"keydown",t,d),$t(a,"keyup",n,d)}if(!It){const t=()=>{Bt=[]};It={listener:t,capture:d},$t(window,"focus",t,d)}}}function Rt(t){const n=Object.values(jt).flat();if(n.findIndex((n=>{let{element:o}=n;return o===t}))<0){const{keydownListener:n,keyupListenr:o,capture:e}=zt.get(t)||{};n&&o&&(_t(t,"keyup",o,e),_t(t,"keydown",n,e),zt.delete(t))}if(n.length<=0||zt.size<=0){if(Object.keys(zt).forEach((t=>{const{keydownListener:n,keyupListenr:o,capture:e}=zt.get(t)||{};n&&o&&(_t(t,"keyup",o,e),_t(t,"keydown",n,e),zt.delete(t))})),zt.clear(),Object.keys(jt).forEach((t=>delete jt[t])),It){const{listener:t,capture:n}=It;_t(window,"focus",t,n),It=null}}}const Nt={getPressedKeyString:function(){return Bt.map((t=>{return n=t,Object.keys(Ot).find((t=>Ot[t]===n))||(t=>Object.keys(At).find((n=>At[n]===t)))(t)||String.fromCharCode(t);var n}))},setScope:Pt,getScope:Kt,deleteScope:function(t,n){let o,e;t||(t=Kt());for(const r in jt)if(Object.prototype.hasOwnProperty.call(jt,r))for(o=jt[r],e=0;e{let{element:n}=t;return Rt(n)}))}else e++;Kt()===t&&Pt(n||"all")},getPressedKeyCodes:function(){return Bt.slice(0)},getAllKeyCodes:function(){const t=[];return Object.keys(jt).forEach((n=>{jt[n].forEach((n=>{let{key:o,scope:e,mods:r,shortcut:c}=n;t.push({scope:e,shortcut:c,mods:r,keys:o.split("+").map((t=>Ht(t)))})}))})),t},isPressed:function(t){return"string"==typeof t&&(t=Ht(t)),-1!==Bt.indexOf(t)},filter:function(t){const n=t.target||t.srcElement,{tagName:o}=n;let e=!0;const r="INPUT"===o&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(n.type);return(n.isContentEditable||(r||"TEXTAREA"===o||"SELECT"===o)&&!n.readOnly)&&(e=!1),e},trigger:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(jt).forEach((o=>{jt[o].filter((o=>o.scope===n&&o.shortcut===t)).forEach((t=>{t&&t.method&&t.method()}))}))},unbind:Mt,keyMap:Ot,modifier:At,modifierMap:Tt};for(const vn in Nt)Object.prototype.hasOwnProperty.call(Nt,vn)&&(Vt[vn]=Nt[vn]);if("undefined"!=typeof window){const t=window.hotkeys;Vt.noConflict=n=>(n&&window.hotkeys===Vt&&(window.hotkeys=t),Vt),window.hotkeys=Vt}var Gt={root:function(t){var n=t.props,o=t.instance;return["p-badge p-component",{"p-badge-circle":j(n.value)&&1===String(n.value).length,"p-badge-dot":B(n.value)&&!o.$slots.default,"p-badge-sm":"small"===n.size,"p-badge-lg":"large"===n.size,"p-badge-xl":"xlarge"===n.size,"p-badge-info":"info"===n.severity,"p-badge-success":"success"===n.severity,"p-badge-warn":"warn"===n.severity,"p-badge-danger":"danger"===n.severity,"p-badge-secondary":"secondary"===n.severity,"p-badge-contrast":"contrast"===n.severity}]}},Zt=W.extend({name:"badge",theme:function(t){var n=t.dt;return"\n.p-badge {\n display: inline-flex;\n border-radius: ".concat(n("badge.border.radius"),";\n align-items: center;\n justify-content: center;\n padding: ").concat(n("badge.padding"),";\n background: ").concat(n("badge.primary.background"),";\n color: ").concat(n("badge.primary.color"),";\n font-size: ").concat(n("badge.font.size"),";\n font-weight: ").concat(n("badge.font.weight"),";\n min-width: ").concat(n("badge.min.width"),";\n height: ").concat(n("badge.height"),";\n}\n\n.p-badge-dot {\n width: ").concat(n("badge.dot.size"),";\n min-width: ").concat(n("badge.dot.size"),";\n height: ").concat(n("badge.dot.size"),";\n border-radius: 50%;\n padding: 0;\n}\n\n.p-badge-circle {\n padding: 0;\n border-radius: 50%;\n}\n\n.p-badge-secondary {\n background: ").concat(n("badge.secondary.background"),";\n color: ").concat(n("badge.secondary.color"),";\n}\n\n.p-badge-success {\n background: ").concat(n("badge.success.background"),";\n color: ").concat(n("badge.success.color"),";\n}\n\n.p-badge-info {\n background: ").concat(n("badge.info.background"),";\n color: ").concat(n("badge.info.color"),";\n}\n\n.p-badge-warn {\n background: ").concat(n("badge.warn.background"),";\n color: ").concat(n("badge.warn.color"),";\n}\n\n.p-badge-danger {\n background: ").concat(n("badge.danger.background"),";\n color: ").concat(n("badge.danger.color"),";\n}\n\n.p-badge-contrast {\n background: ").concat(n("badge.contrast.background"),";\n color: ").concat(n("badge.contrast.color"),";\n}\n\n.p-badge-sm {\n font-size: ").concat(n("badge.sm.font.size"),";\n min-width: ").concat(n("badge.sm.min.width"),";\n height: ").concat(n("badge.sm.height"),";\n}\n\n.p-badge-lg {\n font-size: ").concat(n("badge.lg.font.size"),";\n min-width: ").concat(n("badge.lg.min.width"),";\n height: ").concat(n("badge.lg.height"),";\n}\n\n.p-badge-xl {\n font-size: ").concat(n("badge.xl.font.size"),";\n min-width: ").concat(n("badge.xl.min.width"),";\n height: ").concat(n("badge.xl.height"),";\n}\n")},classes:Gt}),Jt={name:"Badge",extends:{name:"BaseBadge",extends:Y,props:{value:{type:[String,Number],default:null},severity:{type:String,default:null},size:{type:String,default:null}},style:Zt,provide:function(){return{$pcBadge:this,$parentInstance:this}}},inheritAttrs:!1};Jt.render=function(t,n,o,e,r,c){return h(),v("span",k({class:t.cx("root")},t.ptmi("root")),[y(t.$slots,"default",{},(function(){return[m(x(t.value),1)]}))],16)};var Xt=W.extend({name:"ripple-directive",theme:function(t){var n=t.dt;return"\n.p-ink {\n display: block;\n position: absolute;\n background: ".concat(n("ripple.background"),";\n border-radius: 100%;\n transform: scale(0);\n pointer-events: none;\n}\n\n.p-ink-active {\n animation: ripple 0.4s linear;\n}\n\n@keyframes ripple {\n 100% {\n opacity: 0;\n transform: scale(2.5);\n }\n}\n")},classes:{root:"p-ink"}});function qt(t){return(qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wt(t){return function(t){if(Array.isArray(t))return Yt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return Yt(t,n);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Yt(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yt(t,n){(null==n||n>t.length)&&(n=t.length);for(var o=0,e=Array(n);ot.length)&&(n=t.length);for(var o=0,e=Array(n);oi.width||r<0||e<0||e+a>i.height},getTarget:function(t){return q(t,"p-inputwrapper")?J(t,"input"):t},getModifiers:function(t){return t.modifiers&&Object.keys(t.modifiers).length?t.modifiers:t.arg&&"object"===dn(t.arg)?Object.entries(t.arg).reduce((function(t,n){var o=ln(n,2),e=o[0],r=o[1];return"event"!==e&&"position"!==e||(t[r]=!0),t}),{}):{}}}}),bn={name:"Card",extends:{name:"BaseCard",extends:Y,style:W.extend({name:"card",theme:function(t){var n=t.dt;return"\n.p-card {\n background: ".concat(n("card.background"),";\n color: ").concat(n("card.color"),";\n box-shadow: ").concat(n("card.shadow"),";\n border-radius: ").concat(n("card.border.radius"),";\n display: flex;\n flex-direction: column;\n}\n\n.p-card-caption {\n display: flex;\n flex-direction: column;\n gap: ").concat(n("card.caption.gap"),";\n}\n\n.p-card-body {\n padding: ").concat(n("card.body.padding"),";\n display: flex;\n flex-direction: column;\n gap: ").concat(n("card.body.gap"),";\n}\n\n.p-card-title {\n font-size: ").concat(n("card.title.font.size"),";\n font-weight: ").concat(n("card.title.font.weight"),";\n}\n\n.p-card-subtitle {\n color: ").concat(n("card.subtitle.color"),";\n}\n")},classes:{root:"p-card p-component",header:"p-card-header",body:"p-card-body",caption:"p-card-caption",title:"p-card-title",subtitle:"p-card-subtitle",content:"p-card-content",footer:"p-card-footer"}}),provide:function(){return{$pcCard:this,$parentInstance:this}}},inheritAttrs:!1};bn.render=function(t,n,o,e,r,c){return h(),v("div",k({class:t.cx("root")},t.ptmi("root")),[t.$slots.header?(h(),v("div",k({key:0,class:t.cx("header")},t.ptm("header")),[y(t.$slots,"header")],16)):A("",!0),T("div",k({class:t.cx("body")},t.ptm("body")),[t.$slots.title||t.$slots.subtitle?(h(),v("div",k({key:0,class:t.cx("caption")},t.ptm("caption")),[t.$slots.title?(h(),v("div",k({key:0,class:t.cx("title")},t.ptm("title")),[y(t.$slots,"title")],16)):A("",!0),t.$slots.subtitle?(h(),v("div",k({key:1,class:t.cx("subtitle")},t.ptm("subtitle")),[y(t.$slots,"subtitle")],16)):A("",!0)],16)):A("",!0),T("div",k({class:t.cx("content")},t.ptm("content")),[y(t.$slots,"content")],16),t.$slots.footer?(h(),v("div",k({key:1,class:t.cx("footer")},t.ptm("footer")),[y(t.$slots,"footer")],16)):A("",!0)],16)],16)};var fn=W.extend({name:"inputtext",theme:function(t){var n=t.dt;return"\n.p-inputtext {\n font-family: inherit;\n font-feature-settings: inherit;\n font-size: 1rem;\n color: ".concat(n("inputtext.color"),";\n background: ").concat(n("inputtext.background"),";\n padding: ").concat(n("inputtext.padding.y")," ").concat(n("inputtext.padding.x"),";\n border: 1px solid ").concat(n("inputtext.border.color"),";\n transition: background ").concat(n("inputtext.transition.duration"),", color ").concat(n("inputtext.transition.duration"),", border-color ").concat(n("inputtext.transition.duration"),", outline-color ").concat(n("inputtext.transition.duration"),", box-shadow ").concat(n("inputtext.transition.duration"),";\n appearance: none;\n border-radius: ").concat(n("inputtext.border.radius"),";\n outline-color: transparent;\n box-shadow: ").concat(n("inputtext.shadow"),";\n}\n\n.p-inputtext:enabled:hover {\n border-color: ").concat(n("inputtext.hover.border.color"),";\n}\n\n.p-inputtext:enabled:focus {\n border-color: ").concat(n("inputtext.focus.border.color"),";\n box-shadow: ").concat(n("inputtext.focus.ring.shadow"),";\n outline: ").concat(n("inputtext.focus.ring.width")," ").concat(n("inputtext.focus.ring.style")," ").concat(n("inputtext.focus.ring.color"),";\n outline-offset: ").concat(n("inputtext.focus.ring.offset"),";\n}\n\n.p-inputtext.p-invalid {\n border-color: ").concat(n("inputtext.invalid.border.color"),";\n}\n\n.p-inputtext.p-variant-filled {\n background: ").concat(n("inputtext.filled.background"),";\n}\n\n.p-inputtext.p-variant-filled:enabled:focus {\n background: ").concat(n("inputtext.filled.focus.background"),";\n}\n\n.p-inputtext:disabled {\n opacity: 1;\n background: ").concat(n("inputtext.disabled.background"),";\n color: ").concat(n("inputtext.disabled.color"),";\n}\n\n.p-inputtext::placeholder {\n color: ").concat(n("inputtext.placeholder.color"),";\n}\n\n.p-inputtext-sm {\n font-size: ").concat(n("inputtext.sm.font.size"),";\n padding: ").concat(n("inputtext.sm.padding.y")," ").concat(n("inputtext.sm.padding.x"),";\n}\n\n.p-inputtext-lg {\n font-size: ").concat(n("inputtext.lg.font.size"),";\n padding: ").concat(n("inputtext.lg.padding.y")," ").concat(n("inputtext.lg.padding.x"),";\n}\n\n.p-inputtext-fluid {\n width: 100%;\n}\n")},classes:{root:function(t){var n=t.instance,o=t.props;return["p-inputtext p-component",{"p-filled":n.filled,"p-inputtext-sm":"small"===o.size,"p-inputtext-lg":"large"===o.size,"p-invalid":o.invalid,"p-variant-filled":o.variant?"filled"===o.variant:"filled"===n.$primevue.config.inputStyle||"filled"===n.$primevue.config.inputVariant,"p-inputtext-fluid":n.hasFluid}]}}}),gn={name:"InputText",extends:{name:"BaseInputText",extends:Y,props:{modelValue:null,size:{type:String,default:null},invalid:{type:Boolean,default:!1},variant:{type:String,default:null},fluid:{type:Boolean,default:null}},style:fn,provide:function(){return{$pcInputText:this,$parentInstance:this}}},inheritAttrs:!1,emits:["update:modelValue"],inject:{$pcFluid:{default:null}},methods:{getPTOptions:function(t){return("root"===t?this.ptmi:this.ptm)(t,{context:{filled:this.filled,disabled:this.$attrs.disabled||""===this.$attrs.disabled}})},onInput:function(t){this.$emit("update:modelValue",t.target.value)}},computed:{filled:function(){return null!=this.modelValue&&this.modelValue.toString().length>0},hasFluid:function(){return B(this.fluid)?!!this.$pcFluid:this.fluid}}},hn=["value","aria-invalid"];gn.render=function(t,n,o,e,r,c){return h(),v("input",k({type:"text",class:t.cx("root"),value:t.modelValue,"aria-invalid":t.invalid||void 0,onInput:n[0]||(n[0]=function(){return c.onInput&&c.onInput.apply(c,arguments)})},c.getPTOptions("root")),null,16,hn)};export{pn as T,cn as a,bn as b,gn as c,xt as d,ut as e,Vt as h,kt as s}; diff --git a/web_version/v2/easyuse.js b/web_version/v2/easyuse.js index ced0743..eafd914 100644 --- a/web_version/v2/easyuse.js +++ b/web_version/v2/easyuse.js @@ -1,2 +1,2 @@ !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('@charset "UTF-8";.easyuse-model-info{color:#fff;max-width:90vw;font-family:var(--font-family)}.easyuse-model-content{display:flex;flex-direction:column;overflow:hidden}.easyuse-model-header{margin:0 0 15px}.easyuse-model-header-remark{display:flex;align-items:center;margin-top:5px}.easyuse-model-info h2{text-align:left;margin:0}.easyuse-model-info h5{text-align:left;margin:0 15px 0 0;font-weight:400;color:var(--descrip-text)}.easyuse-model-info p{margin:5px 0}.easyuse-model-info a{color:var(--theme-color-light)}.easyuse-model-info a:hover{text-decoration:underline}.easyuse-model-tags-list{display:flex;flex-wrap:wrap;list-style:none;gap:10px;max-height:200px;overflow:auto;margin:10px 0;padding:0}.easyuse-model-tag{background-color:var(--comfy-input-bg);border:2px solid var(--border-color);color:var(--input-text);display:flex;align-items:center;gap:5px;border-radius:5px;padding:2px 5px;cursor:pointer}.easyuse-model-tag--selected span:before{content:"✅";position:absolute;background-color:var(--theme-color-light);left:0;top:0;right:0;bottom:0;text-align:center}.easyuse-model-tag:hover{border:2px solid var(--theme-color-light)}.easyuse-model-tag p{margin:0}.easyuse-model-tag span{text-align:center;border-radius:5px;background-color:var(--theme-color-light);padding:2px;position:relative;min-width:20px;overflow:hidden;color:#fff}.easyuse-model-metadata .comfy-modal-content{max-width:100%}.easyuse-model-metadata label{margin-right:1ch;color:#ccc}.easyuse-model-metadata span{color:var(--theme-color-light)}.easyuse-preview{max-width:660px;margin-right:15px;position:relative}.easyuse-preview-group{position:relative;overflow:hidden;border-radius:.5rem;width:660px}.easyuse-preview-list{display:flex;flex-wrap:nowrap;width:100%;transition:all .5s ease-in-out}.easyuse-preview-list.no-transition{transition:none}.easyuse-preview-slide{display:flex;flex-basis:calc(50% - 5px);flex-grow:0;flex-shrink:0;position:relative;justify-content:center;align-items:center;padding-right:5px;padding-left:0}.easyuse-preview-slide:nth-child(2n){padding-left:5px;padding-right:0}.easyuse-preview-slide-content{position:relative;min-height:150px;width:100%}.easyuse-preview-slide-content .save{position:absolute;right:6px;z-index:12;bottom:6px;display:flex;align-items:center;height:26px;padding:0 9px;color:var(--input-text);font-size:12px;line-height:26px;background:#00000080;border-radius:13px;cursor:pointer;min-width:80px;text-align:center}.easyuse-preview-slide-content .save:hover{filter:brightness(120%);will-change:auto}.easyuse-preview-slide-content img{border-radius:14px;object-position:center center;max-width:100%;max-height:700px;border-style:none;vertical-align:middle}.easyuse-preview button{position:absolute;z-index:10;top:50%;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:15px;border:1px solid rgba(66,63,78,.15);background-color:#423f4e80;color:#fffc;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transform:translateY(-50%)}.easyuse-preview button.left{left:10px}.easyuse-preview button.right{right:10px}.easyuse-model-detail{margin-top:16px;overflow:hidden;border:1px solid var(--border-color);border-radius:8px;width:300px}.easyuse-model-detail-head{height:40px;padding:0 10px;font-weight:500;font-size:14px;font-style:normal;line-height:40px}.easyuse-model-detail-body{box-sizing:border-box;font-size:12px}.easyuse-model-detail-item{display:flex;justify-content:flex-start;border-top:1px solid var(--border-color)}.easyuse-model-detail-item-label{flex-shrink:0;width:88px;padding-top:5px;padding-bottom:5px;padding-left:10px;border-right:1px solid var(--border-color);color:var(--input-text);font-weight:400}.easyuse-model-detail-item-value{display:flex;flex-wrap:wrap;padding:5px 10px;color:var(--input-text)}.easyuse-model-detail-textarea{border-top:1px solid var(--border-color);padding:10px;height:100px;overflow-y:auto;font-size:12px}.easyuse-model-detail-textarea textarea{width:100%;height:100%;border:0;background-color:transparent;color:var(--input-text)}.easyuse-model-detail-textarea textarea::placeholder{color:var(--descrip-text)}.easyuse-model-detail-textarea.empty{display:flex;justify-content:center;align-items:center;color:var(--descrip-text)}.easyuse-model-notes{background-color:#00000040;padding:5px;margin-top:5px}.easyuse-model-notes:empty{display:none}.easyuse-account-user{font-size:10px;color:var(--descrip-text);text-align:center}.easyuse-account-user-info{display:flex;justify-content:space-between;align-items:center;padding-bottom:10px;cursor:pointer}.easyuse-account-user-info .user{display:flex;align-items:center}.easyuse-account-user-info .edit{padding:5px 10px;background:var(--comfy-menu-bg);border-radius:4px}.easyuse-account-user-info:hover{filter:brightness(110%)}.easyuse-account-user-info h5{margin:0;font-size:10px;text-align:left}.easyuse-account-user-info h6{margin:0;font-size:8px;text-align:left;font-weight:300}.easyuse-account-user-info .remark{margin-top:4px}.easyuse-account-user-info .avatar{width:36px;height:36px;background:var(--comfy-input-bg);border-radius:50%;margin-right:5px;display:flex;justify-content:center;align-items:center;font-size:16px;overflow:hidden}.easyuse-account-user-info .avatar img{width:100%;height:100%}.easyuse-account-dialog{width:600px}.easyuse-account-dialog-main a,.easyuse-account-dialog-main a:visited{font-weight:400;color:var(--theme-color-light)}.easyuse-account-dialog-item{display:flex;justify-content:flex-start;align-items:center;padding:10px 0;border-bottom:1px solid var(--border-color)}.easyuse-account-dialog-item input{padding:5px;margin-right:5px}.easyuse-account-dialog-item input.key{flex:1}.easyuse-account-dialog-item button{cursor:pointer;margin-left:5px!important;padding:5px!important;font-size:16px!important}.easyuse-account-dialog-item button:hover{filter:brightness(120%)}.easyuse-account-dialog-item button.choose{background:var(--theme-color)}.easyuse-account-dialog-item button.delete{background:var(--error-color)}.easy-dropdown,.easy-nested-dropdown{position:relative;box-sizing:border-box;background-color:#171717;box-shadow:0 4px 4px #ffffff40;padding:0;margin:0;list-style:none;z-index:1000;overflow:visible;max-height:fit-content;max-width:fit-content}.easy-dropdown{position:absolute;border-radius:0}.easy-dropdown li.item,.easy-nested-dropdown li.item{font-weight:400;min-width:max-content}.easy-dropdown li.folder,.easy-nested-dropdown li.folder{cursor:default;position:relative;border-right:3px solid cyan}.easy-dropdown li.folder:after,.easy-nested-dropdown li.folder:after{content:">";position:absolute;right:2px;font-weight:400}.easy-dropdown li,.easy-nested-dropdown li{padding:4px 10px;cursor:pointer;font-family:system-ui;font-size:.7rem;position:relative}.easy-nested-dropdown{position:absolute;top:0;left:100%;margin:0;border:none;display:none}.easy-dropdown li.selected>.easy-nested-dropdown,.easy-nested-dropdown li.selected>.easy-nested-dropdown{display:block;border:none}.easy-dropdown li.selected,.easy-nested-dropdown li.selected{background-color:#e5e5e5;border:none}:root{--theme-color:var(--primary-bg);--theme-color-light: var(--primary-hover-bg);--success-color: #52c41a;--error-color: #ff4d4f;--warning-color: #faad14;--font-family: Inter, -apple-system, BlinkMacSystemFont, Helvetica Neue, sans-serif;--p-inputtext-background: var(--p-form-field-background);--p-inputtext-disabled-background: var(--p-form-field-disabled-background);--p-inputtext-filled-background: var(--p-form-field-filled-background);--p-inputtext-filled-focus-background: var(--p-form-field-filled-focus-background);--p-inputtext-border-color: var(--p-form-field-border-color);--p-inputtext-hover-border-color: var(--p-form-field-hover-border-color);--p-inputtext-focus-border-color: var(--p-form-field-focus-border-color);--p-inputtext-invalid-border-color: var(--p-form-field-invalid-border-color);--p-inputtext-color: var(--p-form-field-color);--p-inputtext-disabled-color: var(--p-form-field-disabled-color);--p-inputtext-placeholder-color: var(--p-form-field-placeholder-color);--p-inputtext-shadow: var(--p-form-field-shadow);--p-inputtext-padding-x: var(--p-form-field-padding-x);--p-inputtext-padding-y: var(--p-form-field-padding-y);--p-inputtext-border-radius: var(--p-form-field-border-radius);--p-inputtext-focus-ring-width: var(--p-form-field-focus-ring-width);--p-inputtext-focus-ring-style: var(--p-form-field-focus-ring-style);--p-inputtext-focus-ring-color: var(--p-form-field-focus-ring-color);--p-inputtext-focus-ring-offset: var(--p-form-field-focus-ring-offset);--p-inputtext-focus-ring-shadow: var(--p-form-field-focus-ring-shadow);--p-inputtext-transition-duration: var(--p-form-field-transition-duration);--p-inputtext-sm-font-size: .875rem;--p-inputtext-sm-padding-x: .625rem;--p-inputtext-sm-padding-y: .375rem;--p-inputtext-lg-font-size: 1.125rem;--p-inputtext-lg-padding-x: .875rem;--p-inputtext-lg-padding-y: .625rem;--p-tooltip-max-width: 12.5rem;--p-tooltip-gutter: .25rem;--p-tooltip-shadow: var(--p-overlay-popover-shadow);--p-tooltip-padding: .5rem .75rem;--p-tooltip-border-radius: var(--p-overlay-popover-border-radius);--p-tooltip-background: var(--p-surface-700);--p-tooltip-color: var(--p-surface-0)}.comfyui-easyuse-theme,.comfyui-easyuse-primary{color:var(--theme-color-light)}.comfyui-easyuse-theme.point:hover,.comfyui-easyuse-primary.point:hover{opacity:.8}.comfyui-easyuse-success{color:var(--success-color)}.comfyui-easyuse-success.point:hover{opacity:.8}.comfyui-easyuse-error{color:var(--error-color)}.comfyui-easyuse-error.point:hover{opacity:.8}.comfyui-easyuse-warning,.comfyui-easyuse--warn{color:var(--warning-color)}.comfyui-easyuse-warning.point:hover,.comfyui-easyuse--warn.point:hover{opacity:.8}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.grid{display:grid}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-10{gap:2.5rem}.gap-12{gap:3rem}.gap-2{gap:.5rem}.gap-2\\.5{gap:.625rem}.gap-20{gap:5rem}.gap-3{gap:.75rem}.gap-3\\.5{gap:.875rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-7{gap:1.75rem}.gap-8{gap:2rem}.gap-\\[0\\.28rem\\]{gap:.28rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.gap-y-6{row-gap:1.5rem}@media (min-width: 576px){.sm\\:col-span-4{grid-column:span 4/span 4}.sm\\:col-span-6{grid-column:span 6/span 6}.sm\\:ml-8{margin-left:2rem}.sm\\:mt-0{margin-top:0}.sm\\:flex{display:flex}.sm\\:h-60{height:15rem}.sm\\:\\!w-64{width:16rem!important}.sm\\:w-40{width:10rem}.sm\\:w-44{width:11rem}.sm\\:w-56{width:14rem}.sm\\:w-60{width:15rem}.sm\\:w-64{width:16rem}.sm\\:w-80{width:20rem}.sm\\:w-96{width:24rem}.sm\\:w-\\[30rem\\]{width:30rem}.sm\\:w-auto{width:auto}.sm\\:min-w-\\[30rem\\]{min-width:30rem}.sm\\:flex-row{flex-direction:row}.sm\\:flex-col{flex-direction:column}.sm\\:flex-nowrap{flex-wrap:nowrap}.sm\\:items-start{align-items:flex-start}.sm\\:items-end{align-items:flex-end}.sm\\:items-center{align-items:center}.sm\\:justify-center{justify-content:center}.sm\\:justify-between{justify-content:space-between}.sm\\:gap-2{gap:.5rem}.sm\\:p-20{padding:5rem}.sm\\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\\:py-10{padding-bottom:2.5rem;padding-top:2.5rem}.sm\\:py-5{padding-bottom:1.25rem;padding-top:1.25rem}.sm\\:pt-32{padding-top:8rem}.sm\\:text-left{text-align:left}.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\\:-bottom-12{bottom:-3rem}.md\\:-bottom-28{bottom:-7rem}.md\\:-bottom-8{bottom:-2rem}.md\\:-bottom-\\[26rem\\]{bottom:-26rem}.md\\:-left-12{left:-3rem}.md\\:-left-28{left:-7rem}.md\\:-left-32{left:-8rem}.md\\:-left-4{left:-1rem}.md\\:-left-48{left:-12rem}.md\\:-left-\\[22rem\\]{left:-22rem}.md\\:bottom-0{bottom:0}.md\\:left-10{left:2.5rem}.md\\:left-\\[32rem\\]{left:32rem}.md\\:left-\\[42rem\\]{left:42rem}.md\\:top-1\\/2{top:50%}.md\\:top-32{top:8rem}.md\\:top-8{top:2rem}.md\\:col-span-2{grid-column:span 2/span 2}.md\\:col-span-4{grid-column:span 4/span 4}.md\\:col-span-6{grid-column:span 6/span 6}.md\\:ml-auto{margin-left:auto}.md\\:block{display:block}.md\\:flex{display:flex}.md\\:hidden{display:none}.md\\:h-\\[20rem\\]{height:20rem}.md\\:h-\\[32rem\\]{height:32rem}.md\\:\\!w-80{width:20rem!important}.md\\:w-2\\/12{width:16.666667%}.md\\:w-40{width:10rem}.md\\:w-5\\/12{width:41.666667%}.md\\:w-56{width:14rem}.md\\:w-6\\/12{width:50%}.md\\:w-60{width:15rem}.md\\:w-8\\/12{width:66.666667%}.md\\:w-80{width:20rem}.md\\:w-\\[100rem\\]{width:100rem}.md\\:w-\\[26rem\\]{width:26rem}.md\\:w-\\[30rem\\]{width:30rem}.md\\:w-\\[50rem\\]{width:50rem}.md\\:w-\\[52rem\\]{width:52rem}.md\\:w-\\[60rem\\]{width:60rem}.md\\:w-\\[95rem\\]{width:95rem}.md\\:w-screen{width:100vw}.md\\:flex-initial{flex:0 1 auto}.md\\:-translate-y-1\\/2{--tw-translate-y: -50% }.md\\:-translate-y-1\\/2,.md\\:translate-x-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-x-0{--tw-translate-x: 0px }.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:flex-row{flex-direction:row}.md\\:flex-col{flex-direction:column}.md\\:items-end{align-items:flex-end}.md\\:items-center{align-items:center}.md\\:justify-start{justify-content:flex-start}.md\\:justify-center{justify-content:center}.md\\:gap-20{gap:5rem}.md\\:gap-4{gap:1rem}.md\\:p-5{padding:1.25rem}.md\\:p-8{padding:2rem}}@media (min-width: 992px){.lg\\:left-20{left:5rem}.lg\\:left-\\[36rem\\]{left:36rem}.lg\\:left-\\[50rem\\]{left:50rem}.lg\\:col-span-1{grid-column:span 1/span 1}.lg\\:col-span-2{grid-column:span 2/span 2}.lg\\:col-span-4{grid-column:span 4/span 4}.lg\\:col-span-6{grid-column:span 6/span 6}.lg\\:mb-0{margin-bottom:0}.lg\\:mt-0{margin-top:0}.lg\\:mt-20{margin-top:5rem}.lg\\:flex{display:flex}.lg\\:hidden{display:none}.lg\\:h-10{height:2.5rem}.lg\\:h-32{height:8rem}.lg\\:h-\\[28rem\\]{height:28rem}.lg\\:\\!w-\\[30rem\\]{width:30rem!important}.lg\\:w-3\\/12{width:25%}.lg\\:w-32{width:8rem}.lg\\:w-\\[28rem\\]{width:28rem}.lg\\:w-\\[64rem\\]{width:64rem}.lg\\:w-fit{width:-moz-fit-content;width:fit-content}.lg\\:max-w-6xl{max-width:72rem}.lg\\:flex-row{flex-direction:row}.lg\\:gap-0{gap:0}.lg\\:rounded-2xl{border-radius:1rem}.lg\\:rounded-3xl{border-radius:1.5rem}.lg\\:rounded-xl{border-radius:.75rem}.lg\\:p-7{padding:1.75rem}.lg\\:px-2{padding-left:.5rem;padding-right:.5rem}.lg\\:px-20{padding-left:5rem;padding-right:5rem}.lg\\:px-56{padding-left:14rem;padding-right:14rem}.lg\\:px-8{padding-left:2rem;padding-right:2rem}.lg\\:px-9{padding-left:2.25rem;padding-right:2.25rem}.lg\\:py-20{padding-bottom:5rem;padding-top:5rem}.lg\\:py-7{padding-bottom:1.75rem;padding-top:1.75rem}.lg\\:pt-0{padding-top:0}.lg\\:text-2xl{font-size:1.5rem;line-height:2rem}.lg\\:text-5xl{font-size:3rem;line-height:1}.lg\\:text-base{font-size:1rem;line-height:1.5rem}.lg\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1200px){.xl\\:-left-12{left:-3rem}.xl\\:-left-28{left:-7rem}.xl\\:bottom-0{bottom:0}.xl\\:left-36{left:9rem}.xl\\:left-\\[42rem\\]{left:42rem}.xl\\:left-\\[60rem\\]{left:60rem}.xl\\:col-span-3{grid-column:span 3/span 3}.xl\\:col-span-4{grid-column:span 4/span 4}.xl\\:col-span-6{grid-column:span 6/span 6}.xl\\:block{display:block}.xl\\:flex{display:flex}.xl\\:hidden{display:none}.xl\\:h-\\[36\\.25rem\\]{height:36.25rem}.xl\\:\\!w-40{width:10rem!important}.xl\\:w-3\\/12{width:25%}.xl\\:w-6\\/12{width:50%}.xl\\:w-96{width:24rem}.xl\\:w-\\[29rem\\]{width:29rem}.xl\\:max-w-36{max-width:9rem}.xl\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\\:flex-row{flex-direction:row}.xl\\:items-start{align-items:flex-start}.xl\\:items-center{align-items:center}.xl\\:gap-1{gap:.25rem}.xl\\:gap-6{gap:1.5rem}.xl\\:text-left{text-align:left}}.comfyui-easyuse-toast{position:fixed;z-index:99999;top:0;left:0;height:0;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:start}.comfyui-easyuse-toast-container{position:relative;height:fit-content;padding:4px;margin-top:-100px;opacity:0;z-index:3;-webkit-transition:all .3s ease-in-out;-khtml-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-ms-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.comfyui-easyuse-toast-container:last-child{z-index:1}.comfyui-easyuse-toast-container.show{opacity:1;margin-top:0!important;transform:translateY(0)}.comfyui-easyuse-toast-container:not(.show){z-index:1}.comfyui-easyuse-toast-container>div{position:relative;background:var(--comfy-menu-bg);color:var(--input-text);height:fit-content;box-shadow:0 0 10px #000000e0;padding:9px 12px;border-radius:var(--border-radius);font-size:14px;pointer-events:all;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-toast-container>div>span{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-toast-container>div>span i{font-size:16px;margin-right:8px}.comfyui-easyuse-toast-container>div>span i.loading{animation:loading-rotate 1s linear infinite}.comfyui-easyuse-toast-container a{cursor:pointer;text-decoration:underline;color:var(--theme-color-light);margin-left:4px;display:inline-block;line-height:1}.comfyui-easyuse-toast-container a:hover{color:var(--theme-color-light);text-decoration:none}@keyframes loading-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.comfyui-easyuse-selector{position:relative}.comfyui-easyuse-selector.hide{display:none}.comfyui-easyuse-selector__header{--height:26px;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;height:var(--height);padding-bottom:10px;border-bottom:1px solid var(--border-color-solid)}.comfyui-easyuse-selector__header_button{height:var(--height);width:var(--height);border-radius:var(--border-radius);border:1px solid var(--border-color);font-size:11px;background:var(--bg-color);box-shadow:none;cursor:pointer;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-selector__header_button:hover{filter:brightness(1.2)}.comfyui-easyuse-selector__header_button:hover i{color:var(--error-color)}.comfyui-easyuse-selector__header_button i{font-size:16px;color:var(--input-text);-webkit-transition:all .3s ease-in-out;-khtml-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-ms-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.comfyui-easyuse-selector__header_search{flex:1;margin-left:10px;border-radius:var(--border-radius);border:1px solid var(--border-color);font-size:11px;background:var(--bg-color);padding:0 8px;height:var(--height);display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-selector__header_search i{font-size:16px}.comfyui-easyuse-selector__header_search .search{vertical-align:middle;margin-left:5px;outline:none;resize:none;border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;overflow-y:scroll;background:transparent;width:100%;line-height:var(--height);font-size:12px;color:var(--input-text);-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1}.comfyui-easyuse-selector__content{list-style:none;padding:0;margin:0;min-height:150px;height:calc(100% - 28px);overflow-y:auto;overflow-x:hidden}.comfyui-easyuse-selector-item{display:inline-block;position:relative}.comfyui-easyuse-selector-item__tag{display:inline-block;vertical-align:middle;margin-top:8px;margin-right:8px;padding:4px;color:var(--input-text);background-color:var(--bg-color);border-radius:var(--border-radius);border:1px solid var(--border-color);font-size:11px;cursor:pointer;overflow:hidden;position:relative}.comfyui-easyuse-selector-item__tag:hover{filter:brightness(1.2)}.comfyui-easyuse-selector-item__tag.hide{display:none}.comfyui-easyuse-selector-item__tag input{--ring-color: transparent;position:relative;box-shadow:none;border:1px solid var(--border-color);border-radius:2px;background:linear-gradient(135deg,var(--comfy-menu-bg) 0%,var(--comfy-input-bg) 60%)}.comfyui-easyuse-selector-item__tag input[type=checkbox]{display:inline-block;flex-shrink:0;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid var(--border-color);background-origin:border-box;padding:0;width:1rem;height:1rem;border-radius:4px;color:var(--theme-color-light);-webkit-user-select:none;user-select:none}.comfyui-easyuse-selector-item__tag input[type=checkbox]:checked{border:1px solid var(--theme-color-light);background-color:var(--theme-color-light);background-image:url("data:image/svg+xml,%3csvg viewBox=\'0 0 16 16\' fill=\'white\' xmlns=\'http://www.w3.org/2000/svg\'%3e%3cpath d=\'M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z\'/%3e%3c/svg%3e")}.comfyui-easyuse-selector-item__tag input span{margin:0 4px;vertical-align:middle}.comfyui-easyuse-selector-preview{position:absolute;left:-180px;top:-110px;z-index:2;border:1px solid var(--border-color);border-radius:var(--border-radius);background:var(--comfy-menu-bg);-webkit-backdrop-filter:saturate(180%) blur(40px);-khtml-backdrop-filter:saturate(180%) blur(40px);-moz-backdrop-filter:saturate(180%) blur(40px);-ms-backdrop-filter:saturate(180%) blur(40px);-o-backdrop-filter:saturate(180%) blur(40px);backdrop-filter:saturate(180%) blur(40px);overflow:hidden}.comfyui-easyuse-selector-preview img{width:150px;height:150px}.comfyui-easyuse-selector-preview__text{font-size:12px;padding:5px 10px;max-width:130px;color:var(--input-text)}.comfyui-easyuse-selector-preview__text h6{line-height:1.15;font-size:10px;margin:10px 0}.comfyui-easyuse-dialog{max-width:600px}.comfyui-easyuse-dialog-title{font-size:18px;font-weight:700;text-align:center;color:var(--input-text);margin:0}.comfyui-easyuse-dialog-images{margin-top:10px;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box}.comfyui-easyuse-dialog-images img{width:50%;height:auto;cursor:pointer;box-sizing:border-box;filter:brightness(80%)}.comfyui-easyuse-dialog-images img:hover{filter:brightness(100%)}.comfyui-easyuse-dialog-images.selected{border:4px solid var(--success-color)}.comfyui-easyuse-dialog-hidden{display:none;height:0}.comfyui-easyuse-contextmenu{--height: 26px;--padding: 8px;font-family:var(--font-family);position:fixed;top:0;left:0;width:100%;max-width:200px;min-width:100px;min-height:100px;padding:var(--padding) 0;box-shadow:0 0 10px #00000040;background-color:var(--tr-odd-bg-color);border-radius:var(--border-radius);z-index:10;will-change:transform}.comfyui-easyuse-contextmenu-item-divider{height:1px;width:100%;background-color:var(--border-color);margin:var(--padding) 0}.comfyui-easyuse-contextmenu-item-content{height:var(--height);padding:0 12px;cursor:pointer;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-contextmenu-item-content span{font-size:11px;color:var(--input-text);display:-webkit-box;-webkit-line-clamp:1;overflow:hidden;word-break:break-all;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1}.comfyui-easyuse-contextmenu-item-content i{color:var(--input-text);margin-left:4px;display:block;width:0;height:0;border-width:4px 4px 0;border-style:solid;border-color:var(--descrip-text) transparent transparent;-webkit-transform:scaleY(.8) rotate(-90deg);-khtml-transform:scaleY(.8) rotate(-90deg);-moz-transform:scaleY(.8) rotate(-90deg);-ms-transform:scaleY(.8) rotate(-90deg);-o-transform:scaleY(.8) rotate(-90deg);transform:scaleY(.8) rotate(-90deg)}.comfyui-easyuse-contextmenu-item-content:hover{background:var(--theme-color)}.comfyui-easyuse-contextmenu-item.disabled .comfyui-easyuse-contextmenu-item-content span{color:var(--border-color);cursor:default}.comfyui-easyuse-contextmenu-item.disabled .comfyui-easyuse-contextmenu-item-content:hover{background:transparent}.comfyui-easyuse-contextmenu-submenu{font-family:var(--font-family);position:absolute;top:0;left:200px;max-width:200px;width:200px;min-width:100px;min-height:--height;padding:var(--padding) 0;box-shadow:0 0 10px #00000040;background-color:var(--tr-odd-bg-color);border-radius:var(--border-radius);z-index:10;will-change:transform}.comfyui-easyuse-contextmenu-model{position:relative}.comfyui-easyuse-contextmenu-model:hover img{display:block;opacity:1}.comfyui-easyuse-contextmenu-model img{position:absolute;z-index:1;right:-175px;top:-75px;width:150px;height:auto;display:none;filter:brightness(70%);-webkit-filter:brightness(70%);opacity:0;-webkit-transition:all .5s cubic-bezier(.55,0,.1,1);-khtml-transition:all .5s cubic-bezier(.55,0,.1,1);-moz-transition:all .5s cubic-bezier(.55,0,.1,1);-ms-transition:all .5s cubic-bezier(.55,0,.1,1);-o-transition:all .5s cubic-bezier(.55,0,.1,1);transition:all .5s cubic-bezier(.55,0,.1,1)}.comfyui-easyuse-slider{width:100%;height:100%;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-slider-item{height:inherit;min-width:25px;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-webkit-flex-direction:column;-khtml-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;-o-flex-direction:column;flex-direction:column}.comfyui-easyuse-slider-item-input{height:15px;font-size:10px;color:var(--input-text)}.comfyui-easyuse-slider-item-label{height:15px;border:none;color:var(--descrip-text);font-size:8px}.comfyui-easyuse-slider-item-scroll{width:5px;height:calc(100% - 30px);background:var(--comfy-input-bg);border-radius:10px;position:relative}.comfyui-easyuse-slider-item-bar{width:10px;height:10px;background:linear-gradient(to bottom,var(--input-text),var(--descrip-text));border-radius:100%;box-shadow:0 2px 10px var(--bg-color);position:absolute;top:0;left:-2.5px;cursor:pointer;z-index:1}.comfyui-easyuse-slider-item-area{width:100%;border-radius:20px;position:absolute;bottom:0;background:var(--input-text);z-index:0}.comfyui-easyuse-slider-item.positive .comfyui-easyuse-slider-item-label{color:var(--success-color)}.comfyui-easyuse-slider-item.positive .comfyui-easyuse-slider-item-area{background:var(--success-color)}.comfyui-easyuse-slider-item.negative .comfyui-easyuse-slider-item-label{color:var(--error-color)}.comfyui-easyuse-slider-item.negative .comfyui-easyuse-slider-item-area{background:var(--error-color)}.comfyui-easyuse-map{height:100%;background:var(--comfy-menu-bg)}.comfyui-easyuse-map .p-splitter-gutter-handle{height:1px!important}.comfyui-easyuse-map-nodes{height:100%;position:relative}.comfyui-easyuse-map-nodes__header{position:absolute;z-index:2;top:0;left:0;width:100%;padding:.25rem 0 .25rem 1rem;height:2.7rem;background:var(--comfy-menu-bg);border-bottom:1px solid var(--border-color);display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-webkit-backdrop-filter:saturate(180%) blur(40px);-khtml-backdrop-filter:saturate(180%) blur(40px);-moz-backdrop-filter:saturate(180%) blur(40px);-ms-backdrop-filter:saturate(180%) blur(40px);-o-backdrop-filter:saturate(180%) blur(40px);backdrop-filter:saturate(180%) blur(40px)}.comfyui-easyuse-map-nodes__header .title{font-size:13px;color:var(--input-text);font-weight:400;line-height:1.5;-webkit-user-select:none;user-select:none}.comfyui-easyuse-map-nodes__header .toolbar{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-map-nodes__header .toolbar .icon{font-size:.85rem;margin-left:.25rem;cursor:pointer}.comfyui-easyuse-map-nodes__content{position:relative;padding:2.7rem 0 0;height:100%;overflow:auto}.comfyui-easyuse-map-nodes__content dl .label{padding-left:1rem}.comfyui-easyuse-map-nodes__content ol,.comfyui-easyuse-map-nodes__content dl{list-style-type:none;padding:0;margin:0}.comfyui-easyuse-map-nodes__content ol .toolbar span,.comfyui-easyuse-map-nodes__content dl .toolbar span{font-size:13px}.comfyui-easyuse-map-nodes__content ol .toolbar span.pi-eye,.comfyui-easyuse-map-nodes__content dl .toolbar span.pi-eye{color:var(--input-text)}.comfyui-easyuse-map-nodes__content ol .toolbar span.pi-eye-slash,.comfyui-easyuse-map-nodes__content dl .toolbar span.pi-eye-slash{color:var(--descrip-text)}.comfyui-easyuse-map-nodes__content ol .toolbar span.pi-eye-slash.never,.comfyui-easyuse-map-nodes__content dl .toolbar span.pi-eye-slash.never{opacity:.5}.comfyui-easyuse-map-nodes__content .no_result{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;text-align:center}.comfyui-easyuse-map-nodes-group{position:relative;overflow:hidden;width:100%;height:2rem;cursor:default;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;pointer-events:auto}.comfyui-easyuse-map-nodes-group .left,.comfyui-easyuse-map-nodes-group .right{height:100%;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-map-nodes-group .left{padding-left:.5rem;margin-right:.25rem;-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1}.comfyui-easyuse-map-nodes-group .icon{font-size:.85rem;margin-right:.25rem}.comfyui-easyuse-map-nodes-group .label{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;height:100%;width:100%;min-width:80px}.comfyui-easyuse-map-nodes-group .label span{font-size:14px;color:var(--input-text);font-weight:400;line-height:1.5;display:-webkit-box;-webkit-line-clamp:1;overflow:hidden;word-break:break-all;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.comfyui-easyuse-map-nodes-group:hover{background:var(--content-hover-bg)!important}.comfyui-easyuse-map-nodes-group.active{background:var(--theme-color)!important}.comfyui-easyuse-map-nodes-group.active .label{color:#fff;cursor:default}.comfyui-easyuse-map-nodes-group.never .label{color:var(--descrip-text);opacity:.4}.comfyui-easyuse-map-nodes-group.bypass .label{color:var(--descrip-text)}.comfyui-easyuse-map-nodes-node{height:2rem;cursor:default;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;position:relative;overflow:hidden;pointer-events:auto}.comfyui-easyuse-map-nodes-node .label{text-indent:.5rem;font-size:13px;color:var(--input-text);font-weight:400;line-height:1.5;-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;margin-right:.25rem;height:2rem;line-height:2rem;width:100%;display:-webkit-box;-webkit-line-clamp:1;overflow:hidden;word-break:break-all;text-overflow:ellipsis;-webkit-box-orient:vertical}.comfyui-easyuse-map-nodes-node .label.error{color:var(--error-color)}.comfyui-easyuse-map-nodes-node:hover{background:var(--content-hover-bg)!important}.comfyui-easyuse-map-nodes-node.never .label{color:var(--descrip-text);opacity:.5}.comfyui-easyuse-map-nodes-node.bypass .label{color:#f0f;opacity:.5}.comfyui-easyuse-map-nodes .nodes .label{text-indent:1rem}.comfyui-easyuse-toolbar{border-radius:0 12px 12px 0;min-width:50px;height:24px;position:fixed;bottom:85px;left:0;display:flex;align-items:center;z-index:1000;background-color:var(--comfy-menu-bg);border:1px solid var(--bg-color);-webkit-backdrop-filter:saturate(180%) blur(40px);-khtml-backdrop-filter:saturate(180%) blur(40px);-moz-backdrop-filter:saturate(180%) blur(40px);-ms-backdrop-filter:saturate(180%) blur(40px);-o-backdrop-filter:saturate(180%) blur(40px);backdrop-filter:saturate(180%) blur(40px)}.comfyui-easyuse-toolbar-icon{height:100%;padding:0 4px;display:flex;justify-content:center;align-items:center;font-size:12px;color:#fff;transition:all .3s ease-in-out;cursor:pointer}.comfyui-easyuse-toolbar-icon svg{width:14px;height:14px}.comfyui-easyuse-toolbar-icon:hover.group{color:var(--warning-color)}.comfyui-easyuse-toolbar-icon:hover.rocket{color:var(--theme-color)}.comfyui-easyuse-toolbar-nodes-map{position:absolute;top:50px;left:10px;width:200px;border-radius:12px;min-height:100px;max-height:600px;color:var(--descrip-text);background-color:var(--comfy-menu-bg);border:1px solid var(--bg-color);-webkit-backdrop-filter:saturate(180%) blur(40px);-khtml-backdrop-filter:saturate(180%) blur(40px);-moz-backdrop-filter:saturate(180%) blur(40px);-ms-backdrop-filter:saturate(180%) blur(40px);-o-backdrop-filter:saturate(180%) blur(40px);backdrop-filter:saturate(180%) blur(40px);z-index:399;padding-top:0;overflow:hidden}.comfyui-easyuse-toolbar-nodes-map .no-result-placeholder-content{-webkit-transform:scale(.8);-khtml-transform:scale(.8);-moz-transform:scale(.8);-ms-transform:scale(.8);-o-transform:scale(.8);transform:scale(.8)}.comfyui-easyuse-toolbar-nodes-map .comfyui-easyuse-map-nodes{min-height:100px;max-height:600px}.comfyui-easyuse-toolbar-nodes-map .comfyui-easyuse-map-nodes__header:before{content:"…";position:absolute;left:.25rem;top:2.75rem;transform:translateY(-2rem) rotate(90deg);width:.5rem;height:.5rem;display:inline-block;overflow:hidden;line-height:5px;padding:3px 4px;cursor:move;vertical-align:middle;font-size:12px;font-family:sans-serif;letter-spacing:2px;color:var(--drag-text);z-index:3;text-shadow:1px 0 1px black}.comfyui-easyuse-toolbar-nodes-map .comfyui-easyuse-map-nodes__header .title{cursor:move;padding-left:.25rem}.comfyui-easyuse-toolbar-nodes-map .comfyui-easyuse-map-nodes__content{max-height:calc(600px - 2.7rem)}.no-result-placeholder{display:flex;justify-content:center;align-items:center;height:100%}.no-result-placeholder-content{text-align:center;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-khtml-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;-o-flex-direction:column;flex-direction:column;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between}.no-result-placeholder .p-card{background-color:transparent!important;box-shadow:none;text-align:center}.no-result-placeholder h3{color:var(--input-text);margin-bottom:.5rem}.no-result-placeholder p{color:var(--descrip-text);margin-bottom:1rem;margin-top:0}#comfyui-easyuse-components{position:absolute;top:0;left:0;z-index:3}.comfyui-easyuse{--p-datatable-header-cell-padding: .15rem 1rem;--p-datatable-body-cell-padding: .15rem 1rem;--p-primary-color: var(--theme-color-light)!important;--border-color-solid: var(--border-color);--border-radius: 8px}.comfyui-easyuse.dark-theme{--fg-color: #fff;--bg-color: #242427;--content-bg:#18181b;--content-fg:#fff;--content-hover-bg: #27272a;--comfy-menu-bg: rgba(24,24,27,.9);--comfy-input-bg: #242427;--input-text: #ffffff;--descrip-text: #71717a;--drag-text: #ccc;--error-text: #ff4444;--border-color: #3f3f46;--border-color-solid: #2a2a2e;--tr-even-bg-color: rgba(28,28,28,.9);--tr-odd-bg-color: rgba(19,19,19,.9)}.comfyui-easyuse ::-webkit-scrollbar{width:0em}.comfyui-easyuse ::-webkit-scrollbar-track{background-color:transparent}.comfyui-easyuse ::-webkit-scrollbar-thumb{background-color:transparent;border-radius:2px}.comfyui-easyuse ::-webkit-scrollbar-thumb:hover{background-color:transparent}.comfyui-easyuse body{font-family:var(--font-family)!important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.comfyui-easyuse textarea{font-family:var(--font-family)!important}.comfyui-easyuse hr{border:1px solid var(--border-color)}.comfyui-easyuse .comfy-multiline-input{background-color:transparent;border:1px solid var(--border-color-solid);border-radius:var(--border-radius);padding:8px;font-size:12px}.comfyui-easyuse #comfy-settings-dialog{border:1px solid var(--border-color);background:transparent;-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%);box-shadow:none}.comfyui-easyuse .comfy-modal{border:1px solid var(--border-color);box-shadow:none;-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .cm-title{background-color:transparent!important}.comfyui-easyuse .cm-notice-board{border-radius:10px!important;border:1px solid var(--border-color)!important}.comfyui-easyuse .cm-menu-container{margin-bottom:50px!important}.comfyui-easyuse .cn-manager-custom_milk_white .tg-column-name,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-column-name{color:var(--input-text)}.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-message,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-message{text-align:center;color:var(--descrip-text)!important}.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-frame .tg-cell,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-frame .tg-cell{color:var(--input-text)}.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-frame .cn-node-name a,.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-frame .cmm-node-name a,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-frame .cn-node-name a,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-frame .cmm-node-name a{color:var(--theme-color)!important}.comfyui-easyuse .comfy-menu{border-radius:16px;box-shadow:0 0 1px var(--descrip-text);-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .comfy-menu button.comfy-settings-btn{font-size:12px}.comfyui-easyuse .comfy-menu-btns{margin-bottom:4px}.comfyui-easyuse .comfy-menu button,.comfyui-easyuse .comfy-modal button{font-size:14px;padding:4px 0;margin-bottom:4px}.comfyui-easyuse .comfy-menu-btns button,.comfyui-easyuse .comfy-list-actions button{font-size:10px}.comfyui-easyuse .comfy-menu>button,.comfyui-easyuse .comfy-menu-btns button,.comfyui-easyuse .comfy-menu .comfy-list button,.comfyui-easyuse .comfy-modal button{border-width:1px}.comfyui-easyuse #comfy-dev-save-api-button{justify-content:center}.comfyui-easyuse #queue-button{position:relative;overflow:hidden;min-height:30px;z-index:1}.comfyui-easyuse #queue-button:after{clear:both;content:attr(data-attr);background:green;color:#fff;width:var(--process-bar-width);height:100%;position:absolute;top:0;left:0;z-index:0;text-align:center;display:flex;justify-content:center;align-items:center}.comfyui-easyuse #shareButton{background:linear-gradient(to left,var(--theme-color),var(--theme-color-light))!important;color:#fff!important}.comfyui-easyuse .litegraph.litecontextmenu{--height: 24px;--padding: 6px;font-family:var(--font-family);padding:var(--padding) 0;border-radius:var(--border-radius);-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .litegraph.litecontextmenu .litemenu-title{padding:var(--padding)}.comfyui-easyuse .litegraph.litecontextmenu>div:first-child.litemenu-title{margin-top:-6px}.comfyui-easyuse .litegraph.litecontextmenu .submenu{height:var(--height);line-height:var(--height);padding:0 18px 0 12px;margin:0;background:transparent!important}.comfyui-easyuse .litegraph.litecontextmenu .submenu.has_submenu{border-right:none;position:relative}.comfyui-easyuse .litegraph.litecontextmenu .submenu.has_submenu:after{content:"";display:block;width:0;height:0;border-width:4px 4px 0;border-style:solid;border-color:var(--input-text) transparent transparent;transform:translateY(-50%) rotate(-90deg);top:50%;position:absolute}.comfyui-easyuse .litegraph.litecontextmenu .submenu.separator{height:1px;width:100%;background-color:var(--border-color)!important;margin:var(--padding) 0;border:none}.comfyui-easyuse .litegraph.litecontextmenu .submenu:last-child.separator{display:none}.comfyui-easyuse .litegraph.litecontextmenu .submenu:hover:not(.separator){background:var(--theme-color)!important}.comfyui-easyuse .litegraph.lite-search-item{background-color:var(--comfy-input-bg)!important;filter:brightness(100%)}.comfyui-easyuse .litegraph.lite-search-item:hover{filter:brightness(120%);color:var(--input-text)}.comfyui-easyuse .graphdialog{-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .graphdialog button{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse .comfyui-menu{border-bottom:1px solid var(--bg-color)}.comfyui-easyuse .side-tool-bar-container{border-right:1px solid var(--bg-color)}.comfyui-easyuse .comfy-modal-content{width:100%}.comfyui-easyuse-poseEditor{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;text-align:center;font-size:18px;line-height:1.5}#comfyui-menu-monitor{width:120px}#comfyui-menu-monitor #crystools-monitor-container{margin:0 auto!important}#comfyui-menu-monitor #crystools-monitor-container>div{margin:2px 0!important}#comfyui-menu-monitor #crystools-monitor-container>div>div>div{padding:0 4px!important}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}(); -var e,t,s,o,n,i,a,l,r,d,u,c,p,h,m,g,f=Object.defineProperty,y=(e,t,s)=>((e,t,s)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);import{d as v,c as _,h as w,s as b,a as A,b as S,e as E,T as C,f as L}from"./assets/vendor-BEuf1XmE.js";import{r as k,w as x,e as I,b as N,c as T,I as D,d as O,F as R,C as M,J as G,K as P,L as B,M as F,z as U,G as z,o as j,N as H,D as W,O as Y,E as V,P as Z,x as X,Q,R as K,S as J}from"./assets/vue-DjzFgvDF.js";import{P as q}from"./assets/primevue-BSs2m5Wu.js";import"./assets/primeuix-Be3xdh47.js";let $=(null==(t=null==(e=window.comfyAPI)?void 0:e.app)?void 0:t.app)||null,ee=(null==(o=null==(s=window.comfyAPI)?void 0:s.api)?void 0:o.api)||null,te=(null==(i=null==(n=window.comfyAPI)?void 0:n.ui)?void 0:i.$el)||null,se=(null==(l=null==(a=window.comfyAPI)?void 0:a.dialog)?void 0:l.ComfyDialog)||null,oe=(null==(d=null==(r=window.comfyAPI)?void 0:r.widgets)?void 0:d.ComfyWidgets)||null,ne=(null==(c=null==(u=window.comfyAPI)?void 0:u.utils)?void 0:c.applyTextReplacements)||null,ie=(null==(h=null==(p=window.comfyAPI)?void 0:p.groupNode)?void 0:h.GroupNodeConfig)||null;const ae=(e,t=void 0)=>{var s,o;return e?null==(o=null==(s=null==$?void 0:$.ui)?void 0:s.settings)?void 0:o.getSettingValue(e,t):null};function le(e,t=null,s=void 0){try{let o=e?ae(e,s):null;return void 0===o&&t&&(o=localStorage[e]),o}catch(o){return null}}async function re(e,t,s=null){var o,n;try{(null==(n=null==(o=null==$?void 0:$.ui)?void 0:o.settings)?void 0:n.setSettingValue)?$.ui.settings.setSettingValue(e,t):await ee.storeSetting(e,t),s&&(localStorage[s]="object"==typeof t?JSON.stringify(t):t)}catch(i){}}function de(e,t){if(e="number"==typeof e?e:e instanceof Date?e.getTime():parseInt(e),isNaN(e))return null;let s=new Date(e);(e=s.toString().split(/[\s\:]/g).slice(0,-2))[1]=["01","02","03","04","05","06","07","08","09","10","11","12"][s.getMonth()];let o={MM:1,dd:2,yyyy:3,hh:4,mm:5,ss:6};return t.replace(/([Mmdhs]|y{2})\1/g,(t=>e[o[t]]))}const ue="comfyui-easyuse-",ce="dark-theme",pe="#236692",he={PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},me=0x4000000000000,ge=["loaders","latent","image","mask","sampling","_for_testing","advanced","utils","api"],fe={ALWAYS:0,NEVER:2,BYPASS:4},ye="easyuse_nodes_map",ve=LGraphCanvas.node_colors.bgcolor,_e={ColorPalette:{version:105,id:"obsidian",name:"Obsidian",colors:{node_slot:{CLIP:"#FFD500",CLIP_VISION:"#A8DADC",CLIP_VISION_OUTPUT:"#ad7452",CONDITIONING:"#FFA931",CONTROL_NET:"#6EE7B7",IMAGE:"#64B5F6",LATENT:"#FF9CF9",MASK:"#81C784",MODEL:"#B39DDB",STYLE_MODEL:"#C2FFAE",VAE:"#FF6E6E",TAESD:"#DCC274",PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},litegraph_base:{BACKGROUND_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQBJREFUeNrs1rEKwjAUhlETUkj3vP9rdmr1Ysammk2w5wdxuLgcMHyptfawuZX4pJSWZTnfnu/lnIe/jNNxHHGNn//HNbbv+4dr6V+11uF527arU7+u63qfa/bnmh8sWLBgwYJlqRf8MEptXPBXJXa37BSl3ixYsGDBMliwFLyCV/DeLIMFCxYsWLBMwSt4Be/NggXLYMGCBUvBK3iNruC9WbBgwYJlsGApeAWv4L1ZBgsWLFiwYJmCV/AK3psFC5bBggULloJX8BpdwXuzYMGCBctgwVLwCl7Be7MMFixYsGDBsu8FH1FaSmExVfAxBa/gvVmwYMGCZbBg/W4vAQYA5tRF9QYlv/QAAAAASUVORK5CYII=",CLEAR_BACKGROUND_COLOR:"#222222",NODE_TITLE_COLOR:"#d4d4d8",NODE_SELECTED_TITLE_COLOR:"#ffffff",NODE_TEXT_SIZE:14,NODE_TEXT_COLOR:"#ffffff",NODE_SUBTEXT_SIZE:12,NODE_DEFAULT_COLOR:"#09090b",NODE_DEFAULT_BGCOLOR:"rgba(24,24,27,.9)",NODE_DEFAULT_BOXCOLOR:"rgba(255,255,255,.75)",NODE_DEFAULT_SHAPE:"box",NODE_BOX_OUTLINE_COLOR:pe,DEFAULT_SHADOW_COLOR:"rgba(0,0,0,0)",DEFAULT_GROUP_FONT:24,WIDGET_BGCOLOR:"#242427",WIDGET_OUTLINE_COLOR:"#3f3f46",WIDGET_TEXT_COLOR:"#d4d4d8",WIDGET_SECONDARY_TEXT_COLOR:"#d4d4d8",LINK_COLOR:"#9A9",EVENT_LINK_COLOR:"#A86",CONNECTING_LINK_COLOR:"#AFA"},comfy_base:{"fg-color":"#fff","bg-color":"#09090b","comfy-menu-bg":"rgba(24,24,24,.9)","comfy-input-bg":"#262626","input-text":"#ddd","descrip-text":"#999","drag-text":"#ccc","error-text":"#ff4444","border-color":"#29292c","tr-even-bg-color":"rgba(28,28,28,.9)","tr-odd-bg-color":"rgba(19,19,19,.9)"}}},NODE_COLORS:{red:{color:"#af3535",bgcolor:ve,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:ve,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:ve,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:ve,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:ve,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:ve,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:ve,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:ve,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:ve,groupcolor:"#444"}}};let we=JSON.parse(JSON.stringify(_e));delete we.NODE_COLORS,we.ColorPalette.id="obsidian_dark",we.ColorPalette.name="Obsidian Dark",we.ColorPalette.colors.litegraph_base.BACKGROUND_IMAGE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGlmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDEgNzkuMTQ2Mjg5OSwgMjAyMy8wNi8yNS0yMDowMTo1NSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAyMy0xMS0xM1QwMDoxODowMiswMTowMCIgeG1wOk1vZGlmeURhdGU9IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIHhtcDpNZXRhZGF0YURhdGU9IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmIyYzRhNjA5LWJmYTctYTg0MC1iOGFlLTk3MzE2ZjM1ZGIyNyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjk0ZmNlZGU4LTE1MTctZmQ0MC04ZGU3LWYzOTgxM2E3ODk5ZiIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjIzMWIxMGIwLWI0ZmItMDI0ZS1iMTJlLTMwNTMwM2NkMDdjOCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6MjMxYjEwYjAtYjRmYi0wMjRlLWIxMmUtMzA1MzAzY2QwN2M4IiBzdEV2dDp3aGVuPSIyMDIzLTExLTEzVDAwOjE4OjAyKzAxOjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjUuMSAoV2luZG93cykiLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjQ4OWY1NzlmLTJkNjUtZWQ0Zi04OTg0LTA4NGE2MGE1ZTMzNSIgc3RFdnQ6d2hlbj0iMjAyMy0xMS0xNVQwMjowNDo1OSswMTowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIiBzdEV2dDpjaGFuZ2VkPSIvIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpiMmM0YTYwOS1iZmE3LWE4NDAtYjhhZS05NzMxNmYzNWRiMjciIHN0RXZ0OndoZW49IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCAyNS4xIChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4OTe6GAAAAx0lEQVR42u3WMQoAIQxFwRzJys77X8vSLiRgITif7bYbgrwYc/mKXyBoY4VVBgsWLFiwYFmOlTv+9jfDOjHmr8u6eVkGCxYsWLBgmc5S8ApewXvgYRksWLBgKXidpeBdloL3wMOCBctgwVLwCl7BuyyDBQsWLFiwTGcpeAWv4D3wsAwWLFiwFLzOUvAuS8F74GHBgmWwYCl4Ba/gXZbBggULFixYprMUvIJX8B54WAYLFixYCl5nKXiXpeA98LBgwTJYsGC9tg1o8f4TTtqzNQAAAABJRU5ErkJggg==",we.ColorPalette.colors.litegraph_base.CLEAR_BACKGROUND_COLOR="#09090b";const be=LGraphCanvas.node_colors.bgcolor,Ae={ColorPalette:{id:"milk_white",name:"Milk White",colors:{node_slot:{CLIP:"#FFA726",CLIP_VISION:"#5C6BC0",CLIP_VISION_OUTPUT:"#8D6E63",CONDITIONING:"#EF5350",CONTROL_NET:"#66BB6A",IMAGE:"#42A5F5",LATENT:"#AB47BC",MASK:"#9CCC65",MODEL:"#7E57C2",STYLE_MODEL:"#D4E157",VAE:"#FF7043",PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},litegraph_base:{BACKGROUND_IMAGE:"data:image/gif;base64,R0lGODlhZABkALMAAAAAAP///+vr6+rq6ujo6Ofn5+bm5uXl5d3d3f///wAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAkALAAAAABkAGQAAAT/UMhJq7046827HkcoHkYxjgZhnGG6si5LqnIM0/fL4qwwIMAg0CAsEovBIxKhRDaNy2GUOX0KfVFrssrNdpdaqTeKBX+dZ+jYvEaTf+y4W66mC8PUdrE879f9d2mBeoNLfH+IhYBbhIx2jkiHiomQlGKPl4uZe3CaeZifnnijgkESBqipqqusra6vsLGys62SlZO4t7qbuby7CLa+wqGWxL3Gv3jByMOkjc2lw8vOoNSi0czAncXW3Njdx9Pf48/Z4Kbbx+fQ5evZ4u3k1fKR6cn03vHlp7T9/v8A/8Gbp4+gwXoFryXMB2qgwoMMHyKEqA5fxX322FG8tzBcRnMW/zlulPbRncmQGidKjMjyYsOSKEF2FBlJQMCbOHP6c9iSZs+UnGYCdbnSo1CZI5F64kn0p1KnTH02nSoV3dGTV7FFHVqVq1dtWcMmVQZTbNGu72zqXMuW7danVL+6e4t1bEy6MeueBYLXrNO5Ze36jQtWsOG97wIj1vt3St/DjTEORss4nNq2mDP3e7w4r1bFkSET5hy6s2TRlD2/mSxXtSHQhCunXo26NevCpmvD/UU6tuullzULH76q92zdZG/Ltv1a+W+osI/nRmyc+fRi1Xdbh+68+0vv10dH3+77KD/i6IdnX669/frn5Zsjh4/2PXju8+8bzc9/6fj27LFnX11/+IUnXWl7BJfegm79FyB9JOl3oHgSklefgxAC+FmFGpqHIYcCfkhgfCohSKKJVo044YUMttggiBkmp6KFXw1oII24oYhjiDByaKOOHcp3Y5BD/njikSkO+eBREQAAOw==",CLEAR_BACKGROUND_COLOR:"lightgray",NODE_TITLE_COLOR:"#222",NODE_SELECTED_TITLE_COLOR:"#000",NODE_TEXT_SIZE:14,NODE_TEXT_COLOR:"#444",NODE_SUBTEXT_SIZE:12,NODE_DEFAULT_COLOR:"#F7F7F7",NODE_DEFAULT_BGCOLOR:"#F5F5F5",NODE_DEFAULT_BOXCOLOR:"#555",NODE_DEFAULT_SHAPE:"box",NODE_BOX_OUTLINE_COLOR:"#000",DEFAULT_SHADOW_COLOR:"rgba(0,0,0,0.1)",DEFAULT_GROUP_FONT:24,WIDGET_BGCOLOR:"#D4D4D4",WIDGET_OUTLINE_COLOR:"#999",WIDGET_TEXT_COLOR:"#222",WIDGET_SECONDARY_TEXT_COLOR:"#555",LINK_COLOR:"#9A9",EVENT_LINK_COLOR:"#FF9800",CONNECTING_LINK_COLOR:"#222"},comfy_base:{"fg-color":"#222","bg-color":"#DDD","comfy-menu-bg":"#F5F5F5","comfy-input-bg":"#C9C9C9","input-text":"#222","descrip-text":"#444","drag-text":"#555","error-text":"#F44336","border-color":"#bbb","tr-even-bg-color":"#f9f9f9","tr-odd-bg-color":"#fff","content-bg":"#e0e0e0","content-fg":"#222","content-hover-bg":"#adadad","content-hover-fg":"#222"}}},NODE_COLORS:{red:{color:"#af3535",bgcolor:be,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:be,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:be,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:be,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:be,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:be,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:be,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:be,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:be,groupcolor:"#444"}}},Se={"Workflow created by":"工作流创建者","Watch more video content":"观看更多视频内容","Workflow Guide":"工作流指南","💎 View Checkpoint Info...":"💎 查看 Checkpoint 信息...","💎 View Lora Info...":"💎 查看 Lora 信息...","🔃 Reload Node":"🔃 刷新节点","Updated At:":"最近更新:","Created At:":"首次发布:","✏️ Edit":"✏️ 编辑","💾 Save":"💾 保存","No notes":"当前还没有备注内容","Saving Notes...":"正在保存备注...","Type your notes here":"在这里输入备注内容",ModelName:"模型名称","Models Required":"所需模型","Download Model":"下载模型","Source Url":"模型源地址",Notes:"备注",Type:"类型","Trained Words":"训练词",BaseModel:"基础算法",Details:"详情",Description:"描述",Download:"下载量",Source:"来源","Saving Preview...":"正在保存预览图...","Saving Succeed":"保存成功","Clean SuccessFully":"清理成功","Clean Failed":"清理失败","Saving Failed":"保存失败","No COMBO link":"沒有找到COMBO连接","Reboot ComfyUI":"重启ComfyUI","Are you sure you'd like to reboot the server?":"是否要重启ComfyUI?","Nodes Map":"管理节点组","Nodes map sorting mode":"管理节点组排序模式","No Nodes":"未找到节点","No nodes found in the map":"在工作流程中没有找到节点","Expand All":"展开所有组","Collapse All":"折叠所有组",Close:"关闭","Default automatic sorting, if set to manual, groups can be dragged and dropped and the sorting results saved.":"默认自动排序,如果设置为手动,组可以拖放并保存排序结果。","For drag and drop sorting, please find Nodes map sorting mode in Settings->EasyUse and change it to manual":"如需拖拽排序请在设置->EasyUse节点中找到管理节点组排序模式并修改成 manual",Queue:"队列","Cleanup Of VRAM Usage":"清理显存占用","Please stop all running tasks before cleaning GPU":"请在清理GPU之前停止所有运行中的任务",Always:"启用中",Bypass:"已忽略",Never:"已停用","Auto Sorting":"自动排序","Toggle `Show/Hide` can set mode of group, LongPress can set group nodes to never":"点击`启用中/已忽略`可设置组模式, 长按可停用该组节点","Enable Shift+Up/Down/Left/Right key to align selected nodes":"启用 `Shift+上/下/左/右` 键对齐选中的节点","Enable Shift+g to add selected nodes to a group":"启用 `Shift+g` 键将选中的节点添加一个组","Enable Shift+r to unload models and node cache":"启用 `Shift+r` 键卸载模型和节点缓存","Enable Up/Down/Left/Right key to jump nearest nodes":"启用 `上/下/左/右` 键跳转到最近的前后节点","Enable ALT+1~9 to paste nodes from nodes template":"启用 `ALT+1~9` 从节点模板粘贴到工作流中","Enable contextMenu auto nest subdirectories":"启用上下文菜单自动嵌套子目录","Enable right-click menu to add node A~Z sorting":"启用右键菜单中新建节点A~Z排序","Enable model thumbnails display":"启动模型预览图显示","Enable nodes runtime display":"启动节点运行时间显示","Enable chain get node and set node with parent nodes":"启用将获取点和设置点与父节点链在一起","Maximum number of model thumbnails displayed":"显示的模型缩略图的最大数量","Too many thumbnails will affect the first loading time, set the maximum value to not load the thumbnail function when there are too many models's thumbnail":"太多的缩略图会影响首次加载时间,当模型缩略图太多时,设置最大值以不加载缩略图功能","Too many thumbnails, have closed the display":"模型缩略图太多啦,为您关闭了显示","Get styles list Failed":"获取样式列表失败","Get style image Failed":"获取样式图片失败","Empty All":"清空所有","Type here to search styles ...":"在此处输入以搜索样式 ...","Loading UserInfo...":"正在获取用户信息...","Please set the APIKEY first":"请先设置APIKEY","Setting APIKEY":"设置APIKEY","Save Account Info":"保存账号信息",Choose:"选择",Delete:"删除",Edit:"编辑","At least one account is required":"删除失败: 至少需要一个账户","APIKEY is not Empty":"APIKEY 不能为空","Add Account":"添加账号","Getting Your APIKEY":"获取您的APIKEY","Choose Selected Images":"选择选中的图片","Choose images to continue":"选择图片以继续",Background:"背景",Hat:"帽子",Hair:"头发",Body:"身体",Face:"脸部",Clothes:"衣服",Others:"其他",Glove:"手套",Sunglasses:"太阳镜","Upper-clothes":"上衣",Dress:"连衣裙",Coat:"外套",Socks:"袜子",Pants:"裤子",Jumpsuits:"连体衣",Scarf:"围巾",Skirt:"裙子","Left-arm":"左臂","Right-arm":"右臂","Left-leg":"左腿","Right-leg":"右腿","Left-shoe":"左鞋","Right-shoe":"右鞋",s:"秒","No Node Templates Found":"未找到节点模板预设","Get Node Templates File Failed":"获取节点模板文件失败","Node template with {key} not set":"未设置快捷键为{key}的节点预设","ComfyUI Basic":"ComfyUI 基础节点","Recommend Nodes":"推荐节点","Others A~Z":"其他节点 A~Z"},Ee=le("AGL.Locale"),Ce=(e,t=!1)=>"zh-CN"===(t?navigator.language:Ee)&&Se[e]||e,Le={addGroup:{id:"EasyUse.Hotkeys.AddGroup",name:Ce("Enable Shift+g to add selected nodes to a group"),type:"boolean",defaultValue:!0},cleanVRAMUsed:{id:"EasyUse.Hotkeys.cleanVRAMUsed",name:Ce("Enable Shift+r to unload models and node cache"),type:"boolean",defaultValue:!0},alignSelectedNodes:{id:"EasyUse.Hotkeys.AlignSelectedNodes",name:Ce("Enable Shift+Up/Down/Left/Right key to align selected nodes"),type:"boolean",defaultValue:!0},nodesTemplate:{id:"EasyUse.Hotkeys.NodesTemplate",name:Ce("Enable ALT+1~9 to paste nodes from nodes template"),type:"boolean",defaultValue:!0},jumpNearestNodes:{id:"EasyUse.Hotkeys.JumpNearestNodes",name:Ce("Enable Up/Down/Left/Right key to jump nearest nodes"),type:"boolean",defaultValue:!0},subDirectories:{id:"EasyUse.ContextMenu.SubDirectories",name:Ce("Enable contextMenu auto nest subdirectories"),type:"boolean",defaultValue:!1},modelsThumbnails:{id:"EasyUse.ContextMenu.ModelsThumbnails",name:Ce("Enable model thumbnails display"),type:"boolean",defaultValue:!1},modelsThumbnailsLimit:{id:"EasyUse.ContextMenu.ModelsThumbnailsLimit",name:Ce("Maximum number of model thumbnails displayed"),tooltip:Ce("Too many thumbnails will affect the first loading time, set the maximum value to not load the thumbnail function when there are too many models's thumbnail"),type:"slider",attrs:{min:0,max:5e3,step:100},defaultValue:500},rightMenuNodesSort:{id:"EasyUse.ContextMenu.NodesSort",name:Ce("Enable right-click menu to add node A~Z sorting"),type:"boolean",defaultValue:!0},nodesRuntime:{id:"EasyUse.Nodes.Runtime",name:Ce("Enable nodes runtime display"),type:"boolean",defaultValue:!0},chainGetSet:{id:"EasyUse.Nodes.ChainGetSet",name:Ce("Enable chain get node and set node with parent nodes"),type:"boolean",defaultValue:!0},nodesMap:{id:"EasyUse.NodesMap.Sorting",name:Ce("Nodes map sorting mode"),tooltip:Ce("Default automatic sorting, if set to manual, groups can be dragged and dropped and the sorting results saved."),type:"combo",options:["Auto sorting","Manual drag&drop sorting"],defaultValue:"Auto sorting"}};function ke(e=100,t){return new Promise((s=>{setTimeout((()=>{s(t)}),e)}))}const xe=new class{constructor(){y(this,"element",te(`div.${ue}toast`)),y(this,"children",HTMLElement),y(this,"container",document.body),this.container.appendChild(this.element)}async show(e){let t=te(`div.${ue}toast-container`,[te("div",[te("span",[...e.icon?[te("i",{className:e.icon})]:[],te("span",e.content)])])]);t.setAttribute("toast-id",e.id),this.element.replaceChildren(t),this.container.appendChild(this.element),await ke(64),t.style.marginTop=`-${t.offsetHeight}px`,await ke(64),t.classList.add("show"),e.duration&&(await ke(e.duration),this.hide(e.id))}async hide(e){const t=document.querySelector(`.${ue}toast > [toast-id="${e}"]`);(null==t?void 0:t.classList.contains("show"))&&(t.classList.remove("show"),await ke(750)),t&&t.remove()}async clearAllMessages(){let e=document.querySelector(`.${ue}container`);e&&(e.innerHTML="")}async info(e,t=3e3,s=[]){this.show({id:"toast-info",icon:`mdi mdi-information ${ue}theme`,content:e,duration:t})}async success(e,t=3e3){this.show({id:"toast-success",icon:`mdi mdi-check-circle ${ue}success`,content:e,duration:t})}async error(e,t=3e3){this.show({id:"toast-error",icon:`mdi mdi-close-circle ${ue}error`,content:e,duration:t})}async warn(e,t=3e3){this.show({id:"toast-warn",icon:`mdi mdi-alert-circle ${ue}warning`,content:e,duration:t})}async showLoading(e,t=0){this.show({id:"toast-loading",icon:"mdi mdi-rotate-right loading",content:e,duration:t})}async hideLoading(){this.hide("toast-loading")}},Ie=async()=>{try{const{Running:e,Pending:t}=await ee.getQueue();if(e.length>0||t.length>0)return void xe.error(Ce("Clean Failed")+":"+Ce("Please stop all running tasks before cleaning GPU"));200==(await ee.fetchApi("/easyuse/cleangpu",{method:"POST"})).status?xe.success(Ce("Clean SuccessFully")):xe.error(Ce("Clean Failed"))}catch(e){}},Ne=v("groups",{state:e=>({groups:[],nodes:[],nodesDefs:[],aglTranslation:[],isWatching:!1}),getters:{groups_nodes(){var e;let t=[],s=[];if((null==(e=this.nodes)?void 0:e.length)>0){this.nodes.map((e=>{let o=e.pos,n=!1;for(let s=0;si.pos[0]&&o[0]i.pos[1]&&o[1]e.pos[0]-t.pos[0])).sort(((e,t)=>e.pos[1]-t.pos[1])))},setNodes(e){this.nodes=_(e)},update(){($.extensionManager.activeSidebarTab===ye||this.isWatching)&&setTimeout((e=>{this.setGroups($.canvas.graph._groups),this.setNodes($.canvas.graph._nodes)}),1)},watchGraph(e=!1){e&&(this.isWatching=!0);let t=this;this.update();const s=$.graph.onNodeAdded;$.graph.onNodeAdded=function(e){t.update();const o=e.onRemoved;return e.onRemoved=function(){return t.update(),null==o?void 0:o.apply(this,arguments)},null==s?void 0:s.apply(this,arguments)},$.canvas.onNodeMoved=function(e){t.update()};const o=LGraphCanvas.onNodeAlign;LGraphCanvas.onNodeAlign=function(e){return t.update(),null==o?void 0:o.apply(this,arguments)};const n=LGraphCanvas.onGroupAdd;LGraphCanvas.onGroupAdd=function(){return t.update(),null==n?void 0:n.apply(this,arguments)};const i=LGraphCanvas.onGroupAlign;LGraphCanvas.onGroupAlign=function(e){return t.update(),null==i?void 0:i.apply(this,arguments)};const a=LGraphCanvas.onMenuNodeRemove;LGraphCanvas.onMenuNodeRemove=function(e){return t.update(),null==a?void 0:a.apply(this,arguments)}},unwatchGraph(){this.isWatching=!1},async getAglTranslation(){this.aglTranslation=await(async()=>{let e=new FormData;e.append("locale",Ee);const t=await ee.fetchApi("/agl/get_translation",{method:"POST",body:e});if(200==t.status){const e=await t.json();return e&&"{}"!=e?{nodeCategory:e.NodeCategory,nodes:e.Nodes}:null}return null})()}}});let Te=null;const De=["custom_obsidian","custom_obsidian_dark","custom_milk_white"],Oe={"easy positive":"green","easy negative":"red","easy promptList":"cyan","easy promptLine":"cyan","easy promptConcat":"cyan","easy promptReplace":"cyan","easy textSwitch":"pale_blue"};let Re=LGraphCanvas.node_colors,Me=null,Ge=null,Pe=null,Be=null;for(let Ko in Le)Fe=Le[Ko],$.ui.settings.addSetting(Fe);var Fe;function Ue(e,t=!1){let s="after",o="before";t&&([o,s]=[s,o]),e.label=(e.label??e.name).replace(o,s),e.name=e.label}function ze(e,t,s,o,n,i,a){t.strokeStyle=o,t.fillStyle=n;let l=LiteGraph.NODE_TITLE_HEIGHT,r=this.ds.scale<.5,d=e._shape||e.constructor.shape||LiteGraph.ROUND_SHAPE,u=e.constructor.title_mode,c=!0;u==LiteGraph.TRANSPARENT_TITLE||u==LiteGraph.NO_TITLE?c=!1:u==LiteGraph.AUTOHIDE_TITLE&&mouse_over&&(c=!0);let p=new Float32Array(4);p=[0,c?-l:0,s[0]+1,c?s[1]+l:s[1]];let h=t.globalAlpha;if(t.lineWidth=1,t.beginPath(),d==LiteGraph.BOX_SHAPE||r?t.fillRect(p[0],p[1],p[2],p[3]):d==LiteGraph.ROUND_SHAPE||d==LiteGraph.CARD_SHAPE?t.roundRect(p[0],p[1],p[2],p[3],d==LiteGraph.CARD_SHAPE?[this.round_radius,this.round_radius,0,0]:[this.round_radius]):d==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*s[0],.5*s[1],.5*s[0],0,2*Math.PI),t.strokeStyle=LiteGraph.WIDGET_OUTLINE_COLOR,t.stroke(),t.strokeStyle=o,t.fill(),!e.flags.collapsed&&c&&(t.shadowColor="transparent",t.fillStyle="rgba(0,0,0,0.2)",t.fillRect(0,-1,p[2],2)),t.shadowColor="transparent",e.onDrawBackground&&e.onDrawBackground(t,this,this.canvas,this.graph_mouse),c||u==LiteGraph.TRANSPARENT_TITLE){const n="dark"==function(e){let t=e.replace("#","");return s=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),n=parseInt(t.substring(4,6),16),.299*s+.587*o+.114*n>127.5?"light":"dark";var s,o,n}((null==e?void 0:e.color)||"#ffffff");if(e.onDrawTitleBar)e.onDrawTitleBar(t,l,s,this.ds.scale,o);else if(u!=LiteGraph.TRANSPARENT_TITLE&&(e.constructor.title_color||this.render_title_colored)){let n=e.constructor.title_color||o;if(e.flags.collapsed&&(t.shadowColor=LiteGraph.DEFAULT_SHADOW_COLOR),this.use_gradients){let e=LGraphCanvas.gradients[n];e||(e=LGraphCanvas.gradients[n]=t.createLinearGradient(0,0,400,0),e.addColorStop(0,n),e.addColorStop(1,"#000")),t.fillStyle=e}else t.fillStyle=n;t.beginPath(),d==LiteGraph.BOX_SHAPE||r?t.rect(0,-l,s[0]+1,l):d!=LiteGraph.ROUND_SHAPE&&d!=LiteGraph.CARD_SHAPE||t.roundRect(0,-l,s[0]+1,l,e.flags.collapsed?[this.round_radius]:[this.round_radius,this.round_radius,0,0]),t.fill(),t.shadowColor="transparent"}let a=!1;LiteGraph.node_box_coloured_by_mode&&LiteGraph.NODE_MODES_COLORS[e.mode]&&(a=LiteGraph.NODE_MODES_COLORS[e.mode]),LiteGraph.node_box_coloured_when_on&&(a=e.action_triggered?"#FFF":e.execute_triggered?"#AAA":a);let c=10;if(e.onDrawTitleBox)e.onDrawTitleBox(t,l,s,this.ds.scale);else if(d==LiteGraph.ROUND_SHAPE||d==LiteGraph.CIRCLE_SHAPE||d==LiteGraph.CARD_SHAPE){const s=n?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR,o=n?"#eeeeee":e.boxcolor||a||LiteGraph.NODE_DEFAULT_BOXCOLOR;t.fillStyle=i?s:o,t.beginPath(),t.fillRect(10,0-1.05*c-1,1.1*c,.125*c),t.fillRect(10,0-1.45*c-1,1.1*c,.125*c),t.fillRect(10,0-1.85*c-1,1.1*c,.125*c)}else t.fillStyle=e.boxcolor||a||LiteGraph.NODE_DEFAULT_BOXCOLOR,t.fillRect(.5*(l-c),-.5*(l+c),c,c);if(t.globalAlpha=h,e.onDrawTitleText&&e.onDrawTitleText(t,l,s,this.ds.scale,this.title_text_font,i),!r){t.font=this.title_text_font;let s=String(e.getTitle());s&&(t.fillStyle=i?n?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR:n?"#ffffff":e.constructor.title_text_color||this.node_title_color,e.flags.collapsed?(t.textAlign="left",t.measureText(s),t.fillText(s.substr(0,20),l,LiteGraph.NODE_TITLE_TEXT_Y-l),t.textAlign="left"):(t.textAlign="left",t.fillText(s,l,LiteGraph.NODE_TITLE_TEXT_Y-l)))}if(!e.flags.collapsed&&e.subgraph&&!e.skip_subgraph_button){let s=LiteGraph.NODE_TITLE_HEIGHT,o=e.size[0]-s,n=LiteGraph.isInsideRectangle(this.graph_mouse[0]-e.pos[0],this.graph_mouse[1]-e.pos[1],o+2,2-s,s-4,s-4);t.fillStyle=n?"#888":"#555",d==LiteGraph.BOX_SHAPE||r?t.fillRect(o+2,2-s,s-4,s-4):(t.beginPath(),t.roundRect(o+2,2-s,s-4,s-4,[4]),t.fill()),t.fillStyle="#333",t.beginPath(),t.moveTo(o+.2*s,.6*-s),t.lineTo(o+.8*s,.6*-s),t.lineTo(o+.5*s,.3*-s),t.fill()}e.onDrawTitle&&e.onDrawTitle(t)}if(i){e.onBounding&&e.onBounding(p),u==LiteGraph.TRANSPARENT_TITLE&&(p[1]-=l,p[3]+=l),t.lineWidth=2,t.globalAlpha=.8,t.beginPath();let n=0,i=0,a=1;d==LiteGraph.BOX_SHAPE?t.rect(n+p[0],n+p[1],i+p[2],i+p[3]):d==LiteGraph.ROUND_SHAPE||d==LiteGraph.CARD_SHAPE&&e.flags.collapsed?t.roundRect(n+p[0],n+p[1],i+p[2],i+p[3],[this.round_radius*a]):d==LiteGraph.CARD_SHAPE?t.roundRect(n+p[0],n+p[1],i+p[2],i+p[3],[this.round_radius*a,a,this.round_radius*a,a]):d==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*s[0],.5*s[1],.5*s[0]+6,0,2*Math.PI),t.strokeStyle=LiteGraph.NODE_BOX_OUTLINE_COLOR,t.stroke(),t.strokeStyle=o,t.globalAlpha=1}e.execute_triggered>0&&e.execute_triggered--,e.action_triggered>0&&e.action_triggered--}function je(e,t,s,o){if(!e.widgets||!e.widgets.length)return 0;let n=e.size[0],i=e.widgets;t+=2;let a=LiteGraph.NODE_WIDGET_HEIGHT,l=this.ds.scale>.5;s.save(),s.globalAlpha=this.editor_alpha;let r=LiteGraph.WIDGET_OUTLINE_COLOR,d=LiteGraph.WIDGET_BGCOLOR,u=LiteGraph.WIDGET_TEXT_COLOR,c=LiteGraph.WIDGET_SECONDARY_TEXT_COLOR,p=12;for(let h=0;h1&&(n=1),s.fillStyle=m.options.hasOwnProperty("slider_color")?m.options.slider_color:o==m?r:pe,s.beginPath(),s.roundRect(p,g,n*(f-24),a,[.25*a]),s.fill(),m.marker){let e=(m.marker-m.options.min)/t;e<0&&(e=0),e>1&&(e=1),s.fillStyle=m.options.hasOwnProperty("marker_color")?m.options.marker_color:"#AA9",s.roundRect(p+e*(f-24),g,2,a,[.25*a])}if(l){s.textAlign="center",s.fillStyle=u;let e=(m.label||m.name)+": "+Number(m.value).toFixed(null!=m.options.precision?m.options.precision:3).toString();s.fillText(e,.5*f,g+.7*a)}break;case"number":case"combo":if(s.textAlign="left",s.strokeStyle=r,s.fillStyle=d,s.beginPath(),l?s.roundRect(p,g,f-24,a,[.25*a]):s.rect(p,g,f-24,a),s.fill(),l){m.disabled||s.stroke(),s.fillStyle=u,m.disabled||(s.beginPath(),s.moveTo(24,g+6.5),s.lineTo(18,g+.5*a),s.lineTo(24,g+a-6.5),s.fill(),s.beginPath(),s.moveTo(f-p-12,g+6.5),s.lineTo(f-p-6,g+.5*a),s.lineTo(f-p-12,g+a-6.5),s.fill()),s.fillStyle=c,s.font="10px Inter",s.fillText(m.label||m.name,29,g+.7*a),s.fillStyle=u,s.textAlign="right";let e=6;if("number"==m.type)s.font="10px Inter",s.fillText(Number(m.value).toFixed(void 0!==m.options.precision?m.options.precision:3),f-24-e,g+.7*a);else{let t=m.value;if(m.options.values){let e=m.options.values;e.constructor===Function&&(e=e()),e&&e.constructor!==Array&&(t=e[m.value])}s.fillText(t,f-24-e,g+.7*a)}}break;case"string":case"text":if(s.textAlign="left",s.strokeStyle=r,s.fillStyle=d,s.beginPath(),l?s.roundRect(p,g,f-24,a,[.25*a]):s.rect(p,g,f-24,a),s.fill(),l){m.disabled||s.stroke(),s.save(),s.beginPath(),s.rect(p,g,f-24,a),s.clip(),s.fillStyle=c;const e=m.label||m.name;s.font="10px Inter",null!=e&&s.fillText(e,24,g+.7*a),s.fillStyle=u,s.textAlign="right",s.fillText(String(m.value).substr(0,30),f-24,g+.7*a),s.restore()}break;default:m.draw&&m.draw(s,e,f,g,a)}t+=(m.computeSize?m.computeSize(f)[1]:a)+4,s.globalAlpha=this.editor_alpha}s.restore(),s.textAlign="left"}function He(e,t,s,o,n){return new LiteGraph.ContextMenu(LiteGraph.NODE_MODES,{event:s,callback:function(e){if(!n)return;var t=Object.values(LiteGraph.NODE_MODES).indexOf(e),s=function(e){t>=0&&LiteGraph.NODE_MODES[t]?e.changeMode(t):e.changeMode(LiteGraph.ALWAYS),Te||(Te=Ne()),Te.update()},o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)s(n);else for(var i in o.selected_nodes)s(o.selected_nodes[i])},parentMenu:o,node:n}),!1}function We(e,t,s,o,n){if(!n)throw"no node for color";var i=[];for(var a in i.push({value:null,content:"No color"}),LGraphCanvas.node_colors){var l=LGraphCanvas.node_colors[a];e={value:a,content:""+a+""};i.push(e)}return new LiteGraph.ContextMenu(i,{event:s,callback:function(e){if(!n)return;var t=e.value?LGraphCanvas.node_colors[e.value]:null,s=function(e){t?e.constructor===LiteGraph.LGraphGroup?e.color=t.groupcolor:(e.color=t.color,e.bgcolor=t.bgcolor):(delete e.color,delete e.bgcolor),Te||(Te=Ne()),Te.update()},o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)s(n);else for(var i in o.selected_nodes)s(o.selected_nodes[i]);n.setDirtyCanvas(!0,!0)},parentMenu:o,node:n}),!1}function Ye(e,t,s,o,n){var i=e.property||"title",a=n[i],l=document.createElement("div");l.is_modified=!1,l.className="graphdialog",l.innerHTML="",l.close=function(){l.parentNode&&l.parentNode.removeChild(l)},l.querySelector(".name").innerText=i;var r=l.querySelector(".value");r&&(r.value=a,r.addEventListener("blur",(function(e){this.focus()})),r.addEventListener("keydown",(function(e){if(l.is_modified=!0,27==e.keyCode)l.close();else if(13==e.keyCode)m();else if(13!=e.keyCode&&"textarea"!=e.target.localName)return;e.preventDefault(),e.stopPropagation()})));var d=LGraphCanvas.active_canvas.canvas,u=d.getBoundingClientRect(),c=-20,p=-20;u&&(c-=u.left,p-=u.top),event?(l.style.left=event.clientX+c+"px",l.style.top=event.clientY+p+"px"):(l.style.left=.5*d.width+c+"px",l.style.top=.5*d.height+p+"px"),l.querySelector("button").addEventListener("click",m),d.parentNode.appendChild(l),r&&r.focus();var h=null;function m(){r&&function(t){"Number"==e.type?t=Number(t):"Boolean"==e.type&&(t=Boolean(t));n[i]=t,l.parentNode&&l.parentNode.removeChild(l);n.setDirtyCanvas(!0,!0),Te||(Te=Ne());Te.update()}(r.value)}l.addEventListener("mouseleave",(function(e){LiteGraph.dialog_close_on_mouse_leave&&!l.is_modified&&LiteGraph.dialog_close_on_mouse_leave&&(h=setTimeout(l.close,LiteGraph.dialog_close_on_mouse_leave_delay))})),l.addEventListener("mouseenter",(function(e){LiteGraph.dialog_close_on_mouse_leave&&h&&clearTimeout(h)}))}$.registerExtension({name:"Comfy.EasyUse.UI",init(){var e,t;const s="Comfy.CustomColorPalettes",o="Comfy.Settings.Comfy.CustomColorPalettes";if(Ge||(Ge=le(s,o)),Pe||(Pe=le("Comfy.ColorPalette","Comfy.Settings.Comfy.ColorPalette")||"dark"),(!(null==(e=null==Ge?void 0:Ge.obsidian)?void 0:e.version)||Ge.obsidian.version<_e.ColorPalette.version)&&(Ge.obsidian=_e.ColorPalette,Ge.obsidian_dark=we.ColorPalette,re(s,Ge,o)),(!(null==(t=null==Ge?void 0:Ge.milk_white)?void 0:t.version)||Ge.milk_white.version{(null==e?void 0:e.value)&&(null==e?void 0:e.oldValue)&&(await ke(1),Object.assign($.canvas.default_connection_color_byType,he),Object.assign(LGraphCanvas.link_type_colors,he)),"custom_milk_white"==e.value&&document.body.classList.remove(ce)})),setTimeout((e=>Ze(le("Comfy.UseNewMenu")||"Disabled")),1)},async nodeCreated(e){var t;if(Oe.hasOwnProperty(e.comfyClass)){const t=Oe[e.comfyClass],s=Re[t];if(!s)return;s.color&&(e.color=s.color),s.bgcolor&&(e.bgcolor=s.bgcolor)}if(Me||(Me=le("Comfy.WidgetControlMode")),"before"==Me){const s="before"==Me;if((null==(t=e.widgets)?void 0:t.length)>0)for(const t of e.widgets)if(["control_before_generate","control_after_generate"].includes(t.name)&&(await Ue(t,s),t.linkedWidgets))for(const e of t.linkedWidgets)await Ue(e,s)}}});const Ve=null==(m=$.ui.settings.settingsLookup)?void 0:m["Comfy.UseNewMenu"];Ve&&(Ve.onChange=e=>Ze(e));const Ze=e=>{var t;const s=(null==(t=document.getElementById("crystools-root"))?void 0:t.children)||null;if((null==s?void 0:s.length)>0){if(!Be)for(let e=0;ee.widgets.find((e=>e.name===t)),Ke=(e,t,s=!1,o="")=>{var n;if(!t||((e,t)=>!!e.inputs&&e.inputs.some((e=>e.name===t)))(e,t.name))return;Xe[t.name]||(Xe[t.name]={origType:t.type,origComputeSize:t.computeSize});const i=e.size;t.type=s?Xe[t.name].origType:"easyHidden"+o,t.computeSize=s?Xe[t.name].origComputeSize:()=>[0,-4],null==(n=t.linkedWidgets)||n.forEach((o=>Ke(e,o,":"+t.name,s)));const a=s?Math.max(e.computeSize()[1],i[1]):e.size[1];e.setSize([e.size[0],a])},Je=(e,t=0)=>{var s,o;if(e)return(null==(s=e.widgets)?void 0:s[t])?e.widgets[t].value:e.widgets_values?null==(o=e.widgets_values)?void 0:o[t]:void 0},qe=e=>e.setSize([e.size[0],e.computeSize()[1]]),$e=(e,t)=>graph.getNodeById(e),et=e=>{var t;try{return Object.values(null==(t=null==graph?void 0:graph.list_of_graphcanvas[0])?void 0:t.selected_nodes)}catch(s){return[]}};function tt(e,t,s){return e+(o=s,(.5-.5*Math.cos(Math.PI*o))*(t-e));var o}const st=(e,t=!0)=>{var s,o;const n=(null==(o=null==(s=e.graph)?void 0:s.list_of_graphcanvas)?void 0:o[0])||null;if(!n)return;const[i,a]=e.pos,[l,r]=e.size;(([e,t],s)=>{const o=s.ds,n=document.body.clientWidth,i=document.body.clientHeight,a=o.scale,l=.5*n/a-e,r=.5*i/a-t,d=Date.now()+250,u=o.offset[0],c=o.offset[1],p=()=>{const e=d-Date.now();if(!(Date.now(){const t=$e(e);t&&st(t)},nt=(e,t=(()=>graph.links??[])())=>t[e],it=e=>e.toLowerCase().replace(/_./g,(e=>e.replace("_","").toUpperCase())),at=e=>"easy getNode"===e.type,lt=e=>"easy setNode"===e.type,rt=e=>at(e)||lt(e),dt=(e=(()=>graph._nodes??[])())=>e.filter((e=>rt(e))),ut=(e,t,s=0)=>{e.widgets_values||(e.widgets_values=[]),e.widgets_values[s]=t,e.widgets[s].value=t},ct=e=>graph.add(e),pt=e=>graph.remove(e),ht=(e,t=0)=>{var s,o;if("Reroute"!==e.type)return[e,t];const n=e,i=null==(o=null==(s=n.inputs)?void 0:s[0])?void 0:o.link;if(!i)return[n,t];const a=nt(i);if(!a)return[n,t];const l=$e(a.origin_id);return l?(setTimeout((()=>{pt(n)})),ht(l,a.origin_slot)):[n,t]},mt=e=>{var t,s,o;if("Reroute"!==e.type)return e;const n=e,i=null==(s=null==(t=n.outputs)?void 0:t[0])?void 0:s.links;if(!i)return n;const a=i[0];if(!a)return n;const l=nt(a);if(!l)return n;const r=$e(l.target_id);return r?(1===(null==(o=n.outputs[0].links)?void 0:o.length)&&setTimeout((()=>{pt(n)})),mt(r)):n},gt=["rescale_after_model","rescale","lora_name","upscale_method","image_output","add_noise","info","sampler_name","ckpt_B_name","ckpt_C_name","save_model","refiner_ckpt_name","num_loras","num_controlnet","mode","toggle","resolution","ratio","target_parameter","input_count","replace_count","downscale_mode","range_mode","text_combine_mode","input_mode","lora_count","ckpt_count","conditioning_mode","preset","use_tiled","use_batch","num_embeds","easing_mode","guider","scheduler","inpaint_mode","t5_type","rem_mode"],ft=["LIGHT - SD1.5 only (low strength)","STANDARD (medium strength)","VIT-G (medium strength)","PLUS (high strength)","PLUS FACE (portraits)","FULL FACE - SD1.5 only (portraits stronger)"],yt=["FACEID","FACEID PLUS - SD1.5 only","FACEID PLUS V2","FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"],vt=["easy seed","easy latentNoisy","easy wildcards","easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingSdTurbo","easy preSamplingCascade","easy preSamplingDynamicCFG","easy preSamplingLayerDiffusion","easy fullkSampler","easy fullCascadeKSampler"],_t=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy hyditLoader","easy pixArtLoader"],wt=["easy imageSize","easy imageSizeBySide","easy imageSizeByLongerSide","easy imageSizeShow","easy imageRatio","easy imagePixelPerfect"];function bt(e,t){const s=e.comfyClass,o=t.value;switch(t.name){case"range_mode":Ke(e,Qe(e,"step"),"step"==o),Ke(e,Qe(e,"num_steps"),"num_steps"==o),qe(e);break;case"text_combine_mode":Ke(e,Qe(e,"replace_text"),"replace"==o);break;case"lora_name":["lora_model_strength","lora_clip_strength"].map((t=>Ke(e,Qe(e,t),"None"!==o)));break;case"resolution":"自定义 x 自定义"===o&&(t.value="width x height (custom)"),["empty_latent_width","empty_latent_height"].map((t=>Ke(e,Qe(e,t),"width x height (custom)"===o)));break;case"ratio":["empty_latent_width","empty_latent_height"].map((t=>Ke(e,Qe(e,t),"custom"===o)));break;case"num_loras":var n=o+1,i=Qe(e,"mode").value;for(let t=0;tKe(e,Qe(e,t),"simple"!==i)));for(let t=n;t<21;t++)["lora_"+t+"_name","lora_"+t+"_strength","lora_"+t+"_model_strength","lora_"+t+"_clip_strength"].map((t=>Ke(e,Qe(e,t),!1)));qe(e);break;case"num_controlnet":n=o+1,i=Qe(e,"mode").value;for(let t=0;tKe(e,Qe(e,t),!0))),["start_percent_"+t,"end_percent_"+t].map((t=>Ke(e,Qe(e,t),"simple"!==i)));for(let t=n;t<21;t++)["controlnet_"+t,"controlnet_"+t+"_strength","scale_soft_weight_"+t,"start_percent_"+t,"end_percent_"+t].map((t=>Ke(e,Qe(e,t),!1)));qe(e);break;case"mode":switch(null==e?void 0:e.comfyClass){case"easy loraStack":n=Qe(e,"num_loras").value+1,i=o;for(let t=0;tKe(e,Qe(e,t),"simple"!==i)));qe(e);break;case"easy controlnetStack":n=Qe(e,"num_controlnet").value+1,i=o;for(let t=0;tKe(e,Qe(e,t),"simple"!==i)));qe(e);break;case"easy icLightApply":i=o;["lighting","remove_bg"].map((t=>Ke(e,Qe(e,t),"Foreground"===i))),Ke(e,Qe(e,"source"),"Foreground"!==i),qe(e)}break;case"toggle":t.type="toggle",t.options={on:"Enabled",off:"Disabled"};break;case"t5_type":["clip_name","padding"].map((t=>Ke(e,Qe(e,t),"sd3"==o))),["t5_name","device","dtype"].map((t=>Ke(e,Qe(e,t),"t5v11"==o))),qe(e);break;case"preset":if(ft.includes(o)){let t=Qe(e,"use_tiled");Ke(e,Qe(e,"lora_strength")),Ke(e,Qe(e,"provider")),Ke(e,Qe(e,"weight_faceidv2")),Ke(e,Qe(e,"weight_kolors")),Ke(e,Qe(e,"use_tiled"),!0),Ke(e,Qe(e,"sharpening"),t&&t.value)}else yt.includes(o)&&(Ke(e,Qe(e,"weight_faceidv2"),!!["FACEID PLUS V2","FACEID PLUS KOLORS"].includes(o)),Ke(e,Qe(e,"weight_kolors"),!!["FACEID PLUS KOLORS"].includes(t.value)),["FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"].includes(o)?Ke(e,Qe(e,"lora_strength"),!1):Ke(e,Qe(e,"lora_strength"),!0),Ke(e,Qe(e,"provider"),!0),Ke(e,Qe(e,"use_tiled")),Ke(e,Qe(e,"sharpening")));qe(e);break;case"use_tiled":Ke(e,Qe(e,"sharpening"),!!o),qe(e);break;case"num_embeds":n=o+1;for(let t=0;tKe(e,Qe(e,t),!1)));break;case"brushnet_random":case"brushnet_segmentation":["dtype","scale","start_at","end_at"].map((t=>Ke(e,Qe(e,t),!0))),["fitting","function"].map((t=>Ke(e,Qe(e,t),!1)));break;case"powerpaint":["dtype","fitting","function","scale","start_at","end_at"].map((t=>Ke(e,Qe(e,t),!0)))}qe(e);break;case"image_output":Ke(e,Qe(e,"link_id"),!!["Sender","Sender&Save"].includes(o)),Ke(e,Qe(e,"decode_vae_name"),!!["Hide","Hide&Save"].includes(o)),["save_prefix","output_path","embed_workflow","number_padding","overwrite_existing"].map((t=>Ke(e,Qe(e,t),!!["Save","Hide&Save","Sender&Save"].includes(o))));break;case"add_noise":var a=Qe(e,"control_before_generate"),l=Qe(e,"control_after_generate")||a;"disable"===o?(Ke(e,Qe(e,"seed")),l&&(l.last_value=l.value,l.value="fixed",Ke(e,l))):(Ke(e,Qe(e,"seed"),!0),l&&((null==l?void 0:l.last_value)&&(l.value=l.last_value),Ke(e,l,!0))),qe(e);break;case"guider":switch(o){case"Basic":["cfg","cfg_negative"].map((t=>Ke(e,Qe(e,t))));break;case"CFG":Ke(e,Qe(e,"cfg"),!0),Ke(e,Qe(e,"cfg_negative"));break;case"IP2P+DualCFG":case"DualCFG":["cfg","cfg_negative"].map((t=>Ke(e,Qe(e,t),!0)))}qe(e);break;case"scheduler":["karrasADV","exponentialADV","polyExponential"].includes(o)?(["sigma_max","sigma_min"].map((t=>Ke(e,Qe(e,t),!0))),["denoise","beta_d","beta_min","eps_s","coeff"].map((t=>Ke(e,Qe(e,t))),!1),Ke(e,Qe(e,"rho"),"exponentialADV"!=o)):"vp"==o?(["sigma_max","sigma_min","denoise","rho","coeff"].map((t=>Ke(e,Qe(e,t)))),["beta_d","beta_min","eps_s"].map((t=>Ke(e,Qe(e,t),!0)))):(["sigma_max","sigma_min","beta_d","beta_min","eps_s","rho"].map((t=>Ke(e,Qe(e,t)))),Ke(e,Qe(e,"coeff"),"gits"==o),Ke(e,Qe(e,"denoise"),!0)),qe(e);break;case"conditioning_mode":["replace","concat","combine"].includes(o)?["average_strength","old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Ke(e,Qe(e,t)))):"average"==o?(Ke(e,Qe(e,"average_strength"),!0),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Ke(e,Qe(e,t),!1)))):"timestep"==o&&(["average_strength"].map((t=>Ke(e,Qe(e,t),!1))),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Ke(e,Qe(e,t)))));break;case"rescale":Qe(e,"rescale_after_model").value,Ke(e,Qe(e,"width"),"to Width/Height"===o),Ke(e,Qe(e,"height"),"to Width/Height"===o),Ke(e,Qe(e,"percent"),"by percentage"===o),Ke(e,Qe(e,"longer_side"),"to longer side - maintain aspect"===o),qe(e);break;case"upscale_method":["factor","crop"].map((t=>Ke(e,Qe(e,t),"None"!==o)));break;case"target_parameter":switch(s){case"easy XYInputs: Steps":["first_step","last_step"].map((t=>Ke(e,Qe(e,t),"steps"==o))),["first_start_step","last_start_step"].map((t=>Ke(e,Qe(e,t),"start_at_step"==o))),["first_end_step","last_end_step"].map((t=>Ke(e,Qe(e,t),"end_at_step"==o)));break;case"easy XYInputs: Sampler/Scheduler":let t=Qe(e,"input_count").value+1;for(let s=0;sKe(e,Qe(e,t),"strength"==o))),["first_start_percent","last_start_percent"].map((t=>Ke(e,Qe(e,t),"start_percent"==o))),["first_end_percent","last_end_percent"].map((t=>Ke(e,Qe(e,t),"end_percent"==o))),["strength","start_percent","end_percent"].map((t=>Ke(e,Qe(e,t),o!=t))),qe(e)}case"replace_count":n=o+1;for(let t=0;tKe(e,Qe(e,t),!r)));for(let t=n;t<11;t++)["lora_name_"+t,"model_str_"+t,"clip_str_"+t].map((t=>Ke(e,Qe(e,t),!1)));qe(e);break;case"ckpt_count":n=o+1;var d=-1!=Qe(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=Qe(e,"input_mode").value.indexOf("VAE");for(let t=0;tKe(e,Qe(e,t),!1)));qe(e);break;case"input_count":n=o+1;var c=Qe(e,"target_parameter").value;for(let t=0;tKe(e,Qe(e,s),!t)));["model_strength","clip_strength"].map((s=>Ke(e,Qe(e,s),!t)));break;case"easy XYInputs: Checkpoint":n=Qe(e,"ckpt_count").value+1,d=-1!=Qe(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=Qe(e,"input_mode").value.indexOf("VAE");for(let s=0;se.name===t));if(-1!==e){for(let t=e;t{var e;const t=this.computeSize();t[0]"info"===e.name));if(-1!==e&&this.widgets[e]){this.widgets[e].value=t}}requestAnimationFrame((()=>{var e;const t=this.computeSize();t[0]"prompt"==e.name));this.addWidget("button","get values from COMBO link","",(()=>{var t,o;const n=(null==(o=null==(t=this.outputs[1])?void 0:t.links)?void 0:o.length)>0?this.outputs[1].links[0]:null,i=s.graph._nodes.find((e=>{var t;return null==(t=e.inputs)?void 0:t.find((e=>e.link==n))}));if(n&&i){const t=i.inputs.find((e=>e.link==n)).widget.name,s=i.widgets.find((e=>e.name==t));let o=(null==s?void 0:s.options.values)||null;o&&(o=o.join("\n"),e.value=o)}else xe.error(Ce("No COMBO link"),3e3)}),{serialize:!1})}),_t.includes(t.name)){let t=function(e){var t="";for(let s=0;se.name===t+"_prompt")),o="comfy-multiline-input wildcard_"+t+"_"+this.id.toString();if(-1==s&&e){const s=document.createElement("textarea");s.className=o,s.placeholder="Wildcard Prompt ("+t+")";const n=this.addDOMWidget(t+"_prompt","customtext",s,{getValue:e=>s.value,setValue(e){s.value=e},serialize:!1});n.inputEl=s,n.inputEl.readOnly=!0,s.addEventListener("input",(()=>{var e;null==(e=n.callback)||e.call(n,n.value)})),n.value=e}else if(this.widgets[s])if(e){this.widgets[s].value=e}else{this.widgets.splice(s,1);const e=document.getElementsByClassName(o);e&&e[0]&&e[0].remove()}}};e.prototype.onExecuted=function(e){null==l||l.apply(this,arguments);const o=t(e.positive),n=t(e.negative);s.call(this,o,"positive"),s.call(this,n,"negative")}}if(["easy sv3dLoader"].includes(t.name)){let t=function(e,t,s){switch(e){case"azimuth":return s.readOnly=!0,s.style.opacity=.6,"0:(0.0,0.0)"+(t>1?`\n${t-1}:(360.0,0.0)`:"");case"elevation":return s.readOnly=!0,s.style.opacity=.6,"0:(-90.0,0.0)"+(t>1?`\n${t-1}:(90.0,0.0)`:"");case"custom":return s.readOnly=!1,s.style.opacity=1,"0:(0.0,0.0)\n9:(180.0,0.0)\n20:(360.0,0.0)"}};e.prototype.onNodeCreated=async function(){i&&i.apply(this,[]);const e=this.widgets.find((e=>"easing_mode"==e.name)),s=this.widgets.find((e=>"batch_size"==e.name)),o=this.widgets.find((e=>"scheduler"==e.name));setTimeout((n=>{o.value||(o.value=t(e.value,s.value,o.inputEl))}),1),e.callback=e=>{o.value=t(e,s.value,o.inputEl)},s.callback=s=>{o.value=t(e.value,s,o.inputEl)}}}if(vt.includes(o)&&(e.prototype.onNodeCreated=async function(){i&&i.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),o=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));if("easy seed"==t.name){const t=this.addWidget("button","🎲 Manual Random Seed",null,(t=>{"fixed"!=o.value&&(o.value="fixed"),e.value=Math.floor(Math.random()*me),s.queuePrompt(0,1)}),{serialize:!1});e.linkedWidgets=[t,o]}},e.prototype.onAdded=async function(){n&&n.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),t=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));setTimeout((s=>{"control_before_generate"==t.name&&0===e.value&&(e.value=Math.floor(Math.random()*me))}),1)}),"easy convertAnything"==o&&(e.prototype.onNodeCreated=async function(){i&&i.apply(this,[]);const e=this.widgets.find((e=>"output_type"==e.name)),t=t=>{this.outputs[0].type=e.value.toUpperCase(),this.outputs[0].name=e.value,this.outputs[0].label=e.value};setTimeout((e=>t()),10),e.callback=e=>t()}),"easy imageInsetCrop"==o){let t=function(e){const t=e.widgets[0];for(let s=1;s<=4;s++)"Pixels"===t.value?(e.widgets[s].options.step=80,e.widgets[s].options.max=8192):(e.widgets[s].options.step=10,e.widgets[s].options.max=99)};e.prototype.onAdded=async function(e){const s=this.widgets[0];let o=s.callback;s.callback=(...e)=>{t(this),o&&o.apply(s,[...e])},setTimeout((e=>{t(this)}),1)}}},nodeCreated(e){if(e.comfyClass.startsWith("easy ")){if(e.widgets)for(const s of e.widgets){if(!gt.includes(s.name))continue;let t=s.value;bt(e,s),Object.defineProperty(s,"value",{get:e=>t,set(o){o!==t&&(t=o,bt(e,s))}})}const t=e.comfyClass;if("easy preDetailerFix"==t){const t=e.widgets.find((e=>"customtext"===e.type));if(!t)return;t.dynamicPrompts=!1,t.inputEl.placeholder="wildcard spec: if kept empty, this option will be ignored",t.serializeValue=()=>t.value}if("easy wildcards"==t){const t=e.widgets.find((e=>"text"==e.name));let s=1;Object.defineProperty(e.widgets[s],"value",{set:e=>{if((new Error).stack.includes("inner_value_change")&&"Select the LoRA to add to the text"!=e){let s=e;s.endsWith(".safetensors")&&(s=s.slice(0,-12)),t.value+=``}},get:e=>"Select the LoRA to add to the text"}),Object.defineProperty(e.widgets[s+1],"value",{set:e=>{(new Error).stack.includes("inner_value_change")&&"Select the Wildcard to add to the text"!=e&&(""!=t.value&&(t.value+=", "),t.value+=e)},get:e=>"Select the Wildcard to add to the text"}),e.widgets[s].serializeValue=e=>"Select the LoRA to add to the text",e.widgets[s+1].serializeValue=e=>"Select the Wildcard to add to the text"}if(wt.includes(t)){const t=document.createElement("textarea");t.className="comfy-multiline-input",t.readOnly=!0;const s=e.addDOMWidget("info","customtext",t,{getValue:e=>t.value,setValue:e=>t.value=e,serialize:!1});s.inputEl=t,t.addEventListener("input",(()=>{var e;null==(e=s.callback)||e.call(s,s.value)}))}}}}),$.registerExtension({name:"easy bookmark",registerCustomNodes(){class e{constructor(){y(this,"type","easy bookmark"),y(this,"title","🔖"),y(this,"slot_start_y",-20),y(this,"___collapsed_width",0),y(this,"isVirtualNode",!0),y(this,"serialize_widgets",!0),y(this,"keypressBound",null),this.addWidget("text","shortcut_key","1",(e=>{""!==(e=e.trim()[0]||"1")&&(this.title="🔖 "+e)}),{y:8}),this.addWidget("number","zoom",1,(e=>{}),{y:8+LiteGraph.NODE_WIDGET_HEIGHT+4,max:2,min:.5,precision:2}),this.keypressBound=this.onKeypress.bind(this)}get _collapsed_width(){return this.___collapsed_width}set _collapsed_width(e){const t=$.canvas,s=t.canvas.getContext("2d");if(s){const e=s.font;s.font=t.title_text_font,this.___collapsed_width=40+s.measureText(this.title).width,s.font=e}}onAdded(){setTimeout((e=>{const t=this.widgets[0].value;t&&(this.title="🔖 "+t)}),1),window.addEventListener("keydown",this.keypressBound)}onRemoved(){window.removeEventListener("keydown",this.keypressBound)}onKeypress(e){const t=e.target;["input","textarea"].includes(t.localName)||this.widgets[0]&&e.key.toLocaleLowerCase()===this.widgets[0].value.toLocaleLowerCase()&&this.canvasToBookmark()}canvasToBookmark(){var e,t;const s=$.canvas;(null==(e=null==s?void 0:s.ds)?void 0:e.offset)&&(s.ds.offset[0]=16-this.pos[0],s.ds.offset[1]=40-this.pos[1]),null!=(null==(t=null==s?void 0:s.ds)?void 0:t.scale)&&(s.ds.scale=Number(this.widgets[1].value||1)),s.setDirty(!0,!0)}}LiteGraph.registerNodeType("easy bookmark",Object.assign(e,{title:"Bookmark 🔖"})),e.category="EasyUse/Util"}}),$.registerExtension({name:"Comfy.EasyUse.ChainNode",init(){$.canvas._mousemove_callback=e=>{if(!le("EasyUse.Nodes.ChainGetSet",null,!0))return;((e,t=!1,s={})=>{var o,n,i,a,l;if(0===e.length)return;const r=s.inputX||160,d=s.ouputX||60;if(e.filter((e=>rt(e))).length>1)return;for(const c of e){let a=0,l=0;const u=s.inputY||10,p=s.outputY||30,h=[];if(c.graph){for(const e of c.inputs??[]){const t=e.link;if(!t)continue;const{origin_id:s,target_slot:o}=nt(t),n=$e(s);if(!n)continue;if(!rt(n))continue;const i=c.getConnectionPos(!0,o);n.pos=[i[0]-r,i[1]+15+a*u],a+=1,h.push(n),n.flags.collapsed=!0}for(const e of c.outputs??[])if(e.links&&c.graph)for(const t of e.links){const{target_id:e}=nt(t),s=$e(e);if(!s)continue;if(!rt(s))continue;const n=null==(o=s.outputs)?void 0:o.links;if((null==n?void 0:n.length)>1)return;const i=c.getConnectionPos(!1,0);s.pos=[i[0]+d,i[1]+15+l*p],l+=1,h.push(s),s.flags.collapsed=!0}if(t&&1===e.length){const e=[c,...h];(null==(i=null==(n=c.graph)?void 0:n.list_of_graphcanvas)?void 0:i[0]).selectNodes(e)}}}const u=e[0];if(!u)return;(null==(l=null==(a=u.graph)?void 0:a.list_of_graphcanvas)?void 0:l[0]).setDirty(!0,!0)})(et())};const e=LGraphCanvas.prototype.showLinkMenu;LGraphCanvas.prototype.showLinkMenu=function(t,s){return s.shiftKey?(((e,t=!1)=>{var s,o,n,i,a,l,r,d,u,c;const{type:p}=e;if("*"===p)return;let{origin_id:h,target_id:m,origin_slot:g,target_slot:f}=e,y=$e(h),v=$e(m);if(!y||!v)return!1;if("Reroute"===y.type){let e=0;[y,e]=ht(y),h=null==y?void 0:y.id,g=e,void 0!==g&&-1!==g||(g=0)}if("Reroute"===v.type&&(v=mt(v),m=null==v?void 0:v.id,f=null==v?void 0:v.inputs.findIndex((e=>e.type===p)),void 0!==f&&-1!==f||(f=0)),void 0===h||void 0===m||!y||!v)return!1;if(t&&(rt(y)||rt(v)))return!1;let _=it((null==(s=v.getInputInfo(f))?void 0:s.name)??p.toLowerCase());_||(_=it((null==(n=null==(o=null==y?void 0:y.outputs)?void 0:o[g])?void 0:n.name)??(null==(a=null==(i=null==y?void 0:y.outputs)?void 0:i[g])?void 0:a.type.toString())??_+`_from_${h}_to_${m}`));let w,b=!1,A=!1;if(rt(y))_=Je(y),A=!0;else{const e=null==(r=null==(l=y.outputs)?void 0:l[g])?void 0:r.links;if(e)for(const t of e){const e=$e((null==(d=nt(t))?void 0:d.target_id)??-1);e&&rt(e)&<(e)&&(_=Je(e),A=!0)}if(!A){for(const e of dt()){if(_!==Je(e)||!lt(e))continue;const t=null==(u=e.inputs[0])?void 0:u.link;(null==(c=nt(t))?void 0:c.origin_id)===y.id?A=!0:b=!0}b&&(_+=`_from_${h}_to_${m}`)}}if(!A){w=LiteGraph.createNode("easy setNode"),w.is_auto_link=!0;const e=y.getConnectionPos(!1,g);w.pos=[e[0]+20,e[1]],w.inputs[0].name=_,w.inputs[0].type=p,w.inputs[0].widget=v.inputs[f].widget,ut(w,_),ct(w),w.flags.collapsed=!0;let t=[];y.widgets?t=Object.values(y.widgets).map((e=>e.value)):y.widgets_values&&(t=JSON.parse(JSON.stringify(y.widgets_values))),y.connect(g,w,0),y.widgets_values=t,"PrimitiveNode"===y.type&&setTimeout((()=>{if(y){y.connect(g,w,0);for(const[e,s]of t.entries())ut(y,s,e);null!==w&&w.setSize(w.computeSize())}}))}const S=LiteGraph.createNode("easy getNode"),E=v.getConnectionPos(!0,f);S.pos=[E[0]-150,E[1]],S.outputs[0].name=_,S.outputs[0].type=p,S.outputs[0].widget=v.inputs[f].widget,ct(S),ut(S,_),null===S||(S.flags.collapsed=!0,S.setSize(S.computeSize()),S.connect(0,v,f))})(t),!1):(e.apply(this,[t,s]),!1)}}});let At=[];function St(e,t,s,o,n){var i=LGraphCanvas.active_canvas,a=i.getCanvasWindow(),l=i.graph;if(l)return function e(t,o){var r=LiteGraph.getNodeTypesCategories(i.filter||l.filter).filter((function(e){return e.startsWith(t)})),d=[];r.map((function(s){if(s){var o=new RegExp("^("+t+")"),n=s.replace(o,"").split("/")[0],i=""===t?n+"/":t+n+"/",a=n;-1!=a.indexOf("::")&&(a=a.split("::")[1]),-1===d.findIndex((function(e){return e.value===i}))&&d.push({value:i,content:a,has_submenu:!0,callback:function(t,s,o,n){e(t.value,n)}})}})),LiteGraph.getNodeTypesInCategory(t.slice(0,-1),i.filter||l.filter).map((function(e){if(!e.skip_list){var t={value:e.type,content:e.title,has_submenu:!1,callback:function(e,t,s,o){var a=o.getFirstEvent();i.graph.beforeChange();var l=LiteGraph.createNode(e.value);l&&(l.pos=i.convertEventToCanvasOffset(a),i.graph.add(l)),n&&n(l),i.graph.afterChange()}};d.push(t)}}));const u=le("EasyUse.ContextMenu.NodesSort",null,!0);""===t&&u&&(d=function(e){let t=[],s=[];return e.forEach((e=>{(null==e?void 0:e.value)&&ge.includes(e.value.split("/")[0])?t.push(e):s.push(e)})),[{title:Ce("ComfyUI Basic"),is_category_title:!0},...t,{title:Ce("Others A~Z"),is_category_title:!0},...s.sort(((e,t)=>e.content.localeCompare(t.content)))]}(d)),new LiteGraph.ContextMenu(d,{event:s,parentMenu:o},a)}("",o),!1}$.registerExtension({name:"Comfy.EasyUse.ContextMenu",async setup(){LGraphCanvas.onMenuAdd=St;const e=le("EasyUse.ContextMenu.ModelsThumbnailsLimit",null,500),t=await ee.fetchApi(`/easyuse/models/thumbnail?limit=${e}`);if(200===t.status){let e=await t.json();At=e}else xe.error(Ce("Too many thumbnails, have closed the display"));const s=LiteGraph.ContextMenu;LiteGraph.ContextMenu=function(e,t){if(le("EasyUse.ContextMenu.SubDirectories",null,!1)&&(null==t?void 0:t.callback)&&!e.some((e=>"string"!=typeof e))){const o=function(e,t){const s=e,o=[...s],n={},i=[],a=[],l=["ckpt","pt","bin","pth","safetensors"];if((null==e?void 0:e.length)>0){const t=kt(e[e.length-1]);if(!l.includes(t))return null}for(const r of s){const e=r.indexOf("/")>-1?"/":"\\",t=r.split(e);if(t.length>1){const s=t.shift();n[s]=n[s]||[],n[s].push(t.join(e))}else"CHOOSE"===r||r.startsWith("DISABLE ")?i.push(r):a.push(r)}if(Object.values(n).length>0){const e=t.callback;t.callback=null;const s=(t,s)=>{["None","无","無","なし"].includes(t.content)?e("None",s):e(o.find((e=>e.endsWith(t.content)),s))},r=(e,t="")=>{const o=t?t+"\\"+Lt(e):Lt(e),n=kt(e),i=(new Date).getTime();let a,r="";if(l.includes(n))for(let s=0;s{let s=[],o=[];const i=e.map((e=>{const i={},a=e.indexOf("/")>-1?"/":"\\",l=e.split(a);if(l.length>1){const e=l.shift();i[e]=i[e]||[],i[e].push(l.join(a))}if(Object.values(n).length>0){let t=Object.keys(i)[0];t&&i[t]?s.push({key:t,value:i[t][0]}):o.push(r(e,t))}return r(e,t)}));if(s.length>0){let e={};return s.forEach((t=>{e[t.key]=e[t.key]||[],e[t.key].push(t.value)})),[...Object.entries(e).map((e=>({content:e[0],has_submenu:!0,callback:()=>{},submenu:{options:u(e[1],e[0])}}))),...o]}return i};for(const[t,o]of Object.entries(n))d.push({content:t,has_submenu:!0,callback:()=>{},submenu:{options:u(o,t)}});return d.push(...a.map((e=>r(e,"")))),i.length>0&&d.push(...i.map((e=>r(e,"")))),d}return null}(e,t);return o?s.call(this,o,t):s.apply(this,[...arguments])}return t.parentMenu||t.extra||t.scale||t.hasOwnProperty("extra")&&(e.unshift(null),o=window.location.host,["192.168.","10.","127.",/^172\.((1[6-9]|2[0-9]|3[0-1])\.)/].some((e=>"string"==typeof e?o.startsWith(e):e.test(o)))&&e.unshift({content:`${Ce("Reboot ComfyUI")}`,callback:e=>(async()=>{if(confirm(Ce("Are you sure you'd like to reboot the server?")))try{ee.fetchApi("/easyuse/reboot")}catch(e){}})()}),e.unshift({content:`${Ce("Cleanup Of VRAM Usage")}`,callback:e=>Ie()})),s.apply(this,[...arguments]);var o},LiteGraph.ContextMenu.prototype=s.prototype,le("EasyUse.ContextMenu.NodesSort",null,!0)&&(LiteGraph.ContextMenu.prototype.addItem=Ct)}});const Et=e=>e&&"object"==typeof e&&"image"in e&&e.content;function Ct(e,t,s){var o=this;s=s||{};var n=document.createElement("div");n.className="litemenu-entry submenu";var i,a=!1;function l(e){var t=this.value,n=!0;(o.current_submenu&&o.current_submenu.close(e),s.callback)&&(!0===s.callback.call(this,t,s,e,o,s.node)&&(n=!1));if(t){if(t.callback&&!s.ignore_item_callbacks&&!0!==t.disabled)!0===t.callback.call(this,t,s,e,o,s.extra)&&(n=!1);if(t.submenu){if(!t.submenu.options)throw"ContextMenu submenu needs options";new o.constructor(t.submenu.options,{callback:t.submenu.callback,event:e,parentMenu:o,ignore_item_callbacks:t.submenu.ignore_item_callbacks,title:t.submenu.title,extra:t.submenu.extra,autoopen:s.autoopen}),n=!1}}n&&!o.lock&&o.close()}return null===t?n.classList.add("separator"):t.is_category_title?(n.classList.remove("litemenu-entry"),n.classList.remove("submenu"),n.classList.add("litemenu-title"),n.innerHTML=t.title):(n.innerHTML=t&&t.title?t.title:e,n.value=t,t&&(t.disabled&&(a=!0,n.classList.add("disabled")),(t.submenu||t.has_submenu)&&n.classList.add("has_submenu")),"function"==typeof t?(n.dataset.value=e,n.onclick_callback=t):n.dataset.value=t,t.className&&(n.className+=" "+t.className)),n&&Et(t)&&(null==t?void 0:t.image)&&!t.submenu&&(n.textContent+=" *",te("div.pysssss-combo-image",{parent:n,style:{backgroundImage:`url(/pysssss/view/${i=t.image,encodeURIComponent(i).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))})`}})),this.root.appendChild(n),a||n.addEventListener("click",l),!a&&s.autoopen&&LiteGraph.pointerListenerAdd(n,"enter",(function(e){var t=this.value;if(!t||!t.has_submenu)return;l.call(this,e)})),n}function Lt(e){return null==e?void 0:e.substring(0,e.lastIndexOf("."))}function kt(e){return null==e?void 0:e.substring(e.lastIndexOf(".")+1)}class xt extends se{constructor(){super(),this.element.classList.add("easyuse-model-metadata")}show(e){super.show(te("div",Object.keys(e).map((t=>te("div",[te("label",{textContent:t}),te("span",{textContent:e[t]})])))))}}class It extends se{constructor(e){super(),this.name=e,this.element.classList.add("easyuse-model-info")}get customNotes(){return this.metadata["easyuse.notes"]}set customNotes(e){this.metadata["easyuse.notes"]=e}get hash(){return this.metadata["easyuse.sha256"]}async show(e,t){this.type=e;const s=ee.fetchApi("/easyuse/metadata/"+encodeURIComponent(`${e}/${t}`));this.info=te("div",{style:{flex:"auto"}}),this.imgCurrent=0,this.imgList=te("div.easyuse-preview-list",{style:{display:"none"}}),this.imgWrapper=te("div.easyuse-preview",[te("div.easyuse-preview-group",[this.imgList])]),this.main=te("main",{style:{display:"flex"}},[this.imgWrapper,this.info]),this.content=te("div.easyuse-model-content",[te("div.easyuse-model-header",[te("h2",{textContent:this.name})]),this.main]);const o=te("div",{textContent:"ℹ️ Loading...",parent:this.content});super.show(this.content),this.metadata=await(await s).json(),this.viewMetadata.style.cursor=this.viewMetadata.style.opacity="",this.viewMetadata.removeAttribute("disabled"),o.remove(),this.addInfo()}createButtons(){const e=super.createButtons();return this.viewMetadata=te("button",{type:"button",textContent:"View raw metadata",disabled:"disabled",style:{opacity:.5,cursor:"not-allowed"},onclick:e=>{this.metadata&&(new xt).show(this.metadata)}}),e.unshift(this.viewMetadata),e}parseNote(){if(!this.customNotes)return[];let e=[];const t=new RegExp("(\\bhttps?:\\/\\/[^\\s]+)","g");let s,o=0;do{let n;s=t.exec(this.customNotes);let i=0;s?(n=s.index,i=s.index+s[0].length):n=this.customNotes.length;let a=this.customNotes.substring(o,n);a&&(a=a.replaceAll("\n","
"),e.push(te("span",{innerHTML:a}))),s&&e.push(te("a",{href:s[0],textContent:s[0],target:"_blank"})),o=i}while(s);return e}addInfoEntry(e,t){return te("p",{parent:this.info},["string"==typeof e?te("label",{textContent:e+": "}):e,"string"==typeof t?te("span",{textContent:t}):t])}async getCivitaiDetails(){const e=await fetch("https://civitai.com/api/v1/model-versions/by-hash/"+this.hash);if(200===e.status)return await e.json();throw 404===e.status?new Error("Model not found"):new Error(`Error loading info (${e.status}) ${e.statusText}`)}addCivitaiInfo(){const e=this.getCivitaiDetails(),t=te("span",{textContent:"ℹ️ Loading..."});return this.addInfoEntry(te("label",[te("img",{style:{width:"18px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),te("span",{textContent:"Civitai: "})]),t),e.then((e=>{var t,s;this.imgWrapper.style.display="block";let o=this.element.querySelector(".easyuse-model-header");o&&o.replaceChildren(te("h2",{textContent:this.name}),te("div.easyuse-model-header-remark",[te("h5",{textContent:Ce("Updated At:")+de(new Date(e.updatedAt),"yyyy/MM/dd")}),te("h5",{textContent:Ce("Created At:")+de(new Date(e.updatedAt),"yyyy/MM/dd")})]));let n=null,i=this.parseNote.call(this),a=Ce("✏️ Edit"),l=te("div.easyuse-model-detail-textarea",[te("p",(null==i?void 0:i.length)>0?i:{textContent:Ce("No notes")})]);if(i&&0!=i.length?l.classList.remove("empty"):l.classList.add("empty"),this.info.replaceChildren(te("div.easyuse-model-detail",[te("div.easyuse-model-detail-head.flex-b",[te("span",Ce("Notes")),te("a",{textContent:a,href:"#",style:{fontSize:"12px",float:"right",color:"var(--warning-color)",textDecoration:"none"},onclick:async e=>{if(e.preventDefault(),n){if(n.value!=this.customNotes){toast.showLoading(Ce("Saving Notes...")),this.customNotes=n.value;const e=await ee.fetchApi("/easyuse/metadata/notes/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:this.customNotes});if(toast.hideLoading(),200!==e.status)return toast.error(Ce("Saving Failed")),void alert(`Error saving notes (${e.status}) ${e.statusText}`);toast.success(Ce("Saving Succeed")),i=this.parseNote.call(this),l.replaceChildren(te("p",(null==i?void 0:i.length)>0?i:{textContent:Ce("No notes")})),n.value?l.classList.remove("empty"):l.classList.add("empty")}else l.replaceChildren(te("p",{textContent:Ce("No notes")})),l.classList.add("empty");e.target.textContent=a,n.remove(),n=null}else e.target.textContent="💾 Save",n=te("textarea",{placeholder:Ce("Type your notes here"),style:{width:"100%",minWidth:"200px",minHeight:"50px",height:"100px"},textContent:this.customNotes}),l.replaceChildren(n),n.focus()}})]),l]),te("div.easyuse-model-detail",[te("div.easyuse-model-detail-head",{textContent:Ce("Details")}),te("div.easyuse-model-detail-body",[te("div.easyuse-model-detail-item",[te("div.easyuse-model-detail-item-label",{textContent:Ce("Type")}),te("div.easyuse-model-detail-item-value",{textContent:e.model.type})]),te("div.easyuse-model-detail-item",[te("div.easyuse-model-detail-item-label",{textContent:Ce("BaseModel")}),te("div.easyuse-model-detail-item-value",{textContent:e.baseModel})]),te("div.easyuse-model-detail-item",[te("div.easyuse-model-detail-item-label",{textContent:Ce("Download")}),te("div.easyuse-model-detail-item-value",{textContent:(null==(t=e.stats)?void 0:t.downloadCount)||0})]),te("div.easyuse-model-detail-item",[te("div.easyuse-model-detail-item-label",{textContent:Ce("Trained Words")}),te("div.easyuse-model-detail-item-value",{textContent:(null==e?void 0:e.trainedWords.join(","))||"-"})]),te("div.easyuse-model-detail-item",[te("div.easyuse-model-detail-item-label",{textContent:Ce("Source")}),te("div.easyuse-model-detail-item-value",[te("label",[te("img",{style:{width:"14px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),te("a",{href:"https://civitai.com/models/"+e.modelId,textContent:"View "+e.model.name,target:"_blank"})])])])])])),null==(s=e.images)?void 0:s.length){this.imgCurrent=0,this.isSaving=!1,e.images.map((e=>e.url&&this.imgList.appendChild(te("div.easyuse-preview-slide",[te("div.easyuse-preview-slide-content",[te("img",{src:e.url}),te("div.save",{textContent:"Save as preview",onclick:async()=>{if(this.isSaving)return;this.isSaving=!0,toast.showLoading(Ce("Saving Preview..."));const t=await(await fetch(e.url)).blob(),s="temp_preview."+new URL(e.url).pathname.split(".")[1],o=new FormData;o.append("image",new File([t],s)),o.append("overwrite","true"),o.append("type","temp");if(200!==(await ee.fetchApi("/upload/image",{method:"POST",body:o})).status)return this.isSaving=!1,toast.error(Ce("Saving Failed")),toast.hideLoading(),void alert(`Error saving preview (${req.status}) ${req.statusText}`);await ee.fetchApi("/easyuse/save/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:JSON.stringify({filename:s,type:"temp"}),headers:{"content-type":"application/json"}}).then((e=>{toast.success(Ce("Saving Succeed")),toast.hideLoading()})),this.isSaving=!1,app.refreshComboInNodes()}})])]))));let t=this;this.imgDistance=(-660*this.imgCurrent).toString(),this.imgList.style.display="",this.imgList.style.transform="translate3d("+this.imgDistance+"px, 0px, 0px)",this.slides=this.imgList.querySelectorAll(".easyuse-preview-slide"),this.slideLeftButton=te("button.left",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{e.images.length<=2||(t.imgList.classList.remove("no-transition"),0==t.imgCurrent?(t.imgCurrent=e.images.length/2-1,this.slides[this.slides.length-1].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d(660px, 0px, 0px)",setTimeout((e=>{this.slides[this.slides.length-1].style.transform="translate3d(0px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)):(t.imgCurrent=t.imgCurrent-1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"))}}),this.slideRightButton=te("button.right",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{if(!(e.images.length<=2))if(t.imgList.classList.remove("no-transition"),t.imgCurrent>=e.images.length/2-1){t.imgCurrent=0;const s=e.images.length/2;this.slides[0].style.transform="translate3d("+(660*s).toString()+"px, 0px, 0px)",this.slides[1].style.transform="translate3d("+(660*s).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d("+(-660*s).toString()+"px, 0px, 0px)",setTimeout((e=>{this.slides[0].style.transform="translate3d(0px, 0px, 0px)",this.slides[1].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)}else t.imgCurrent=t.imgCurrent+1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"}})}return e.description&&te("div",{parent:this.content,innerHTML:e.description,style:{marginTop:"10px"}}),e})).catch((e=>{this.imgWrapper.style.display="none",t.textContent="⚠️ "+e.message})).finally((e=>{}))}}class Nt extends It{async addInfo(){await this.addCivitaiInfo()}}class Tt extends It{getTagFrequency(){if(!this.metadata.ss_tag_frequency)return[];const e=JSON.parse(this.metadata.ss_tag_frequency),t={};for(const s in e){const o=e[s];for(const e in o)e in t?t[e]+=o[e]:t[e]=o[e]}return Object.entries(t).sort(((e,t)=>t[1]-e[1]))}getResolutions(){let e=[];if(this.metadata.ss_bucket_info){const t=JSON.parse(this.metadata.ss_bucket_info);if(null==t?void 0:t.buckets)for(const{resolution:s,count:o}of Object.values(t.buckets))e.push([o,`${s.join("x")} * ${o}`])}e=e.sort(((e,t)=>t[0]-e[0])).map((e=>e[1]));let t=this.metadata.ss_resolution;if(t){const s=t.split(","),o=s[0].replace("(",""),n=s[1].replace(")","");e.push(`${o.trim()}x${n.trim()} (Base res)`)}else(t=this.metadata["modelspec.resolution"])&&e.push(t+" (Base res");return e.length||e.push("⚠️ Unknown"),e}getTagList(e){return e.map((e=>te("li.easyuse-model-tag",{dataset:{tag:e[0]},$:e=>{e.onclick=()=>{e.classList.toggle("easyuse-model-tag--selected")}}},[te("p",{textContent:e[0]}),te("span",{textContent:e[1]})])))}addTags(){let e,t=this.getTagFrequency();if(null==t?void 0:t.length){const s=t.length;let o;s>500&&(t=t.slice(0,500),e=te("p",[te("span",{textContent:"⚠️ Only showing first 500 tags "}),te("a",{href:"#",textContent:`Show all ${s}`,onclick:()=>{o.replaceChildren(...this.getTagList(this.getTagFrequency())),e.remove()}})])),o=te("ol.easyuse-model-tags-list",this.getTagList(t)),this.tags=te("div",[o])}else this.tags=te("p",{textContent:"⚠️ No tag frequency metadata found"});this.content.append(this.tags),e&&this.content.append(e)}async addInfo(){const e=this.addCivitaiInfo();this.addTags();const t=await e;t&&te("div",{parent:this.content,innerHTML:t.description,style:{maxHeight:"250px",overflow:"auto"}})}createButtons(){const e=super.createButtons();function t(e,t){const s=te("textarea",{parent:document.body,style:{position:"fixed"},textContent:t.map((e=>e.dataset.tag)).join(", ")});s.select();try{document.execCommand("copy"),e.target.dataset.text||(e.target.dataset.text=e.target.textContent),e.target.textContent="Copied "+t.length+" tags",setTimeout((()=>{e.target.textContent=e.target.dataset.text}),1e3)}catch(o){prompt("Copy to clipboard: Ctrl+C, Enter",text)}finally{document.body.removeChild(s)}}return e.unshift(te("button",{type:"button",textContent:"Copy Selected",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag--selected")])}}),te("button",{type:"button",textContent:"Copy All",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag")])}})),e}}const Dt=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy kolorsLoader","easy hunyuanDiTLoader","easy pixArtLoader"],Ot=["easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingLayerDiffusion","easy fullkSampler"],Rt=["KSamplerSelect","SamplerEulerAncestral","SamplerEulerAncestralCFG++","SamplerLMS","SamplerDPMPP_3M_SDE","SamplerDPMPP_2M_SDE","SamplerDPMPP_SDE","SamplerDPMAdaptative","SamplerLCMUpscale","SamplerTCD","SamplerTCD EulerA"],Mt=["BasicScheduler","KarrasScheduler","ExponentialScheduler","PolyexponentialScheduler","VPScheduler","BetaSamplingScheduler","SDTurboScheduler","SplitSigmas","SplitSigmasDenoise","FlipSigmas","AlignYourStepsScheduler","GITSScheduler"],Gt=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerLayerDiffusion"],Pt=["easy controlnetLoader","easy controlnetLoaderADV","easy controlnetLoader++","easy instantIDApply","easy instantIDApplyADV"],Bt=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition","easy ipadapterApplyFromParams","easy pulIDApply","easy pulIDApplyADV"],Ft=["easy positive","easy wildcards"],Ut=["easy loadImageBase64","LoadImage","LoadImageMask"],zt=["easy applyBrushNet","easy applyPowerPaint","easy applyInpaint"],jt={positive_prompt:{text:"positive",positive:"text"},loaders:{ckpt_name:"ckpt_name",vae_name:"vae_name",clip_skip:"clip_skip",lora_name:"lora_name",resolution:"resolution",empty_latent_width:"empty_latent_width",empty_latent_height:"empty_latent_height",positive:"positive",negative:"negative",batch_size:"batch_size",a1111_prompt_style:"a1111_prompt_style"},preSampling:{steps:"steps",cfg:"cfg",cfg_scale_min:"cfg",sampler_name:"sampler_name",scheduler:"scheduler",denoise:"denoise",seed_num:"seed_num",seed:"seed"},kSampler:{image_output:"image_output",save_prefix:"save_prefix",link_id:"link_id"},controlnet:{control_net_name:"control_net_name",strength:["strength","cn_strength"],scale_soft_weights:["scale_soft_weights","cn_soft_weights"],cn_strength:["strength","cn_strength"],cn_soft_weights:["scale_soft_weights","cn_soft_weights"]},ipadapter:{preset:"preset",lora_strength:"lora_strength",provider:"provider",weight:"weight",weight_faceidv2:"weight_faceidv2",start_at:"start_at",end_at:"end_at",cache_mode:"cache_mode",use_tiled:"use_tiled",insightface:"insightface",pulid_file:"pulid_file"},load_image:{image:"image",base64_data:"base64_data",channel:"channel"},inpaint:{dtype:"dtype",fitting:"fitting",function:"function",scale:"scale",start_at:"start_at",end_at:"end_at"},sampler:{},sigmas:{}},Ht={loaders:{optional_lora_stack:"optional_lora_stack",positive:"positive",negative:"negative"},preSampling:{pipe:"pipe",image_to_latent:"image_to_latent",latent:"latent"},kSampler:{pipe:"pipe",model:"model"},controlnet:{pipe:"pipe",image:"image",image_kps:"image_kps",control_net:"control_net",positive:"positive",negative:"negative",mask:"mask"},positive_prompt:{},ipadapter:{model:"model",image:"image",image_style:"image",attn_mask:"attn_mask",optional_ipadapter:"optional_ipadapter"},inpaint:{pipe:"pipe",image:"image",mask:"mask"},sampler:{},sigmas:{}},Wt={loaders:{pipe:"pipe",model:"model",vae:"vae",clip:null,positive:null,negative:null,latent:null},preSampling:{pipe:"pipe"},kSampler:{pipe:"pipe",image:"image"},controlnet:{pipe:"pipe",positive:"positive",negative:"negative"},positive_prompt:{text:"positive",positive:"text"},load_image:{IMAGE:"IMAGE",MASK:"MASK"},ipadapter:{model:"model",tiles:"tiles",masks:"masks",ipadapter:"ipadapter"},inpaint:{pipe:"pipe"},sampler:{SAMPLER:"SAMPLER"},sigmas:{SIGMAS:"SIGMAS"}};function Yt(e,t,s){return function(){!function(e,t,s){const o=LiteGraph.createNode(t);if(o){if($.graph.add(o),o.pos=e.pos.slice(),o.size=e.size.slice(),e.widgets.forEach((e=>{if(jt[s][e.name]){const n=jt[s][e.name];if(n){const s=(t=n,o.widgets.find((e=>"object"==typeof t?t.includes(e.name):e.name===t)));s&&(s.value=e.value,"seed_num"==e.name&&(s.linkedWidgets[0].value=e.linkedWidgets[0].value),"converted-widget"==e.type&&qt(o,s,e))}}var t})),e.inputs&&e.inputs.forEach(((t,n)=>{if(t&&t.link&&Ht[s][t.name]){const n=Ht[s][t.name];if(null===n)return;const i=o.findInputSlot(n);if(-1!==i){const s=e.graph.links[t.link];if(s){const t=e.graph.getNodeById(s.origin_id);t&&t.connect(s.origin_slot,o,i)}}}})),e.outputs&&e.outputs.forEach(((t,n)=>{if(t&&t.links&&Wt[s]&&Wt[s][t.name]){const n=Wt[s][t.name];if(null===n)return;const i=o.findOutputSlot(n);-1!==i&&t.links.forEach((t=>{const s=e.graph.links[t];if(s){const t=e.graph.getNodeById(s.target_id);t&&o.connect(i,t,s.target_slot)}}))}})),$.graph.remove(e),"easy fullkSampler"==o.type){const e=o.outputs[0].links;if(e&&e[0]){const t=$.graph._nodes.find((t=>t.inputs&&t.inputs[0]&&t.inputs[0].link==e[0]));t&&$.graph.remove(t)}}else if(Ot.includes(o.type)){const e=o.outputs[0].links;if(!e||!e[0]){const e=LiteGraph.createNode("easy kSampler");$.graph.add(e),e.pos=o.pos.slice(),e.pos[0]=e.pos[0]+o.size[0]+20;const t=o.findInputSlot("pipe");-1!==t&&o&&o.connect(0,e,t)}}o.setSize([o.size[0],o.computeSize()[1]])}}(e,t,s)}}const Vt=(e,t)=>{const s=e.prototype.getExtraMenuOptions;e.prototype.getExtraMenuOptions=function(){const e=s.apply(this,arguments);return t.apply(this,arguments),e}},Zt=(e,t,s,o,n=!0)=>{Vt(o,(function(o,i){i.unshift({content:e,has_submenu:n,callback:(e,o,n,i,a)=>Xt(e,o,n,i,a,t,s)}),"loaders"==t&&(i.unshift({content:Ce("💎 View Lora Info..."),callback:(e,t,s,o,n)=>{let i=n.widgets.find((e=>"lora_name"==e.name)).value;i&&"None"!=i&&new Tt(i).show("loras",i)}}),i.unshift({content:Ce("💎 View Checkpoint Info..."),callback:(e,t,s,o,n)=>{let i=n.widgets[0].value;i&&"None"!=i&&new Nt(i).show("checkpoints",i)}}))}))},Xt=(e,t,s,o,n,i,a)=>{const l=[];return a.map((e=>{n.type!==e&&l.push({content:`${e}`,callback:Yt(n,e,i)})})),new LiteGraph.ContextMenu(l,{event:s,callback:null,parentMenu:o,node:n}),!1},Qt="converted-widget",Kt=Symbol();function Jt(e,t,s=""){if(t.origType=t.type,t.origComputeSize=t.computeSize,t.origSerializeValue=t.serializeValue,t.computeSize=()=>[0,-4],t.type=Qt+s,t.serializeValue=()=>{if(!e.inputs)return;let s=e.inputs.find((e=>{var s;return(null==(s=e.widget)?void 0:s.name)===t.name}));return s&&s.link?t.origSerializeValue?t.origSerializeValue():t.value:void 0},t.linkedWidgets)for(const o of t.linkedWidgets)Jt(e,o,":"+t.name)}function qt(e,t,s){Jt(e,t);const{type:o}=function(e){let t=e[0];t instanceof Array&&(t="COMBO");return{type:t}}(s),n=e.size;t.options&&t.options.forceInput||e.addInput(t.name,o,{widget:{name:t.name,[Kt]:()=>s}});for(const i of e.widgets)i.last_y+=LiteGraph.NODE_SLOT_HEIGHT;e.setSize([Math.max(n[0],e.size[0]),Math.max(n[1],e.size[1])])}const $t=function(e){var t,s,o,n;const i=e.constructor.type,a=e.properties.origVals||{},l=a.title||e.title,r=a.color||e.color,d=a.bgcolor||e.bgcolor,u=e,c={size:[...e.size],color:r,bgcolor:d,pos:[...e.pos]};let p=[],h=[];if(e.inputs)for(const b of e.inputs)if(b.link){const t=b.name,s=e.findInputSlot(t),o=e.getInputNode(s),n=e.getInputLink(s);p.push([n.origin_slot,o,t])}if(e.outputs)for(const b of e.outputs)if(b.links){const e=b.name;for(const t of b.links){const s=graph.links[t],o=graph._nodes_by_id[s.target_id];h.push([e,o,s.target_slot])}}$.graph.remove(e);const m=$.graph.add(LiteGraph.createNode(i,l,c));function g(){if(u.widgets)for(let e of u.widgets)if("converted-widget"===e.type){const t=m.widgets.find((t=>t.name===e.name));for(let s of u.inputs)s.name===e.name&&qt(m,t,s.widget)}for(let e of p){const[t,s,o]=e;s.connect(t,m.id,o)}for(let e of h){const[t,s,o]=e;m.connect(t,s,o)}}let f=u.widgets_values;if(!f&&(null==(t=m.widgets)?void 0:t.length)>0)return m.widgets.forEach(((e,t)=>{const s=u.widgets[t];e.name===s.name&&e.type===s.type&&(e.value=s.value)})),void g();const y=(null==f?void 0:f.length)<=(null==(s=m.widgets)?void 0:s.length);let v=y?0:f.length-1;function _(e,t){var s,o,n,i,a,l;if(!0===e||!1===e){if((null==(s=t.options)?void 0:s.on)&&(null==(o=t.options)?void 0:o.off))return{value:e,pass:!0}}else if("number"==typeof e){if((null==(n=t.options)?void 0:n.min)<=e&&e<=(null==(i=t.options)?void 0:i.max))return{value:e,pass:!0}}else{if(null==(l=null==(a=t.options)?void 0:a.values)?void 0:l.includes(e))return{value:e,pass:!0};if(t.inputEl&&"string"==typeof e)return{value:e,pass:!0}}return{value:t.value,pass:!1}}const w=e=>{var t;const s=u.widgets[e];let o=m.widgets[e];if(o.name===s.name&&o.type===s.type){for(;y?v=0;){let{value:e,pass:t}=_(f[v],o);if(t&&null!==e){o.value=e;break}v+=y?1:-1}v++,y||(v=f.length-((null==(t=m.widgets)?void 0:t.length)-1-e))}};if(y&&(null==(o=m.widgets)?void 0:o.length)>0)for(let b=0;b0)for(let b=m.widgets.length-1;b>=0;b--)w(b);g()};$.registerExtension({name:"Comfy.EasyUse.ExtraMenu",async beforeRegisterNodeDef(e,t,s){Vt(e,(function(e,s){s.unshift({content:Ce("🔃 Reload Node"),callback:(e,t,s,o,n)=>{let i=LGraphCanvas.active_canvas;if(!i.selected_nodes||Object.keys(i.selected_nodes).length<=1)$t(n);else for(let a in i.selected_nodes)$t(i.selected_nodes[a])}}),"easy ckptNames"==t.name&&s.unshift({content:Ce("💎 View Checkpoint Info..."),callback:(e,t,s,o,n)=>{n.widgets[0].value}})})),Ft.includes(t.name)&&Zt("↪️ Swap EasyPrompt","positive_prompt",Ft,e),Dt.includes(t.name)&&Zt("↪️ Swap EasyLoader","loaders",Dt,e),Ot.includes(t.name)&&Zt("↪️ Swap EasyPreSampling","preSampling",Ot,e),Gt.includes(t.name)&&Zt("↪️ Swap EasyKSampler","preSampling",Gt,e),Rt.includes(t.name)&&Zt("↪️ Swap Custom Sampler","sampler",Rt,e),Mt.includes(t.name)&&Zt("↪️ Swap Custom Sigmas","sigmas",Mt,e),Pt.includes(t.name)&&Zt("↪️ Swap EasyControlnet","controlnet",Pt,e),Bt.includes(t.name)&&Zt("↪️ Swap EasyAdapater","ipadapter",Bt,e),Ut.includes(t.name)&&Zt("↪️ Swap LoadImage","load_image",Ut,e),zt.includes(t.name)&&Zt("↪️ Swap InpaintNode","inpaint",zt,e)}});const es="➡️";$.registerExtension({name:"easy setNode",registerCustomNodes(){class e{constructor(){y(this,"defaultVisibility",!0),y(this,"serialize_widgets",!0),this.properties||(this.properties={previousName:""}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("text","Constant","",((e,s,o,n,i)=>{t.validateName(t.graph),""!==this.widgets[0].value&&(this.title=es+this.widgets[0].value),this.update(),this.properties.previousName=this.widgets[0].value}),{}),this.addInput("*","*"),this.onConnectionsChange=function(e,s,o,n,i){if(1!=e||o||(this.inputs[s].type="*",this.inputs[s].name="*",this.title="Set"),n&&t.graph&&1==e&&o){const e=t.graph._nodes.find((e=>e.id==n.origin_id)).outputs[n.origin_slot],s=e.type,o=t.is_auto_link?this.widgets[0].value:e.name;"Set"===this.title&&(this.title=es+o,this.widgets[0].value=o),"*"===this.widgets[0].value&&(this.widgets[0].value=o),this.validateName(t.graph),this.inputs[0].type=s,this.inputs[0].name=o,setTimeout((e=>{this.title=es+this.widgets[0].value}),1)}this.update()},this.validateName=function(e){let s=t.widgets[0].value;if(""!=s){let o=0,n=[];do{n=e._nodes.filter((e=>e!=this&&("easy setNode"==e.type&&e.widgets[0].value===s))),n.length>0&&(s=t.widgets[0].value+o),o++}while(n.length>0);t.widgets[0].value=s,this.update()}},this.clone=function(){const t=e.prototype.clone.apply(this);return t.inputs[0].name="*",t.inputs[0].type="*",t.properties.previousName="",t.size=t.computeSize(),t},this.onAdded=function(e){this.validateName(e)},this.update=function(){if(t.graph){this.findGetters(t.graph).forEach((e=>{e.setType(this.inputs[0].type)})),this.widgets[0].value&&this.findGetters(t.graph,!0).forEach((e=>{e.setName(this.widgets[0].value)}));t.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues()}))}},this.findGetters=function(e,t){const s=t?this.properties.previousName:this.widgets[0].value;return e._nodes.filter((e=>"easy getNode"==e.type&&e.widgets[0].value===s&&""!=s))},this.isVirtualNode=!0}onRemoved(){this.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues([this])}))}}LiteGraph.registerNodeType("easy setNode",Object.assign(e,{title:"Set"})),e.category="EasyUse/Util"}}),$.registerExtension({name:"easy getNode",registerCustomNodes(){class e{constructor(){y(this,"defaultVisibility",!0),y(this,"serialize_widgets",!0),this.properties||(this.properties={}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("combo","Constant","",(e=>{this.onRename()}),{values:()=>t.graph._nodes.filter((e=>"easy setNode"==e.type)).map((e=>e.widgets[0].value)).sort()}),this.addOutput("*","*"),this.onConnectionsChange=function(e,t,s,o,n){this.validateLinks(),2!=e||s?(this.onRename(),setTimeout((e=>{this.title="⬅️"+this.widgets[0].value}),1)):(this.outputs[t].type="*",this.outputs[t].name="*",this.title="Get")},this.setName=function(e){t.widgets[0].value=e,t.onRename(),t.serialize()},this.onRename=function(e=0){const s=this.findSetter(t.graph);if(s){const t=s.inputs[0].type,o=s.inputs[0].name;this.setType(t,o),this.outputs[e].type=t,this.outputs[e].name=o,this.title="⬅️"+s.widgets[0].value}else this.setType("*","*"),this.outputs[e].type="*",this.outputs[e].name="*"},this.clone=function(){const t=e.prototype.clone.apply(this);return t.size=t.computeSize(),t},this.validateLinks=function(){"*"!=this.outputs[0].type&&this.outputs[0].links&&this.outputs[0].links.forEach((e=>{const s=t.graph.links[e];s&&s.type!=this.outputs[0].type&&"*"!=s.type&&t.graph.removeLink(e)}))},this.setType=function(e,t){this.outputs[0].name=t,this.outputs[0].type=e,this.validateLinks()},this.findSetter=function(e){const t=this.widgets[0].value;return e._nodes.find((e=>"easy setNode"==e.type&&e.widgets[0].value===t&&""!=t))},this.isVirtualNode=!0}getInputLink(e){const t=this.findSetter(this.graph);if(t){const s=t.inputs[e];return this.graph.links[s.link]}throw new Error("No setter found for "+this.widgets[0].value+"("+this.type+")")}onAdded(e){}}LiteGraph.registerNodeType("easy getNode",Object.assign(e,{title:"Get"})),e.category="EasyUse/Util"}}),ee.addEventListener("easyuse-global-seed",(function(e){let t=app.graph._nodes_by_id;for(let s in t){let o=t[s];if("easy globalSeed"==o.type){if(o.widgets){const t=o.widgets.find((e=>"value"==e.name));o.widgets.find((e=>"last_seed"==e.name)).value=t.value,t.value=e.detail.value}}else if(o.widgets){const t=o.widgets.find((e=>"seed_num"==e.name||"seed"==e.name||"noise_seed"==e.name));t&&null!=e.detail.seed_map[o.id]&&(t.value=e.detail.seed_map[o.id])}}}));const ts=ee.queuePrompt;ee.queuePrompt=async function(e,{output:t,workflow:s}){s.seed_widgets={};for(let o in app.graph._nodes_by_id){let e=app.graph._nodes_by_id[o].widgets;if(e)for(let t in e)"seed_num"!=e[t].name&&"seed"!=e[t].name&&"noise_seed"!=e[t].name||"converted-widget"==e[t].type||(s.seed_widgets[o]=parseInt(t))}return await ts.call(ee,e,{output:t,workflow:s})};const ss=["easy imageSave","easy fullkSampler","easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo","easy detailerFix"];$.registerExtension({name:"Comfy.EasyUse.SaveImageExtraOutput",async beforeRegisterNodeDef(e,t,s){if(ss.includes(t.name)){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0,o=this.widgets.find((e=>"filename_prefix"===e.name||"save_prefix"===e.name));return o.serializeValue=()=>ne(s,o.value),e}}else{const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0;return this.properties&&"Node name for S&R"in this.properties||this.addProperty("Node name for S&R",this.constructor.type,"string"),e}}}});const os=["easy wildcards","easy positive","easy negative","easy stylesSelector","easy promptConcat","easy promptReplace"],ns=["easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingDynamicCFG","easy preSamplingSdTurbo","easy preSamplingLayerDiffusion"],is=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo"],as=["easy controlnetLoader","easy controlnetLoaderADV"],ls=["easy instantIDApply","easy instantIDApplyADV"],rs=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition"],ds=["easy pipeIn","easy pipeOut","easy pipeEdit"],us=["easy XYPlot","easy XYPlotAdvanced"],cs=["easy setNode"],ps=["Reroute","RescaleCFG","LoraLoaderModelOnly","LoraLoader","FreeU","FreeU_v2",...rs,...cs],hs={"easy seed":{from:{INT:["Reroute",...ns,"easy fullkSampler"]}},"easy positive":{from:{STRING:["Reroute",...os]}},"easy negative":{from:{STRING:["Reroute",...os]}},"easy wildcards":{from:{STRING:["Reroute","easy showAnything",...os]}},"easy stylesSelector":{from:{STRING:["Reroute","easy showAnything",...os]}},"easy promptConcat":{from:{STRING:["Reroute","easy showAnything",...os]}},"easy promptReplace":{from:{STRING:["Reroute","easy showAnything",...os]}},"easy fullLoader":{from:{PIPE_LINE:["Reroute",...ns,"easy fullkSampler",...ds,...cs],MODEL:ps},to:{STRING:["Reroute",...os]}},"easy a1111Loader":{from:{PIPE_LINE:["Reroute",...ns,...as,...ls,...ds,...cs],MODEL:ps},to:{STRING:["Reroute",...os]}},"easy comfyLoader":{from:{PIPE_LINE:["Reroute",...ns,...as,...ls,...ds,...cs],MODEL:ps},to:{STRING:["Reroute",...os]}},"easy hunyuanDiTLoader":{from:{PIPE_LINE:["Reroute",...ns,...as,...ls,...ds,...cs],MODEL:ps},to:{STRING:["Reroute",...os]}},"easy kolorsLoader":{from:{PIPE_LINE:["Reroute",...ns,...as,...ls,...ds,...cs],MODEL:ps},to:{STRING:["Reroute",...os]}},"easy pixArtLoader":{from:{PIPE_LINE:["Reroute",...ns,...as,...ls,...ds,...cs],MODEL:ps},to:{STRING:["Reroute",...os]}},"easy svdLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...ds,...cs],MODEL:ps},to:{STRING:["Reroute",...os]}},"easy zero123Loader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...ds,...cs],MODEL:ps},to:{STRING:["Reroute",...os]}},"easy sv3dLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...ds,...cs],MODEL:ps},to:{STRING:["Reroute",...os]}},"easy preSampling":{from:{PIPE_LINE:["Reroute",...is,...ds,...as,...us,...cs]}},"easy preSamplingAdvanced":{from:{PIPE_LINE:["Reroute",...is,...ds,...as,...us,...cs]}},"easy preSamplingDynamicCFG":{from:{PIPE_LINE:["Reroute",...is,...ds,...as,...us,...cs]}},"easy preSamplingCustom":{from:{PIPE_LINE:["Reroute",...is,...ds,...as,...us,...cs]}},"easy preSamplingLayerDiffusion":{from:{PIPE_LINE:["Reroute","easy kSamplerLayerDiffusion",...is,...ds,...as,...us,...cs]}},"easy preSamplingNoiseIn":{from:{PIPE_LINE:["Reroute",...is,...ds,...as,...us,...cs]}},"easy fullkSampler":{from:{PIPE_LINE:["Reroute",...ds.reverse(),"easy preDetailerFix","easy preMaskDetailerFix",...ns,...cs]}},"easy kSampler":{from:{PIPE_LINE:["Reroute",...ds.reverse(),"easy preDetailerFix","easy preMaskDetailerFix","easy hiresFix",...ns,...cs]}},"easy controlnetLoader":{from:{PIPE_LINE:["Reroute",...ns,...as,...ls,...ds,...cs]}},"easy controlnetLoaderADV":{from:{PIPE_LINE:["Reroute",...ns,...as,...ls,...ds,...cs]}},"easy instantIDApply":{from:{PIPE_LINE:["Reroute",...ns,...as,...ls,...ds,...cs],MODEL:ps},to:{COMBO:["Reroute","easy promptLine"]}},"easy instantIDApplyADV":{from:{PIPE_LINE:["Reroute",...ns,...as,...ls,...ds,...cs],MODEL:ps},to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApply":{to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApplyADV":{to:{STRING:["Reroute","easy sliderControl",...os],COMBO:["Reroute","easy promptLine"]}},"easy ipadapterStyleComposition":{to:{COMBO:["Reroute","easy promptLine"]}},"easy preDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...ds,...cs]},to:{PIPE_LINE:["Reroute","easy ultralyticsDetectorPipe","easy samLoaderPipe","easy kSampler","easy fullkSampler"]}},"easy preMaskDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...ds,...cs]}},"easy samLoaderPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...ds,...cs]}},"easy ultralyticsDetectorPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...ds,...cs]}},"easy cascadeLoader":{from:{PIPE_LINE:["Reroute","easy fullCascadeKSampler","easy preSamplingCascade",...as,...ds,...cs],MODEL:ps.filter((e=>!rs.includes(e)))}},"easy fullCascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...ds,...cs]}},"easy preSamplingCascade":{from:{PIPE_LINE:["Reroute","easy cascadeKSampler",...ds,...cs]}},"easy cascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...ds,...cs]}}};$.registerExtension({name:"Comfy.EasyUse.Suggestions",async setup(e){LGraphCanvas.prototype.createDefaultNodeForSlot=function(e){e=e||{};var t,s=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,position:[],nodeType:null,posAdd:[0,0],posSizeFix:[0,0]},e),o=s.nodeFrom&&null!==s.slotFrom,n=!o&&s.nodeTo&&null!==s.slotTo;if(!o&&!n)return!1;if(!s.nodeType)return!1;var i=o?s.nodeFrom:s.nodeTo,a=o?s.slotFrom:s.slotTo,l=i.type,r=!1;switch(typeof a){case"string":r=o?i.findOutputSlot(a,!1):i.findInputSlot(a,!1),a=o?i.outputs[a]:i.inputs[a];break;case"object":r=o?i.findOutputSlot(a.name):i.findInputSlot(a.name);break;case"number":r=a,a=o?i.outputs[a]:i.inputs[a];break;default:return!1}var d=a.type==LiteGraph.EVENT?"_event_":a.type,u=o?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in;if(u&&u[d]){a.link;let e=!1;const n=o?"from":"to";if(hs[l]&&hs[l][n]&&(null==(t=hs[l][n][d])?void 0:t.length)>0){for(var c in hs[l][n][d])if(s.nodeType==hs[l][n][d][c]||"AUTO"==s.nodeType){e=hs[l][n][d][c];break}}else if("object"==typeof u[d]||"array"==typeof u[d]){for(var c in u[d])if(s.nodeType==u[d][c]||"AUTO"==s.nodeType){e=u[d][c];break}}else s.nodeType!=u[d]&&"AUTO"!=s.nodeType||(e=u[d]);if(e){var p=!1;"object"==typeof e&&e.node&&(p=e,e=e.node);var h=LiteGraph.createNode(e);if(h){if(p){if(p.properties)for(var m in p.properties)h.addProperty(m,p.properties[m]);if(p.inputs)for(var m in h.inputs=[],p.inputs)h.addOutput(p.inputs[m][0],p.inputs[m][1]);if(p.outputs)for(var m in h.outputs=[],p.outputs)h.addOutput(p.outputs[m][0],p.outputs[m][1]);p.title&&(h.title=p.title),p.json&&h.configure(p.json)}return this.graph.add(h),h.pos=[s.position[0]+s.posAdd[0]+(s.posSizeFix[0]?s.posSizeFix[0]*h.size[0]:0),s.position[1]+s.posAdd[1]+(s.posSizeFix[1]?s.posSizeFix[1]*h.size[1]:0)],o?s.nodeFrom.connectByType(r,h,d):s.nodeTo.connectByTypeOutput(r,h,d),!0}}}return!1},LGraphCanvas.prototype.showConnectionMenu=function(e){e=e||{};var t,s=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,e:null},e),o=this,n=s.nodeFrom&&s.slotFrom,i=!n&&s.nodeTo&&s.slotTo;if(!n&&!i)return!1;var a=n?s.nodeFrom:s.nodeTo,l=n?s.slotFrom:s.slotTo,r=!1;switch(typeof l){case"string":r=n?a.findOutputSlot(l,!1):a.findInputSlot(l,!1),l=n?a.outputs[l]:a.inputs[l];break;case"object":r=n?a.findOutputSlot(l.name):a.findInputSlot(l.name);break;case"number":r=l,l=n?a.outputs[l]:a.inputs[l];break;default:return!1}var d=["Add Node",null];o.allow_searchbox&&(d.push("Search"),d.push(null));var u=l.type==LiteGraph.EVENT?"_event_":l.type,c=n?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in,p=a.type;if(c&&c[u]){const e=n?"from":"to";if(hs[p]&&hs[p][e]&&(null==(t=hs[p][e][u])?void 0:t.length)>0)for(var h in hs[p][e][u])d.push(hs[p][e][u][h]);else if("object"==typeof c[u]||"array"==typeof c[u])for(var h in c[u])d.push(c[u][h]);else d.push(c[u])}var m=new LiteGraph.ContextMenu(d,{event:s.e,title:(l&&""!=l.name?l.name+(u?" | ":""):"")+(l&&u?u:""),callback:function(e,t,i){switch(e){case"Add Node":LGraphCanvas.onMenuAdd(null,null,i,m,(function(e){n?s.nodeFrom.connectByType(r,e,u):s.nodeTo.connectByTypeOutput(r,e,u)}));break;case"Search":n?o.showSearchBox(i,{node_from:s.nodeFrom,slot_from:l,type_filter_in:u}):o.showSearchBox(i,{node_to:s.nodeTo,slot_from:l,type_filter_out:u});break;default:o.createDefaultNodeForSlot(Object.assign(s,{position:[s.e.canvasX,s.e.canvasY],nodeType:e}))}}});return!1}}}),$.registerExtension({name:"Comfy.EasyUse.TimeTaken",setup(){const e=new Map;let t=0;ee.addEventListener("executing",(s=>{if(!le("EasyUse.Nodes.Runtime",null,!0))return;const o=(null==s?void 0:s.node)||(null==s?void 0:s.detail)||null,n=$e(o);n&&(n.executionDuration="");const i=e.get(t);if(e.delete(t),t&&i){const e=Date.now()-i,s=$e(t);s&&(s.executionDuration=`${(e/1e3).toFixed(2)}${Ce("s")}`)}t=o,e.set(o,Date.now())}))},beforeRegisterNodeDef(e,t){const s=e.prototype.onDrawForeground;e.prototype.onDrawForeground=function(...e){const[t]=e;return function(e,t){if(!t)return;e.save(),e.fillStyle=LiteGraph.NODE_DEFAULT_BGCOLOR,function(e,t,s,o,n,i){e.beginPath(),e.moveTo(t+i,s),e.lineTo(t+o-i,s),e.arcTo(t+o,s,t+o,s+i,i),e.lineTo(t+o,s+n-i),e.arcTo(t+o,s+n,t+o-i,s+n,i),e.lineTo(t+i,s+n),e.arcTo(t,s+n,t,s+n-i,i),e.lineTo(t,s+i),e.arcTo(t,s,t+i,s,i),e.closePath()}(e,0,-LiteGraph.NODE_TITLE_HEIGHT-20,e.measureText(t).width+10,LiteGraph.NODE_TITLE_HEIGHT-10,4),e.fill(),function(e,t,s,o,n="#000",i=12,a="Inter"){e.font=`${i}px ${a}`,e.fillStyle=n,e.fillText(t,s,o)}(e,t,8,-LiteGraph.NODE_TITLE_HEIGHT-6,LiteGraph.NODE_TITLE_COLOR),e.restore()}(t,this.executionDuration||""),null==s?void 0:s.apply(this,e)}}});let ms=null;$.registerExtension({name:"Comfy.EasyUse.HotKeys",setup(){if(void 0!==w){w("up,down,left,right",(function(e,t){var s,o,n,i,a,l,r,d,u,c,p,h,m,g,f;e.preventDefault();if(!le("EasyUse.Hotkeys.JumpNearestNodes",null,!0))return;const y=et();if(0===y.length)return;const v=y[0];switch(t.key){case"up":case"left":let e=null;if(at(v)){const e=null==(s=v.widgets_values)?void 0:s[0],t=null==(o=v.graph)?void 0:o._nodes,n=null==t?void 0:t.find((t=>{var s;if(lt(t)){if((null==(s=t.widgets_values)?void 0:s[0])===e)return t}return null}));n&&st(n)}else if((null==(n=v.inputs)?void 0:n.length)>0){for(let t=0;t{var s;if(at(t)){if((null==(s=t.widgets_values)?void 0:s[0])===e)return t}return null}));s&&st(s)}else if((null==(c=v.outputs)?void 0:c.length)>0){for(let e=0;e0&&v.outputs[e].links[0]){t=v.outputs[e].links[0];break}if(t){const e=null==(h=v.graph)?void 0:h.links;if(e[t]){const s=null==(m=e[t])?void 0:m.target_id,o=null==(f=null==(g=v.graph)?void 0:g._nodes_by_id)?void 0:f[s];o&&st(o)}}}}})),w("shift+up,shift+down,shift+left,shift+right",(function(e,t){e.preventDefault();if(!le("EasyUse.Hotkeys.AlignSelectedNodes",null,!0))return;const s=et();if(s.length<=1)return;const o=s;switch(t.key){case"shift+up":LGraphCanvas.alignNodes(o,"top",o[0]);break;case"shift+down":LGraphCanvas.alignNodes(o,"bottom",o[0]);break;case"shift+left":LGraphCanvas.alignNodes(o,"left",o[0]);break;case"shift+right":LGraphCanvas.alignNodes(o,"right",o[0])}ms||(ms=Ne()),ms&&ms.update()})),w("shift+g",(function(e,t){e.preventDefault();le("EasyUse.Hotkeys.AddGroup",null,!0)&&(fs(),ms||(ms=Ne()),ms&&ms.update())})),w("shift+r",(function(e,t){e.preventDefault();le("EasyUse.Hotkeys.cleanVRAMused",null,!0)&&Ie()}));const e=[];Array.from(Array(10).keys()).forEach((t=>e.push(`alt+${t}`))),w(e.join(","),(async function(e,t){e.preventDefault();if(!le("EasyUse.Hotkeys.NodesTemplate",null,!0))return;const s=t.key;let o=parseInt(s.split("+")[1]);const n=await ee.getUserData("comfy.templates.json");let i=null;if(200==n.status)try{i=await n.json()}catch(l){xe.error(Ce("Get Node Templates File Failed"))}else localStorage["Comfy.NodeTemplates"]?i=JSON.parse(localStorage["Comfy.NodeTemplates"]):xe.warn(Ce("No Node Templates Found"));if(!i)return void xe.warn(Ce("No Node Templates Found"));o=0===o?9:o-1;const a=i[o];if(a)try{const e=(null==a?void 0:a.name)||"Group",t=(null==a?void 0:a.data)?JSON.parse(a.data):[];gs((async()=>{await ie.registerFromWorkflow(t.groupNodes,{}),localStorage.litegrapheditor_clipboard=a.data,$.canvas.pasteFromClipboard(),t.groupNodes||fs(e)}))}catch(l){xe.error(l)}else xe.warn(Ce("Node template with {key} not set").replace("{key}",s))}));const t=async function(e){if(("b"===e.key||"m"==e.key)&&(e.metaKey||e.ctrlKey)){if(0===et().length)return;ms||(ms=Ne()),ms&&ms.update()}};window.addEventListener("keydown",t,!0)}}});const gs=async e=>{const t=localStorage.litegrapheditor_clipboard;await e(),localStorage.litegrapheditor_clipboard=t},fs=e=>{const t=et();if(0===t.length)return;const s=t;let o=new LiteGraph.LGraphGroup;o.title=e||"Group",((e,t=[],s=20)=>{var o,n,i,a,l,r,d,u,c,p;for(var h of(n=i=a=l=-1,r=d=u=c=-1,[e._nodes,t]))for(var m in h)r=(p=h[m]).pos[0],d=p.pos[1],u=p.pos[0]+p.size[0],c=p.pos[1]+p.size[1],"Reroute"!=p.type&&(d-=LiteGraph.NODE_TITLE_HEIGHT),(null==(o=p.flags)?void 0:o.collapsed)&&(c=d+LiteGraph.NODE_TITLE_HEIGHT,(null==p?void 0:p._collapsed_width)&&(u=r+Math.round(p._collapsed_width))),(-1==n||ra)&&(a=u),(-1==l||c>l)&&(l=c);i-=Math.round(1.4*e.font_size),e.pos=[n-s,i-s],e.size=[a-n+2*s,l-i+2*s]})(o,s),$.canvas.graph.add(o)};function ys(e,t,s,o){const n=[];return e.workflow.links.forEach((e=>{s&&e[1]===t&&!n.includes(e[3])&&n.push(e[3]),o&&e[3]===t&&!n.includes(e[1])&&n.push(e[1])})),n}async function vs(e,t=!1){const s=structuredClone(await $.graphToPrompt()),o=[];if(s.workflow.nodes.forEach((e=>{o.push(e.id)})),s.workflow.links=s.workflow.links.filter((e=>o.includes(e[1])&&o.includes(e[3]))),t)for(;!$.graph._nodes_by_id[e].isChooser;)e=ys(s,e,!0,!1)[0];const n=function(e,t){const s=[],o=[t];for(;o.length>0;){const t=o.pop();s.push(t),o.push(...ys(e,t,!0,!1).filter((e=>!(s.includes(e)||o.includes(e)))))}o.push(...s.filter((e=>e!=t)));const n=[t];for(;o.length>0;){const t=o.pop();n.push(t),o.push(...ys(e,t,!1,!0).filter((e=>!(n.includes(e)||o.includes(e)))))}const i=[];return i.push(...s),i.push(...n.filter((e=>!i.includes(e)))),i}(s,e);s.workflow.nodes=s.workflow.nodes.filter((t=>(t.id===e&&t.inputs.forEach((e=>{e.link=null})),n.includes(t.id)))),s.workflow.links=s.workflow.links.filter((e=>n.includes(e[1])&&n.includes(e[3])));const i={};for(const[r,d]of Object.entries(s.output))n.includes(parseInt(r))&&(i[r]=d);const a={};for(const[r,d]of Object.entries(i[e.toString()].inputs))Array.isArray(d)||(a[r]=d);i[e.toString()].inputs=a,s.output=i;const l=$.graphToPrompt;$.graphToPrompt=()=>($.graphToPrompt=l,s),$.queuePrompt(0)}const _s=new class{constructor(){this.current_node_id=void 0,this.class_of_current_node=null,this.current_node_is_chooser=!1}update(){var e,t;return $.runningNodeId!=this.current_node_id&&(this.current_node_id=$.runningNodeId,this.current_node_id?(this.class_of_current_node=null==(t=null==(e=$.graph)?void 0:e._nodes_by_id[$.runningNodeId.toString()])?void 0:t.comfyClass,this.current_node_is_chooser="easy imageChooser"===this.class_of_current_node):(this.class_of_current_node=void 0,this.current_node_is_chooser=!1),!0)}},ws=class e{constructor(){}static idle(){return!$.runningNodeId}static paused(){return!0}static paused_here(t){return e.here(t)}static running(){return!e.idle()}static here(e){return $.runningNodeId==e}static state(){return"Paused"}};y(ws,"cancelling",!1);let bs=ws;function As(e,t){const s=new FormData;s.append("message",t),s.append("id",e),ee.fetchApi("/easyuse/image_chooser_message",{method:"POST",body:s})}function Ss(){As(-1,"__cancel__"),bs.cancelling=!0,ee.interrupt(),bs.cancelling=!1}var Es=0;function Cs(){Es+=1}const Ls=["easy kSampler","easy kSamplerTiled","easy fullkSampler"];function ks(e){const t=$.graph._nodes_by_id[e.detail.id];if(t){t.selected=new Set,t.anti_selected=new Set;const s=function(e,t){var s;return e.imgs=[],t.forEach((t=>{const s=new Image;e.imgs.push(s),s.onload=()=>{$.graph.setDirtyCanvas(!0)},s.src=`/view?filename=${encodeURIComponent(t.filename)}&type=temp&subfolder=${$.getPreviewFormatParam()}`})),null==(s=e.setSizeForImage)||s.call(e),e.imgs}(t,e.detail.urls);return{node:t,image:s,isKSampler:Ls.includes(t.type)}}}function xs(e,t,s){var o;if(e.imageRects)o=e.imageRects[t];else{const t=e.imagey;o=[1,t+1,e.size[0]-2,e.size[1]-t-2]}s.strokeRect(o[0]+1,o[1]+1,o[2]-2,o[3]-2)}class Is extends se{constructor(){super(),this.node=null,this.select_index=[],this.dialog_div=null}show(e,t){this.select_index=[],this.node=t;const s=e.map(((e,s)=>{const o=te("img",{src:e.src,onclick:e=>{this.select_index.includes(s)?(this.select_index=this.select_index.filter((e=>e!==s)),o.classList.remove("selected")):(this.select_index.push(s),o.classList.add("selected")),t.selected.has(s)?t.selected.delete(s):t.selected.add(s)}});return o}));super.show(te("div.comfyui-easyuse-chooser-dialog",[te("h5.comfyui-easyuse-chooser-dialog-title",Ce("Choose images to continue")),te("div.comfyui-easyuse-chooser-dialog-images",s)]))}createButtons(){const e=super.createButtons();return e[0].onclick=e=>{bs.running()&&Ss(),super.close()},e.unshift(te("button",{type:"button",textContent:Ce("Choose Selected Images"),onclick:e=>{As(this.node.id,[...this.node.selected,-1,...this.node.anti_selected]),bs.idle()&&(Cs(),vs(this.node.id).then((()=>{As(this.node.id,[...this.node.selected,-1,...this.node.anti_selected])}))),super.close()}})),e}}function Ns(){const e=$.graph._nodes_by_id[this.node_id];if(e){const t=[...e.selected];(null==t?void 0:t.length)>0&&e.setProperty("values",t),As(e.id,[...e.selected,-1,...e.anti_selected]),bs.idle()&&(Cs(),vs(e.id).then((()=>{As(e.id,[...e.selected,-1,...e.anti_selected])})))}}function Ts(){bs.running()&&Ss()}function Ds(e){Object.defineProperty(e,"clicked",{get:function(){return this._clicked},set:function(e){this._clicked=e&&""!=this.name}})}function Os(e){e.options||(e.options={}),e.options.serialize=!1}$.registerExtension({name:"Comfy.EasyUse.imageChooser",init(){window.addEventListener("beforeunload",Ss,!0)},setup(e){const t=LGraphCanvas.prototype.draw;LGraphCanvas.prototype.draw=function(){_s.update()&&e.graph._nodes.forEach((e=>{e.update&&e.update()})),t.apply(this,arguments)},ee.addEventListener("easyuse-image-choose",(function(e){const{node:t,image:s,isKSampler:o}=ks(e);if(o){(new Is).show(s,t)}}));const s=ee.interrupt;ee.interrupt=function(){bs.cancelling||Ss(),s.apply(this,arguments)},ee.addEventListener("execution_start",(function(){(Es>0?(Es-=1,0):(As(-1,"__start__"),1))&&e.graph._nodes.forEach((e=>{(e.selected||e.anti_selected)&&(e.selected.clear(),e.anti_selected.clear(),e.update())}))}))},async nodeCreated(e,t){if("easy imageChooser"==e.comfyClass){e.setProperty("values",[]),void 0===(null==e?void 0:e.imageIndex)&&Object.defineProperty(e,"imageIndex",{get:function(){return null},set:function(t){e.overIndex=t}}),void 0===(null==e?void 0:e.imagey)&&Object.defineProperty(e,"imagey",{get:function(){return null},set:function(t){return e.widgets[e.widgets.length-1].last_y+LiteGraph.NODE_WIDGET_HEIGHT}});const t=e.onMouseDown;e.onMouseDown=function(s,o,n){if(s.isPrimary){const t=function(e,t){var s,o;if((null==(s=e.imgs)?void 0:s.length)>1)for(var n=0;n0&&s0&&oe.imagey)return 0;return-1}(e,o);t>=0&&this.imageClicked(t)}return t&&t.apply(this,arguments)},e.send_button_widget=e.addWidget("button","","",Ns),e.cancel_button_widget=e.addWidget("button","","",Ts),Ds(e.cancel_button_widget),Ds(e.send_button_widget),Os(e.cancel_button_widget),Os(e.send_button_widget)}},beforeRegisterNodeDef(e,t,s){if("easy imageChooser"==(null==t?void 0:t.name)){const t=e.prototype.onDrawBackground;e.prototype.onDrawBackground=function(e){t.apply(this,arguments),function(e,t){var s,o;if(e.imgs){if(e.imageRects)for(let s=0;s{xs(e,s,t)})),t.strokeStyle="#F88",null==(o=null==e?void 0:e.anti_selected)||o.forEach((s=>{xs(e,s,t)}))}}(this,e)},e.prototype.imageClicked=function(t){"easy imageChooser"===(null==e?void 0:e.comfyClass)&&(this.selected.has(t)?this.selected.delete(t):this.selected.add(t),this.update())};const s=e.prototype.update;e.prototype.update=function(){var e;if(s&&s.apply(this,arguments),this.send_button_widget){this.send_button_widget.node_id=this.id;const t=(this.selected?this.selected.size:0)+(this.anti_selected?this.anti_selected.size:0),s=(null==(e=this.imgs)?void 0:e.length)||0;bs.paused_here(this.id)&&t>0?this.send_button_widget.name=t>1?"Progress selected ("+t+"/"+s+")":"Progress selected image":this.send_button_widget.name=t>0?t>1?"Progress selected ("+t+"/"+s+")":"Progress selected image as restart":""}if(this.cancel_button_widget){const e=bs.running();this.cancel_button_widget.name=e?"Cancel current run":""}this.setDirtyCanvas(!0,!0)}}}}),Number.prototype.div=function(e){return function(e,t){let s,o,n=0,i=0,a="string"==typeof e?e:e.toString(),l="string"==typeof t?t:t.toString();try{n=a.toString().split(".")[1].length}catch(r){}try{i=l.toString().split(".")[1].length}catch(r){}return s=Number(a.toString().replace(".","")),o=Number(l.toString().replace(".","")),s/o*Math.pow(10,i-n)}(this,e)};let Rs=[],Ms=0;const Gs={sd3:6.5,"sd3-turbo":4};class Ps extends se{constructor(){super(),this.lists=[],this.dialog_div=null,this.user_div=null}addItem(e,t){return te("div.easyuse-account-dialog-item",[te("input",{type:"text",placeholder:"Enter name",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Rs[t].name=e.target.value},value:Rs[e].name}),te("input.key",{type:"text",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Rs[t].key=e.target.value},placeholder:"Enter APIKEY",value:Rs[e].key}),te("button.choose",{textContent:Ce("Choose"),onclick:async e=>{var s,o,n;const i=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);let a=Rs[i].name,l=Rs[i].key;if(!a)return void xe.error(Ce("Please enter the account name"));if(!l)return void xe.error(Ce("Please enter the APIKEY"));let r=!0;for(let t=0;t{(new Ps).show(t)}},[te("div.user",[te("div.avatar",i?[te("img",{src:i})]:"😀"),te("div.info",[te("h5.name",a),te("h6.remark","Credits: "+l)])]),te("div.edit",{textContent:Ce("Edit")})])),xe.success(Ce("Save Succeed"))}else xe.success(Ce("Save Succeed"));this.close()}else xe.error(Ce("Save Failed"))}}),te("button.delete",{textContent:Ce("Delete"),onclick:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Rs.length<=1?xe.error(Ce("At least one account is required")):(Rs.splice(t,1),this.dialog_div.removeChild(e.target.parentNode))}})])}show(e){Rs.forEach(((t,s)=>{this.lists.push(this.addItem(s,e))})),this.dialog_div=te("div.easyuse-account-dialog",this.lists),super.show(te("div.easyuse-account-dialog-main",[te("div",[te("a",{href:"https://platform.stability.ai/account/keys",target:"_blank",textContent:Ce("Getting Your APIKEY")})]),this.dialog_div]))}createButtons(){const e=super.createButtons();return e.unshift(te("button",{type:"button",textContent:Ce("Save Account Info"),onclick:e=>{let t=!0;for(let s=0;s{200==e.status?xe.success(Ce("Save Succeed")):xe.error(Ce("Save Failed"))}))}else xe.error(Ce("APIKEY is not Empty"))}})),e.unshift(te("button",{type:"button",textContent:Ce("Add Account"),onclick:e=>{const t="Account "+Rs.length.toString();Rs.push({name:t,key:""});const s=this.addItem(Rs.length-1);this.lists.push(s),this.dialog_div.appendChild(s)}})),e}}$.registerExtension({name:"Comfy.EasyUse.API.SD3",async beforeRegisterNodeDef(e,t,s){if("easy stableDiffusion3API"==t.name){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=async function(){var e,s,o;t&&(null==t||t.apply(this,arguments));const n=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),i=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));let a=this.widgets.find((e=>"model"==e.name));a.callback=e=>{l.value="-"+Gs[e]};const l=this.addWidget("text","cost_credit","0",(e=>{}),{serialize:!1});l.disabled=!0,setTimeout((e=>{"control_before_generate"==i.name&&0===n.value&&(n.value=Math.floor(4294967294*Math.random())),l.value="-"+Gs[a.value]}),100);let r=te("div.easyuse-account-user",[Ce("Loading UserInfo...")]);this.addDOMWidget("account","btn",te("div.easyuse-account",r)),ee.addEventListener("stable-diffusion-api-generate-succeed",(async({detail:e})=>{var t;let s=r.querySelectorAll(".remark");if(s&&s[0]){const t=(null==e?void 0:e.model)?Gs[e.model]:0;if(t){let e=function(e,t){let s,o,n,i,a,l;a="string"==typeof e?e:e.toString(),l="string"==typeof t?t:t.toString();try{s=a.split(".")[1].length}catch(r){s=0}try{o=l.split(".")[1].length}catch(r){o=0}return n=Math.pow(10,Math.max(s,o)),i=s>=o?s:o,((e*n-t*n)/n).toFixed(i)}(parseFloat(s[0].innerText.replace(/Credits: /g,"")),t);e>0&&(s[0].innerText="Credits: "+e.toString())}}await ke(1e4);const o=await ee.fetchApi("/easyuse/stability/balance");if(200==o.status){const e=await o.json();if(null==e?void 0:e.balance){const o=(null==(t=e.balance)?void 0:t.credits)||0;s&&s[0]&&(s[0].innerText="Credits: "+o)}}}));const d=await ee.fetchApi("/easyuse/stability/api_keys");if(200==d.status){let t=await d.json();if(Rs=t.keys,Ms=t.current,Rs.length>0&&void 0!==Ms){const t=Rs[Ms].key,n=Rs[Ms].name;if(t){const t=await ee.fetchApi("/easyuse/stability/user_info");if(200==t.status){const n=await t.json();if((null==n?void 0:n.account)&&(null==n?void 0:n.balance)){const t=(null==(e=n.account)?void 0:e.profile_picture)||null,i=(null==(s=n.account)?void 0:s.email)||null,a=(null==(o=n.balance)?void 0:o.credits)||0;r.replaceChildren(te("div.easyuse-account-user-info",{onclick:e=>{(new Ps).show(r)}},[te("div.user",[te("div.avatar",t?[te("img",{src:t})]:"😀"),te("div.info",[te("h5.name",i),te("h6.remark","Credits: "+a)])]),te("div.edit",{textContent:Ce("Edit")})]))}}}else r.replaceChildren(te("div.easyuse-account-user-info",{onclick:e=>{(new Ps).show(r)}},[te("div.user",[te("div.avatar","😀"),te("div.info",[te("h5.name",n),te("h6.remark",Ce("Click to set the APIKEY first"))])]),te("div.edit",{textContent:Ce("Edit")})]))}}}}}});let Bs=null;function Fs(){Bs&&(Bs.removeEventListeners(),Bs.dropdown.remove(),Bs=null)}function Us(e,t,s,o=!1){Fs(),new zs(e,t,s,o)}class zs{constructor(e,t,s,o=!1){this.dropdown=document.createElement("ul"),this.dropdown.setAttribute("role","listbox"),this.dropdown.classList.add("easy-dropdown"),this.selectedIndex=-1,this.inputEl=e,this.suggestions=t,this.onSelect=s,this.isDict=o,this.focusedDropdown=this.dropdown,this.buildDropdown(),this.onKeyDownBound=this.onKeyDown.bind(this),this.onWheelBound=this.onWheel.bind(this),this.onClickBound=this.onClick.bind(this),this.addEventListeners()}buildDropdown(){this.isDict?this.buildNestedDropdown(this.suggestions,this.dropdown):this.suggestions.forEach(((e,t)=>{this.addListItem(e,t,this.dropdown)}));const e=this.inputEl.getBoundingClientRect();this.dropdown.style.top=e.top+e.height-10+"px",this.dropdown.style.left=e.left+"px",document.body.appendChild(this.dropdown),Bs=this}buildNestedDropdown(e,t){let s=0;Object.keys(e).forEach((o=>{const n=e[o];if("object"==typeof n&&null!==n){const e=document.createElement("ul");e.setAttribute("role","listbox"),e.classList.add("easy-nested-dropdown");const i=document.createElement("li");i.classList.add("folder"),i.textContent=o,i.appendChild(e),i.addEventListener("mouseover",this.onMouseOver.bind(this,s,t)),t.appendChild(i),this.buildNestedDropdown(n,e),s+=1}else{const e=document.createElement("li");e.classList.add("item"),e.setAttribute("role","option"),e.textContent=o,e.addEventListener("mouseover",this.onMouseOver.bind(this,s,t)),e.addEventListener("mousedown",this.onMouseDown.bind(this,o)),t.appendChild(e),s+=1}}))}addListItem(e,t,s){const o=document.createElement("li");o.setAttribute("role","option"),o.textContent=e,o.addEventListener("mouseover",this.onMouseOver.bind(this,t)),o.addEventListener("mousedown",this.onMouseDown.bind(this,e)),s.appendChild(o)}addEventListeners(){document.addEventListener("keydown",this.onKeyDownBound),this.dropdown.addEventListener("wheel",this.onWheelBound),document.addEventListener("click",this.onClickBound)}removeEventListeners(){document.removeEventListener("keydown",this.onKeyDownBound),this.dropdown.removeEventListener("wheel",this.onWheelBound),document.removeEventListener("click",this.onClickBound)}onMouseOver(e,t){t&&(this.focusedDropdown=t),this.selectedIndex=e,this.updateSelection()}onMouseOut(){this.selectedIndex=-1,this.updateSelection()}onMouseDown(e,t){t.preventDefault(),this.onSelect(e),this.dropdown.remove(),this.removeEventListeners()}onKeyDown(e){const t=Array.from(this.focusedDropdown.children),s=t[this.selectedIndex];if(Bs)if(38===e.keyCode)e.preventDefault(),this.selectedIndex=Math.max(0,this.selectedIndex-1),this.updateSelection();else if(40===e.keyCode)e.preventDefault(),this.selectedIndex=Math.min(t.length-1,this.selectedIndex+1),this.updateSelection();else if(39===e.keyCode){if(e.preventDefault(),s&&s.classList.contains("folder")){const e=s.querySelector(".easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=0,this.updateSelection())}}else if(37===e.keyCode&&this.focusedDropdown!==this.dropdown){const e=this.focusedDropdown.closest(".easy-dropdown, .easy-nested-dropdown").parentNode.closest(".easy-dropdown, .easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=Array.from(e.children).indexOf(this.focusedDropdown.parentNode),this.updateSelection())}else if((13===e.keyCode||9===e.keyCode)&&this.selectedIndex>=0){e.preventDefault(),s.classList.contains("item")&&(this.onSelect(t[this.selectedIndex].textContent),this.dropdown.remove(),this.removeEventListeners());const o=s.querySelector(".easy-nested-dropdown");o&&(this.focusedDropdown=o,this.selectedIndex=0,this.updateSelection())}else 27===e.keyCode&&(this.dropdown.remove(),this.removeEventListeners())}onWheel(e){const t=parseInt(this.dropdown.style.top);localStorage.getItem("Comfy.Settings.Comfy.InvertMenuScrolling")?this.dropdown.style.top=t+(e.deltaY<0?10:-10)+"px":this.dropdown.style.top=t+(e.deltaY<0?-10:10)+"px"}onClick(e){this.dropdown.contains(e.target)||e.target===this.inputEl||(this.dropdown.remove(),this.removeEventListeners())}updateSelection(){Array.from(this.focusedDropdown.children).forEach(((e,t)=>{t===this.selectedIndex?e.classList.add("selected"):e.classList.remove("selected")}))}}function js(e){const t=e.min||0,s=e.max||0,o=e.step||1;if(0===o)return[];const n=[];let i=t;for(;i<=s;){if(Number.isInteger(o))n.push(Math.round(i)+"; ");else{let e=i.toFixed(3);-0==e&&(e="0.000"),/\.\d{3}$/.test(e)||(e+="0"),n.push(e+"; ")}i+=o}return s>=0&&t>=0?n:n.reverse()}let Hs={},Ws={};function Ys(e,t){String(e.id);const s=t.name,o=t.value.replace(/^(loader|preSampling):\s/,"");Ws[s]?Ws[s]!=Hs[o]&&(Ws[s]=Hs[o]):Ws={...Ws,[s]:Hs[o]}}$.registerExtension({name:"Comfy.EasyUse.XYPlot",async beforeRegisterNodeDef(e,t,s){if("easy XYPlot"===t.name){Hs=t.input.hidden.plot_dict[0];for(const e in Hs){const t=Hs[e];if(Array.isArray(t)){let s=[];for(const e of t)s.push(e+"; ");Hs[e]=s}else Hs[e]="object"==typeof t?"seed"==e?t+"; ":js(t):t+"; "}Hs.None=[],Hs["---------------------"]=[]}},nodeCreated(e){"easy XYPlot"===e.comfyClass&&(function(e){if(e.widgets)for(const t of e.widgets)if("x_axis"===t.name||"y_axis"===t.name){let s=t.value;Object.defineProperty(t,"value",{get:()=>s,set(o){o!==s&&(s=o,Ys(e,t))}})}}(e),function(e){if(e.widgets){const t=e.widgets.filter((e=>"customtext"===e.type&&!1!==e.dynamicPrompts||e.dynamicPrompts));for(const e of t){let t=function(e,t,o,n){return e&&(t[o]=e),t.map((e=>s(e,n))).filter((e=>""!==e)).join("")},s=function(e,t){if(e=o(e),n(e,t))return e+"; ";let s=i(e,t);return 1===s.length||2===s.length?s[0]:n(a(e),t)?a(e)+"; ":""},o=function(e){return e.replace(/(\n|;| )/g,"")},n=function(e,t){return t.includes(e+"; ")},i=function(e,t){return t.filter((t=>t.toLowerCase().includes(e.toLowerCase())))},a=function(e){return Number(e)?Number(e).toFixed(3):["0","0.","0.0","0.00","00"].includes(e)?"0.000":e};const l=function(){const s=e.name[0]+"_axis";let o=(null==Ws?void 0:Ws[s])||[];if(0===o.length)return;const n=e.inputEl.value,i=e.inputEl.selectionStart;let a=n.split("; ");const l=n.substring(0,i).split("; ").length-1,r=a[l].replace(/\n/g,"").toLowerCase(),d=o.filter((e=>e.toLowerCase().includes(r))).map((e=>e.replace(/; /g,"")));if(d.length>0)Us(e.inputEl,d,(s=>{const n=t(s,a,l,o);e.inputEl.value=n}));else{Fs();const s=t(null,a,l,o);e.inputEl.value=s}};e.inputEl.removeEventListener("input",l),e.inputEl.addEventListener("input",l),e.inputEl.removeEventListener("mouseup",l),e.inputEl.addEventListener("mouseup",l)}}}(e))}});const Vs=v("graphStore",{state:e=>({selectors:[],selectors_styles:{},seg_selectors:[],slider_controls:[]}),actions:{setSelectors(e){this.selectors=_(e)},setStyles(e,t){this.selectors_styles[e]||(this.selectors_styles[e]=t)},setSegSelectors(e){this.seg_selectors=_(e)},setSliderControls(e){this.slider_controls=_(e)}}}),Zs=["data-id"],Xs=[O("i",{class:"mdi mdi-trash-can"},null,-1)],Qs=O("i",{class:"mdi mdi-magnify"},null,-1),Ks=["placeholder"],Js=["onMouseenter","onMouseleave"],qs=["onClick"],$s=["name","checked"],eo=["src"],to={key:0},so=O("span",{class:"comfyui-easyuse-success"},"positive:",-1),oo={key:1},no=O("span",{class:"comfyui-easyuse-error"},"negative:",-1),io="comfyui-easyuse-selector",ao={__name:"stylesSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selectedStyles:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["chooseStyle"],setup(e,{emit:t}){const s=e,o=Vs(),{selectors_styles:n}=b(o),i=k([]);x((e=>s.type),(async e=>{i.value=[],e&&await(async e=>{if(n.value[s.type])return!0;const t=await ee.fetchApi(`/easyuse/prompt/styles?name=${e}`);if(200===t.status){let e=(await t.json()).map(((e,t)=>(e.index=t,e)));return await o.setStyles(s.type,e),!0}return xe.error(Ce("Get styles list Failed")),!1})(e)&&l()}),{immediate:!0});const a=t,l=e=>{const t=s.selectedStyles,o=_(n.value[s.type]);i.value=o.sort(((e,t)=>e.index-t.index)).sort(((e,s)=>t.includes(s.name)-t.includes(e.name)))},r=k(""),d=e=>e.toLowerCase(),u=I({}),c=e=>{u.src="",u.name="",u.positive="",u.negative=""},p=async e=>{const t=await ee.fetchApi(`/easyuse/prompt/styles/image?name=${e}&styles_name=${s.type}`);if(200===t.status){const o=await t.text();if(o.startsWith("http"))return o;return`/easyuse/prompt/styles/image?name=${e}&styles_name=${s.type}`}},h=e=>{e.target.src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QNLaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuMSAoMjAyMzA5MDUubS4yMzE2IDk3OWM4NmQpICAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjA3NEU1QzNCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjA3NEU1QzRCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGMDc0RTVDMUI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGMDc0RTVDMkI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHB8fHx8fHx8fHx8BBwcHDQwNGBAQGBoVERUaHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fH//AABEIAIAAgAMBEQACEQEDEQH/xACLAAEAAgMBAQEAAAAAAAAAAAAABAUCAwYBBwgBAQADAQEBAAAAAAAAAAAAAAABAgMEBQYQAAEEAgECAwUHAwUAAAAAAAEAAgMEEQUhEgYxEwdBYSIyFFFxgVJyIxWRoTOxwdFiJBEBAAICAQQBBAIDAAAAAAAAAAECEQMxIUESBBOB0SIyUXGCIwX/2gAMAwEAAhEDEQA/AP1SgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDXJYgj+d4afsVopM8KWvEcy8it1pXdMcjXO/Lnn+im2u0cwV2VniW1UXEBAQEBAQEBAQEBAQRNlc+mgyDh7zhv+5WunX5Sw37fCHM2dh48r06ank7N6rn2Ja7qa4hw5BBwQV010uK+/DsO29v/J68SOI86Jxjl95HIP4gryPc0fHfHaXu+j7Py68zzHSVquV2iAgICAgICAgICDyTr6HdHz4PTnwypjnqic46OauNbY6mGX99p+L8w9xaeV6OufHt0eXtr59M9VFb194E9LmuH3kf6rv17avO2ets7YVcuuuk/uOa3PgBlxP4BdMbq9nLPqbJ5xDbSM9azFXpyujuSO+Bo5kcf0NPyj25We2YtEzaPxdfr6519Kz+UvqEIlELBKQZQ0eYRwC7HOPxXzVsZ6cPpK5x15ZKEiAgICAgICAgICCNc1tG40CzA2XHg4j4h9zhyFpr22p+s4Z7NNL/ALRlTX+1dVFBJOJrcTI2lxZHYcBx+sldWv3bzOMVn6fZy39OkRnNo+v3aoOx9JOxks8tqwHDPS+1IW8+IzGWZVrf9DZHSMR/j9yvo656zMz9V1rdLqdYwsoVIqwd87mNAc79Tvmd+JXJt332ftMy6temlP1jCasmggICAgICAgICAgwlmiib1SPDB7zhWrWZ4VtaI5QXb2l5ojYHvLjjIGB/dbR61sZlhPtVziFb3PYdd0luCvAZbXludVZ1huZQPgyTx4/atvWj4rxaZ6d/6Ye1/t1zSI6zx/bzti5YqaOpBeg8u41n/oa14cA4ccH7lPs1jZebVn8eyPUtOrXFbR+XdYx9xa90pjeXROaSCXDj+oysZ9S+Mx1bR7uvOJ6LGOWKVgfG8PafAtOQueazHLqraJjMMlCRAQEBAQEBAQRLNp4HTFx/2/4WtKR3Y32T2Udl8j3knk/aeSu6kREPPvaZlpY3DmyY8DyrzPZWv8tkvmFv7bg12RyR1DGeeMj2KnjE9JaeUx1hi1sgaet/U7JIOMcE8Dj7FMREcK2zPKMasr5XO6fmOVt5xEOadVplYU45IAOhxa72kLm2TFuXXqrNeF1WtlwDZeHfmHguO+vHDupszylLJsICAgICAg8cMjCQiYR5IVpFmc1Q5qLXHPgfbhbV2MLaYlqNQAYA4V/kV+PDA1fcp81fjYurtYMu4CmLZRNYhtZWBAI8CqzdaKN8df3LObtIokxwe5ZzZrFUloIGFnLWHqhIgICAgICAgxMbSpyjDAwAq3kr4MTWCnzR4MX02PGHDISNmETqieWba7QABwB4KJumKNgjaFXK0VZYChYQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEHzvuv1G7k1W9s6/Xamtaq15oaonmnsCR008HntaI4K8/s4HOeEGXZXqTud7uqtG7r6kNa5HdMU9aaw9zZde+FkrHsnr1+M2MZBPIKDRe9cO2K2mjs/V0m7X61lWzq32W+ZFEbfkSSO4B+GL9zw4QWm99TqFVmjsaSu7fUtxeNM2aTmSMBbHI9zWHqHVJlnDTxjPKCJL6sea502t1D7Ouhr0rNqxNM2CSNuwnkgjAi6ZOotdEc/Egibf1j/j+7JNL9DWdWg84TWn2ywtdFKyMZb5Tg0nLyG55x48IJ3bXqe/ea/a26dFtyTXtldDUqyOdNL5VqaDHS5gwXRxMe3xz1Y9iDKP1Sa7uefUnR7TyYqUVoEU5jY6pJZIz1RY4ZiMYd7TkexBA749Wr2gtCKlrIpGs17NjK29LLWmPmMsyiFkbIZsPEdKQu6y0eAQWdD1E2L93W1tzRyCDY3paev2NaxVlhIjidMfMb5vmse1kbi9pZ7MeKDt0BAQEBAQfEPU+lFY2++q2K1uSSezTnrReVsTTmiZVYHOd9LVuQyubIwANkbxz4FA7FsQ0NrrLNXX7N0eo1+3darGDYPjb5j6prxVRajjDetsRAjj4yM4CDre2uxO7q2hqtm7nua6w9rp5tfXgoSxwyTOMr42PlrPe4Nc8jJJQRDb3Oz1fYFrcV7As0mu3u7nbWkBZ9LSfG5nlxs/yySWRiNozwcBBx9EXadGTXz62+LG41+jZS6adhzS6vfnlkEjgzEZax7T8ePFBu3nbPdUXqJZsw6S5cqbCW1YdIY2lxhhfEGMjfHtoG9HxucwPEZy4/A7kMC87aq2Kmv7mdvxuqGmklFjUU4G2Yp21rdyW00t+kJkFl88pY9vDgwNDvEoK9np73FBcHdkrt2+rZd5FjQx7O0b8WvbzDKZhN1SSse573QdeAHkN+Ichj3p2rBvZq9vUnY2tcNQPqpZYZpJ44GxXqzHdVlzZZpib73mLHViI85c1BZ6OpsIe/6/XSuntevdsz6+8+pI0/yM1dtWVr2Z644P8rmyuj6S53jxkh9aQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBB/9k="};return(t,o)=>(N(),T("div",{class:R(io+` ${io}-styles`),"data-id":e.id,onMouseleave:c},[i.value.length>0&&e.show?(N(),T(D,{key:0},[O("div",{class:R(io+"__header")},[O("div",{class:R(io+"__header_button"),onClick:o[0]||(o[0]=e=>(a("chooseStyle",[]),void(r.value="")))},Xs,2),O("div",{class:R(io+"__header_search")},[Qs,M(O("textarea",{class:"search","onUpdate:modelValue":o[1]||(o[1]=e=>r.value=e),dir:"ltr",rows:1,placeholder:P(Ce)("Type here to search styles ...")},null,8,Ks),[[G,r.value]])],2)],2),O("div",{class:R(io+"__content"),onMouseleave:l},[(N(!0),T(D,null,B(i.value,((t,o)=>(N(),T("div",{class:R(io+"-item"),key:o,onMouseenter:e=>(async e=>{if(!e.imageSrc){if(e.imageLoading)return;e.imageLoading=!0;const t=await p(e.imgName).finally((()=>e.imageLoading=!1));e.imageSrc=t}u.name="zh-CN"==Ee&&e.name_cn?e.name_cn:e.name,u.positive=e.prompt,u.negative=e.negative_prompt,u.src=e.imageSrc})(t),onMouseleave:F((e=>c()),["stop"])},[O("span",{class:R([io+"-item__tag",{hide:!(e.selectedStyles.includes(t.name)||-1!=d(t.name).indexOf(d(r.value))||t.name_cn&&-1!=d(t.name_cn).indexOf(d(r.value)))}]),onClick:e=>(e=>{let t=s.selectedStyles;t.includes(e.name)?t=t.filter((t=>t!==e.name)):t.push(e.name),a("chooseStyle",t)})(t)},[O("input",{type:"checkbox",name:t.name,checked:e.selectedStyles.includes(t.name)},null,8,$s),O("span",null,U("zh-CN"==P(Ee)&&t.name_cn?t.name_cn:t.name),1)],10,qs)],42,Js)))),128))],34),(null==u?void 0:u.src)?(N(),T("div",{key:0,class:R(io+"-preview")},[O("img",{src:u.src,ref:"image",alt:"preview",onError:h},null,40,eo),O("div",{class:R(io+"-preview__text")},[O("b",null,U(u.name),1),O("div",{class:R(io+"-preview__prompt")},[u.positive?(N(),T("h6",to,[so,O("span",null,U(u.positive),1)])):z("",!0),u.negative?(N(),T("h6",oo,[no,O("span",null,U(u.negative),1)])):z("",!0)],2)],2)],2)):z("",!0)],64)):z("",!0)],42,Zs))}},lo=["data-id"],ro=["onClick"],uo=["name","checked"],co="comfyui-easyuse-selector",po={__name:"segSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selected:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:t}){const s=e,o=k([]);x((e=>s.type),(async e=>{switch(e){case"selfie_multiclass_256x256":o.value=["Background","Hair","Body","Face","Clothes","Others"];break;case"human_parsing_lip":o.value=["Background","Hat","Hair","Glove","Sunglasses","Upper-clothes","Dress","Coat","Socks","Pants","Jumpsuits","Scarf","Skirt","Face","Left-arm","Right-arm","Left-leg","Right-leg","Left-shoe","Right-shoe"]}}),{immediate:!0});const n=t;return(t,i)=>{var a;return N(),T("div",{class:R(co+` ${co}-seg`),"data-id":e.id},[(null==(a=o.value)?void 0:a.length)>0&&e.show?(N(!0),T(D,{key:0},B(o.value,((t,o)=>(N(),T("div",{class:R(co+"-item"),key:o},[O("span",{class:R(co+"-item__tag"),onClick:e=>(e=>{let t=_(s.selected);t.includes(e)?t=t.filter((t=>t!==e)):t.push(e),n("select",t)})(o)},[O("input",{type:"checkbox",name:t,checked:e.selected.includes(o)},null,8,uo),O("span",null,U(P(Ce)(t)),1)],10,ro)],2)))),128)):z("",!0)],10,lo)}}},ho=["data-id"],mo=["onMousedown","onDblclick"],go="comfyui-easyuse-slider",fo="ipadapter layer weights",yo={__name:"sliderControl",props:{id:{type:String|Number,default:""},mode:{type:String,default:""},type:{type:String,default:""},values:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["changeValues","showSlider"],setup(e,{emit:t}){const s=e,o=t,n=(e,t,s)=>(e-t)/(s-t)*100,i=(e,t,o=void 0)=>{if(s.mode===fo){let s={3:2.5,6:1}[t]||0;return{default:12==e?s:0,min:-1,max:3,step:.05,value:void 0!==o?o:12==e?s:0,top:void 0!==o?100-n(o,-1,3)+"%":null,height:void 0!==o?n(o,-1,3)+"%":null}}};x((e=>s.mode),(async(e,t)=>{var n;if(e!==t&&e===fo)if(!t&&(null==(n=s.values)?void 0:n.length)>0){const e=s.values.map((e=>{const t=e.split(":");return i(s.values.length,t[0],parseFloat(t[1]))}));await o("changeValues",e)}else{let e="sd1"==s.type?16:12,t=Array.from({length:e},((t,s)=>i(e,s)));await o("changeValues",t)}o("showSlider")}),{immediate:!0}),x((e=>s.type),((e,t)=>{if(e!=t&&s.mode==fo){let e="sd1"==s.type?16:12,t=Array.from({length:e},((t,s)=>i(e,s)));o("changeValues",t)}}));const a=k(null),l=k(null);return j((()=>{document.onmouseup=e=>document.onmousemove=null})),(t,i)=>{var r;return N(),T("div",{class:R(go),"data-id":e.id},[(null==(r=e.values)?void 0:r.length)>0&&e.show?(N(!0),T(D,{key:0},B(e.values,((t,i)=>(N(),T("div",{class:R([go+"-item",{positive:3==i&&"sdxl"==e.type&&e.mode==fo},{negative:6==i&&"sdxl"==e.type&&e.mode==fo}]),key:i},[O("div",{class:R(go+"-item-input")},U(t.value),3),O("div",{class:R(go+"-item-scroll"),ref_for:!0,ref_key:"scroll",ref:a},[O("div",{class:R(go+"-item-bar"),ref_for:!0,ref_key:"bar",ref:l,style:H({top:t.top||100-n(t.default,t.min,t.max)+"%"}),onMousedown:e=>((e,t,n)=>{let i=e||window.event,r=a.value[n],d=l.value[n],u=_(s.values),c=i.clientY-d.offsetTop;document.onmousemove=e=>{let s=(e||window.event).clientY-c;s<0?s=0:s>r.offsetHeight-d.offsetHeight&&(s=r.offsetHeight-d.offsetHeight);let i=(t.max-t.min)/t.step,a=(r.offsetHeight-d.offsetHeight)/i;s=Math.round(s/a)*a;const l=Math.floor(s/(r.offsetHeight-d.offsetHeight)*100)+"%",p=Math.floor((r.offsetHeight-d.offsetHeight-s)/(r.offsetHeight-d.offsetHeight)*100)+"%",h=parseFloat(parseFloat(t.max-(t.max-t.min)*(s/(r.offsetHeight-d.offsetHeight))).toFixed(2));u[n]={...u[n],top:l,height:p,value:h},o("changeValues",u),window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}})(e,t,i),onDblclick:e=>((e,t,n)=>{let i=_(s.values);i[n]={...i[n],top:null,height:null,value:t.default},o("changeValues",i)})(0,t,i)},null,46,mo),O("div",{class:R(go+"-item-area"),style:H({height:t.height||n(t.default,t.min,t.max)+"%"})},null,6)],2),O("div",{class:R(go+"-item-label")},[O("span",null,U(t.label),1)],2)],2)))),128)):z("",!0)],8,ho)}}},vo={__name:"index",setup(e){const t=Vs(),{selectors:s,seg_selectors:o,slider_controls:n}=b(t),i=k({}),a=async e=>{var o,n,a,l,r,d;await ke(1);const u=Qe(e,"styles"),c=(null==(o=e.properties.values)?void 0:o.length)>0?e.properties.values:[];let p=_(s.value);p.push({id:e.id,type:u.value,value:c,show:!1});const h=p.length-1;await t.setSelectors(p);let m=null==(l=null==(a=null==(n=i.value[e.id])?void 0:n._)?void 0:a.vnode)?void 0:l.el;if(!m)return;let g=e.addDOMWidget("select_styles","btn",m);e.properties.values||e.setProperty("values",[]),p[h].show=!0,await t.setSelectors(p);let f=u.value;Object.defineProperty(u,"value",{set:s=>{f=s,p[h].type=s,e.properties.values=[],p[h].value=[],t.setSelectors(p)},get:e=>f}),Object.defineProperty(g,"value",{set:e=>{setTimeout((s=>{p[h].value=e.split(","),t.setSelectors(p)}),150)},get:t=>{var o,n;return e.properties.values=(null==(n=null==(o=s.value)?void 0:o[h])?void 0:n.value)||[],e.properties.values.join(",")}}),((null==(r=e.size)?void 0:r[0])<150||(null==(d=e.size)?void 0:d[1])<150)&&e.setSize([425,500]);const y=e.onRemoved;e.onRemoved=function(){if(y&&(null==y||y.apply(this,arguments)),void 0!==s.value.findIndex((t=>t.id==e.id))){let e=_(s.value);e.splice(h,1),t.setSelectors(e)}return y}},l=k({}),r=async e=>{var s,n,i,a;await ke(1);const r=Qe(e,"method"),d=(null==(s=e.properties.values)?void 0:s.length)>0?e.properties.values:[];let u=_(o.value);u.push({id:e.id,type:r.value,value:d,show:!1});const c=u.length-1;await t.setSegSelectors(u);let p=null==(a=null==(i=null==(n=l.value[e.id])?void 0:n._)?void 0:i.vnode)?void 0:a.el;if(!p)return;let h=e.addDOMWidget("mask_components","btn",p);e.properties.values||e.setProperty("values",[]),u[c].show=!0,await t.setSegSelectors(u);let m=r.value;Object.defineProperty(r,"value",{set:s=>{m=s,u[c].type=s,e.properties.values=[],u[c].value=[],Ke(e,Qe(e,"confidence"),"selfie_multiclass_256x256"===m),e.setSize([300,"selfie_multiclass_256x256"===m?260:500]),t.setSegSelectors(u)},get:e=>m}),Object.defineProperty(h,"value",{set:e=>{setTimeout((s=>{u[c].value=e.split(","),t.setSegSelectors(u)}),150)},get:t=>{var s;return e.properties.values=(null==(s=o.value)?void 0:s[c].value)||[],e.properties.values.join(",")}}),Ke(e,Qe(e,"confidence"),"selfie_multiclass_256x256"===m),e.setSize([300,"selfie_multiclass_256x256"===m?260:500]);const g=e.onRemoved;e.onRemoved=function(){if(g&&(null==g||g.apply(this,arguments)),void 0!==o.value.findIndex((t=>t.id==e.id))){let e=_(o.value);e.splice(c,1),t.setSegSelectors(e)}return g}},d=k({}),u=async e=>{var s,o,i,a;await ke(1);const l=Qe(e,"mode"),r=Qe(e,"model_type"),u=(null==(s=e.properties.values)?void 0:s.length)>0?e.properties.values:[];let c=_(n.value);c.push({id:e.id,type:r.value,mode:l.value,value:u,show:!1});const p=c.length-1;await t.setSliderControls(c);let h=null==(a=null==(i=null==(o=d.value[e.id])?void 0:o._)?void 0:i.vnode)?void 0:a.el;if(!h)return;let m=e.addDOMWidget("values","btn",h);e.properties.values||e.setProperty("values",[]),Object.defineProperty(m,"value",{set:function(){},get:t=>{var s;const o=(null==(s=n.value)?void 0:s[p].value)||[];return e.properties.values=o.map(((e,t)=>`${t}:${e.value}`)),e.properties.values.join(",")}}),e.setSize("sdxl"==r.value?[375,320]:[455,320]),r.callback=s=>{c=_(n.value),c[p].type!=s&&(e.setSize("sdxl"==s?[375,320]:[455,320]),c[p].value=[],c[p].type=s,t.setSliderControls(c))};const g=e.onRemoved;e.onRemoved=function(){if(g&&(null==g||g.apply(this,arguments)),void 0!==n.value.findIndex((t=>t.id==e.id))){let e=_(n.value);e.splice(p,1),t.setSliderControls(e)}return g}};return j((e=>{$.registerExtension({name:"Comfy.EasyUse.Components",async beforeRegisterNodeDef(e,t){const s=e.prototype.onNodeCreated;"easy stylesSelector"==t.name&&(e.prototype.onNodeCreated=async function(){return s&&(null==s||s.apply(this,arguments)),await a(this),s}),"easy humanSegmentation"==t.name&&(e.prototype.onNodeCreated=async function(){return s&&(null==s||s.apply(this,arguments)),await r(this),s}),"easy sliderControl"==t.name&&(e.prototype.onNodeCreated=async function(){return s&&(null==s||s.apply(this,arguments)),await u(this),s}),"easy poseEditor"==t.name&&(e.prototype.onNodeCreated=async function(){s&&(null==s||s.apply(this,arguments));const e=document.createElement("div");return e.className="comfyui-easyuse-poseEditor",e.innerHTML='
This node is about to be removed, you can use ComfyUI_Custom_Nodes_AlekPet to replace it.
',this.addDOMWidget("editor","btn",e),s})}})})),(e,a)=>(N(),T(D,null,[(N(!0),T(D,null,B(P(s),((e,o)=>(N(),W(ao,{ref_for:!0,ref:t=>{t&&(i.value[e.id]=t)},type:e.type,key:o,id:e.id,show:e.show,selectedStyles:e.value,onChooseStyle:e=>((e,o)=>{let n=_(s.value);n[o].value=e,t.setSelectors(n)})(e,o)},null,8,["type","id","show","selectedStyles","onChooseStyle"])))),128)),(N(!0),T(D,null,B(P(o),((e,s)=>(N(),W(po,{ref_for:!0,ref:t=>{t&&(l.value[e.id]=t)},type:e.type,key:s,id:e.id,show:e.show,selected:e.value,onSelect:e=>((e,s)=>{let n=_(o.value);n[s].value=e,t.setSegSelectors(n)})(e,s)},null,8,["type","id","show","selected","onSelect"])))),128)),(N(!0),T(D,null,B(P(n),((e,s)=>(N(),W(yo,{ref_for:!0,ref:t=>{t&&(d.value[e.id]=t)},type:e.type,key:s,id:e.id,show:e.show,mode:e.mode,values:e.value,onChangeValues:e=>((e,s)=>{let o=_(n.value);o[s].value=e,t.setSliderControls(o)})(e,s),onShowSlider:e=>(e=>{let s=_(n.value);s[e].show=!0,t.setSliderControls(s)})(s)},null,8,["type","id","show","mode","values","onChangeValues","onShowSlider"])))),128))],64))}},_o={class:"no-result-placeholder"},wo={class:"no-result-placeholder-content"},bo={key:0},Ao={__name:"noResultsPlaceholder",props:{icon:{type:String,default:"",required:!1},iconSize:{type:String,default:"3rem",required:!1},title:{type:String,required:!0},message:{type:String,required:!1},buttonLabel:{type:String,default:"",required:!1}},emits:["action"],setup:e=>(t,s)=>(N(),T("div",_o,[Y(P(S),null,{content:V((()=>[O("div",wo,[O("i",{class:R(e.icon),style:H({"font-size":e.iconSize,"margin-bottom":".5rem"})},null,6),O("h3",null,U(e.title),1),e.message?(N(),T("p",bo,U(e.message),1)):z("",!0),e.buttonLabel?(N(),W(P(A),{key:1,label:e.buttonLabel,onClick:s[0]||(s[0]=e=>t.$emit("action")),class:"p-button-text"},null,8,["label"])):z("",!0)])])),_:1})]))},So={class:"left flex-1"},Eo={key:1,class:"edit"},Co={key:2,class:"label"},Lo={class:"right toolbar"},ko={key:0,class:"nodes"},xo={__name:"group",props:{item:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup(e){const t=e,s=Ne(),o=k(!1),n=k(null),i=k(""),a=e=>{var o,n;let i=t.item;if(!(null==(o=i.info)?void 0:o.is_edit)&&(null==(n=i.children)?void 0:n.length)>0){let e=$.canvas.graph._groups.find((e=>e.pos[0]==i.info.pos[0]&&e.pos[1]==i.info.pos[1]));e&&(e.show_nodes=!e.show_nodes,s.setGroups($.canvas.graph._groups))}},l=async()=>{let e=t.item,n=$.canvas.graph._groups.find((t=>t.pos[0]==e.info.pos[0]&&t.pos[1]==e.info.pos[1]));n?(n.is_edit=!1,n.title=i.value,await s.setGroups($.canvas.graph._groups),o.value=!1):o.value=!1};return(r,d)=>{var u,c,p;return N(),T(D,null,[O("div",{class:R("comfyui-easyuse-map-nodes-group"),onClick:a},[O("div",So,[e.item.children?(N(),T("i",{key:0,class:R(["icon",e.item.info.show_nodes?"pi pi-folder-open":"pi pi-folder"]),style:H({color:e.item.info.color})},null,6)):z("",!0),(null==(u=e.item.info)?void 0:u.is_edit)?(N(),T("div",Eo,[Y(P(E),{ref_key:"modifyRef",ref:n,modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=e=>i.value=e),variant:"outline",size:"small",type:"text",onBlur:l,onKeydown:[Z(l,["enter"]),Z(l,["esc"])],style:{width:"100%"}},null,8,["modelValue"])])):(N(),T("div",Co,[O("span",{onDblclick:d[1]||(d[1]=F((a=>(async()=>{var e,a;if(o.value)return;let l=t.item,r=$.canvas.graph._groups.find((e=>e.pos[0]==l.info.pos[0]&&e.pos[1]==l.info.pos[1]));r&&(r.is_edit=!r.is_edit,i.value=r.is_edit?l.info.title:"",await s.setGroups($.canvas.graph._groups),o.value=!0,null==(a=null==(e=n.value)?void 0:e[0])||a.$el.focus())})(e.item)),["stop"]))},U(e.item.info.title),33)]))]),O("div",Lo,[(null==(c=e.item.children)?void 0:c.length)>0?(N(),W(P(A),{key:0,size:"small",icon:e.item.children.find((e=>e.mode==P(fe).ALWAYS))?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:d[2]||(d[2]=F((e=>r.$emit("changeMode")),["stop"])),onMousedown:d[3]||(d[3]=F((e=>r.$emit("mousedown")),["stop"])),onMouseup:d[4]||(d[4]=F((e=>r.$emit("mouseup")),["stop"]))},null,8,["icon"])):z("",!0)])]),(null==(p=e.item.children)?void 0:p.length)>0&&e.item.info.show_nodes?(N(),T("div",ko,[X(r.$slots,"default")])):z("",!0)],64)}}},Io={key:1,class:"label error"},No={class:"right toolbar"},To={__name:"node",props:{node:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup:e=>(t,s)=>(N(),T("div",{draggable:!1,class:R(["comfyui-easyuse-map-nodes-node",{never:void 0!==e.node.mode&&e.node.mode==P(fe).NEVER},{bypass:void 0!==e.node.mode&&e.node.mode==P(fe).BYPASS}])},[void 0!==e.node.title?(N(),T("span",{key:0,class:"label",onDblclick:s[0]||(s[0]=F((t=>P(ot)(e.node.id)),["stop"]))},U(e.node.title),33)):(N(),T("span",Io,U(e.node.type),1)),O("div",No,[Y(P(A),{size:"small",icon:e.node.mode==P(fe).ALWAYS?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:s[1]||(s[1]=F((e=>t.$emit("changeMode")),["stop"])),onMousedown:s[2]||(s[2]=F((e=>t.$emit("mousedown")),["stop"])),onMouseup:s[3]||(s[3]=F((e=>t.$emit("mouseup")),["stop"]))},null,8,["icon"])])],2))},Do={class:"title"},Oo={class:"toolbar"},Ro={key:0},Mo=["onDragstart","onDragend","onDragover"],Go={key:1,class:"no_result",style:{height:"100%"}},Po="comfyui-easyuse-map-nodes",Bo={__name:"nodesMap",emits:["handleHeader"],setup(e){const t=Ne(),{groups_nodes:s,groups:o}=b(t),n=k(!1),i=e=>{n.value=!n.value,$.canvas.graph._groups.forEach((e=>{e.show_nodes=n.value})),t.setGroups($.canvas.graph._groups)};let a,l=0,r=0,d=!1;const u=(e,s=!1)=>{if(d)return void(d=!1);const o=e.children.find((e=>e.mode==fe.ALWAYS)),n=e.children.map((e=>e.id));$.canvas.graph._nodes.forEach((e=>{n.includes(e.id)&&(e.mode=o?s?fe.NEVER:fe.BYPASS:fe.ALWAYS,e.graph.change())})),t.setNodes($.canvas.graph._nodes)},c=(e,s=!1)=>{if(d)return void(d=!1);const o=e.mode==fe.ALWAYS,n=$.canvas.graph._nodes.find((t=>t.id==e.id));n&&(n.mode=o?s?fe.NEVER:fe.BYPASS:fe.ALWAYS,n.graph.change(),t.setNodes($.canvas.graph._nodes))},p=(e,t="group")=>{l=(new Date).getTime(),clearTimeout(a),a=setTimeout((s=>{"group"==t?u(e,!0):c(e,!0)}),500)},h=e=>{r=(new Date).getTime(),r-l>500&&(d=!0),clearTimeout(a)};let m=k(null),g=k(null);k(!1);return(e,a)=>{var l,r;return N(),T("div",{class:R(Po)},[O("div",{class:R(Po+"__header"),onMousedown:a[0]||(a[0]=t=>e.$emit("handleHeader",t))},[O("div",Do,U(P(Ce)("Nodes Map",!0)),1),O("div",Oo,[(null==(l=P(o))?void 0:l.length)>0?M((N(),W(P(A),{key:0,icon:n.value?"pi pi-angle-double-down":"pi pi-angle-double-up",text:"",rounded:"",severity:"secondary",onClick:F(i,["stop"]),size:"small"},null,8,["icon"])),[[P(C),n.value?P(Ce)("Collapse All"):P(Ce)("Expand All"),void 0,{top:!0}]]):z("",!0),X(e.$slots,"icon")])],34),O("div",{class:R(Po+"__content")},[(null==(r=P(s))?void 0:r.length)>0?(N(),T("ol",Ro,[(N(!0),T(D,null,B(P(s),((e,s)=>(N(),T("li",{key:s,onDragstart:e=>((e,t)=>{m.value=t,e.currentTarget.style.opacity="0.6",e.currentTarget.style.border="1px dashed yellow",e.dataTransfer.effectAllowed="move"})(e,s),onDragend:e=>(e=>{if(e.target.style.opacity="1",e.currentTarget.style.border="1px dashed transparent","Manual drag&drop sorting"!==le("EasyUse.NodesMap.Sorting"))return void xe.warn(Ce("For drag and drop sorting, please find Nodes map sorting mode in Settings->EasyUse and change it to manual"));let s=$.canvas.graph._groups,o=s[m.value],n=s[g.value];$.canvas.graph._groups[m.value]=n,$.canvas.graph._groups[g.value]=o,t.setGroups($.canvas.graph._groups)})(e),onDragover:e=>((e,t)=>{e.preventDefault(),e.currentIndex!=m.value&&(g.value=t)})(e,s),draggable:!0},[void 0!==e.children?(N(),W(xo,{key:0,item:e,onChangeMode:t=>u(e),onMousedown:t=>p(e,"group"),onMouseup:h},{default:V((()=>[(N(!0),T(D,null,B(e.children,((e,t)=>(N(),W(To,{key:t,node:e,onChangeMode:t=>c(e),onMousedown:t=>p(e,"node"),onMouseup:h},null,8,["node","onChangeMode","onMousedown"])))),128))])),_:2},1032,["item","onChangeMode","onMousedown"])):(N(),W(To,{key:1,node:e.info,onChangeMode:t=>c(e.info),onMousedown:t=>p(e.info,"node"),onMouseup:h},null,8,["node","onChangeMode","onMousedown"]))],40,Mo)))),128))])):(N(),T("div",Go,[Y(Ao,{icon:"pi pi-sitemap",title:P(Ce)("No Nodes",!0),message:P(Ce)("No nodes found in the map",!0)},null,8,["title","message"])]))],2)])}}},Fo=[O("svg",{class:"icon",t:"1714565543756",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"22538",width:"200",height:"200"},[O("path",{d:"M871.616 64H152.384c-31.488 0-60.416 25.28-60.416 58.24v779.52c0 32.896 26.24 58.24 60.352 58.24h719.232c34.112 0 60.352-25.344 60.352-58.24V122.24c0.128-32.96-28.8-58.24-60.288-58.24zM286.272 512c-23.616 0-44.672-20.224-44.672-43.008 0-22.784 20.992-43.008 44.608-43.008 23.616 0 44.608 20.224 44.608 43.008A43.328 43.328 0 0 1 286.272 512z m0-202.496c-23.616 0-44.608-20.224-44.608-43.008 0-22.784 20.992-43.008 44.608-43.008 23.616 0 44.608 20.224 44.608 43.008a43.456 43.456 0 0 1-44.608 43.008zM737.728 512H435.904c-23.68 0-44.672-20.224-44.672-43.008 0-22.784 20.992-43.008 44.608-43.008h299.264c23.616 0 44.608 20.224 44.608 43.008a42.752 42.752 0 0 1-41.984 43.008z m0-202.496H435.904c-23.616 0-44.608-20.224-44.608-43.008 0-22.784 20.992-43.008 44.608-43.008h299.264c23.616 0 44.608 20.224 44.608 43.008a42.88 42.88 0 0 1-42.048 43.008z","p-id":"22539",fill:"currentColor"})],-1)],Uo=[O("svg",{class:"icon",t:"1714565020764",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7999",width:"200",height:"200"},[O("path",{d:"M810.438503 379.664884l-71.187166-12.777183C737.426025 180.705882 542.117647 14.602496 532.991087 7.301248c-12.777184-10.951872-32.855615-10.951872-47.45811 0-9.12656 7.301248-204.434938 175.229947-206.26025 359.586453l-67.536542 10.951871c-18.253119 3.650624-31.030303 18.253119-31.030303 36.506239v189.832442c0 10.951872 5.475936 21.903743 12.777184 27.379679 7.301248 5.475936 14.602496 9.12656 23.729055 9.12656h5.475936l133.247772-23.729055c40.156863 47.458111 91.265597 73.012478 151.500891 73.012477 60.235294 0 111.344029-27.379679 151.500891-74.837789l136.898396 23.729055h5.475936c9.12656 0 16.427807-3.650624 23.729055-9.12656 9.12656-7.301248 12.777184-16.427807 12.777184-27.379679V412.520499c1.825312-14.602496-10.951872-29.204991-27.379679-32.855615zM620.606061 766.631016H401.568627c-20.078431 0-36.506239 16.427807-36.506238 36.506239v109.518716c0 14.602496 9.12656 29.204991 23.729055 34.680927 14.602496 5.475936 31.030303 1.825312 40.156863-9.126559l16.427807-18.25312 32.855615 80.313726c5.475936 14.602496 18.253119 23.729055 34.680927 23.729055 16.427807 0 27.379679-9.12656 34.680927-23.729055l32.855615-80.313726 16.427807 18.25312c10.951872 10.951872 25.554367 14.602496 40.156863 9.126559 14.602496-5.475936 23.729055-18.253119 23.729055-34.680927v-109.518716c-3.650624-20.078431-20.078431-36.506239-40.156862-36.506239z",fill:"currentColor","p-id":"8000"})],-1)],zo="comfyui-easyuse-toolbar",jo={__name:"index",setup(e){const t=Ne(),s=k(!1);x((e=>s.value),(e=>{e?t.watchGraph(!0):t.unwatchGraph()}));const o=k(null),n=e=>{const t=o.value;var s=e.clientX||0,n=e.clientY||0,i=t.offsetLeft,a=t.offsetTop;function l(e){var o=e.clientX,l=e.clientY,r=o-s,d=l-n;t.style.left=i+r+"px",t.style.top=a+d+"px"}document.addEventListener("mousemove",l),document.addEventListener("mouseup",(function e(){document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",e)}))};return(e,t)=>(N(),T(D,null,[O("div",{class:R(["flex-c",zo])},[O("div",{class:R(["group flex-c",zo+"-icon"]),onClick:t[0]||(t[0]=e=>s.value=!s.value)},Fo,2),O("div",{class:R(["rocket flex-c",zo+"-icon"]),onClick:t[1]||(t[1]=(...e)=>P(Ie)&&P(Ie)(...e))},Uo,2)]),s.value?(N(),T("div",{key:0,ref_key:"nodesMapRef",ref:o,class:R(zo+"-nodes-map")},[Y(Bo,{onHandleHeader:n},{icon:V((()=>[M(Y(P(A),{icon:"pi pi-times",text:"",rounded:"",severity:"secondary",onClick:t[2]||(t[2]=e=>s.value=!1),size:"small"},null,512),[[P(C),P(Ce)("Close"),void 0,{top:!0}]])])),_:1})],2)):z("",!0)],64))}},Ho={__name:"index",setup(e){const t=Ne();return j((e=>{t.getAglTranslation()})),(e,t)=>(N(),T("div",{class:R("comfyui-easyuse-searchbox")}))}},Wo={__name:"index",setup(e){const t=Ne();return j((e=>{t.watchGraph()})),(e,t)=>(N(),T("div",{class:R("comfyui-easyuse-map")},[Y(Bo)]))}},Yo="Comfy.UseNewMenu",Vo={__name:"App",setup(e){const t=k(le(Yo)),s=e=>{$.extensionManager.registerSidebarTab({id:ye,icon:"pi pi-sitemap",title:Ce("Nodes Map",!0),tooltip:Ce("Nodes Map",!0),type:"custom",render:e=>{e.style.height="100%",Q(K(Wo,{}),e)}}),function(e,t=e=>{}){var s;const o=null==(s=$.ui.settings.settingsLookup)?void 0:s[e];o&&(o.onChange=e=>t(e))}(Yo,(e=>{t.value=e}))};return j((e=>{try{s()}catch(t){}})),(e,s)=>(N(),T(D,null,[Y(vo),"Disabled"==t.value?(N(),W(jo,{key:0})):z("",!0),Y(Ho)],64))}},Zo=null==(g=document.getElementsByClassName("graph-canvas-container"))?void 0:g[0],Xo=document.createElement("div");Xo.id="comfyui-easyuse-components",Zo?Zo.append(Xo):document.body.append(Xo);const Qo=J(Vo);Qo.use(q),Qo.use(L()),Qo.mount("#"+Xo.id); +var e;import{$ as t,l as s,a as l,t as a,b as o,s as n,g as i,c as r,u,N as d,j as c,d as p,e as v,f as m,h as g}from"./assets/extensions-DjHfjjgA.js";import{r as y,w as h,e as A,b as f,c as w,I as S,d as x,F as M,C as E,J as b,K as C,L as _,M as k,z as B,G as I,o as N,N as H,D as Q,O as z,E as j,P as D,x as R,Q as L,R as Z,S as Y}from"./assets/vue-DjzFgvDF.js";import{d as O,s as V,a as P,b as G,c as W,T as U,e as F}from"./assets/vendor-DT1J-jWa.js";import{c as T}from"./assets/lodash-CZi7izHi.js";import{P as X}from"./assets/primevue-BSs2m5Wu.js";import"./assets/primeuix-Be3xdh47.js";const J=O("graphStore",{state:e=>({selectors:[],selectors_styles:{},seg_selectors:[],slider_controls:[]}),actions:{setSelectors(e){this.selectors=T(e)},setStyles(e,t){this.selectors_styles[e]||(this.selectors_styles[e]=t)},setSegSelectors(e){this.seg_selectors=T(e)},setSliderControls(e){this.slider_controls=T(e)}}}),q=["data-id"],K=[x("i",{class:"mdi mdi-trash-can"},null,-1)],$=x("i",{class:"mdi mdi-magnify"},null,-1),ee=["placeholder"],te=["onMouseenter","onMouseleave"],se=["onClick"],le=["name","checked"],ae=["src"],oe={key:0},ne=x("span",{class:"comfyui-easyuse-success"},"positive:",-1),ie={key:1},re=x("span",{class:"comfyui-easyuse-error"},"negative:",-1),ue="comfyui-easyuse-selector",de={__name:"stylesSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selectedStyles:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["chooseStyle"],setup(e,{emit:o}){const n=e,i=J(),{selectors_styles:r}=V(i),u=y([]);h((e=>n.type),(async e=>{u.value=[],e&&await(async e=>{if(r.value[n.type])return!0;const s=await l.fetchApi(`/easyuse/prompt/styles?name=${e}`);if(200===s.status){let e=(await s.json()).map(((e,t)=>(e.index=t,e)));return await i.setStyles(n.type,e),!0}return a.error(t("Get styles list Failed")),!1})(e)&&c()}),{immediate:!0});const d=o,c=e=>{const t=n.selectedStyles,s=T(r.value[n.type]);u.value=s.sort(((e,t)=>e.index-t.index)).sort(((e,s)=>t.includes(s.name)-t.includes(e.name)))},p=y(""),v=e=>e.toLowerCase(),m=A({}),g=e=>{m.src="",m.name="",m.positive="",m.negative=""},N=async e=>{const t=await l.fetchApi(`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`);if(200===t.status){const s=await t.text();if(s.startsWith("http"))return s;return`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`}},H=e=>{e.target.src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QNLaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuMSAoMjAyMzA5MDUubS4yMzE2IDk3OWM4NmQpICAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjA3NEU1QzNCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjA3NEU1QzRCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGMDc0RTVDMUI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGMDc0RTVDMkI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHB8fHx8fHx8fHx8BBwcHDQwNGBAQGBoVERUaHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fH//AABEIAIAAgAMBEQACEQEDEQH/xACLAAEAAgMBAQEAAAAAAAAAAAAABAUCAwYBBwgBAQADAQEBAAAAAAAAAAAAAAABAgMEBQYQAAEEAgECAwUHAwUAAAAAAAEAAgMEEQUhEgYxEwdBYSIyFFFxgVJyIxWRoTOxwdFiJBEBAAICAQQBBAIDAAAAAAAAAAECEQMxIUESBBOB0SIyUXGCIwX/2gAMAwEAAhEDEQA/AP1SgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDXJYgj+d4afsVopM8KWvEcy8it1pXdMcjXO/Lnn+im2u0cwV2VniW1UXEBAQEBAQEBAQEBAQRNlc+mgyDh7zhv+5WunX5Sw37fCHM2dh48r06ank7N6rn2Ja7qa4hw5BBwQV010uK+/DsO29v/J68SOI86Jxjl95HIP4gryPc0fHfHaXu+j7Py68zzHSVquV2iAgICAgICAgICDyTr6HdHz4PTnwypjnqic46OauNbY6mGX99p+L8w9xaeV6OufHt0eXtr59M9VFb194E9LmuH3kf6rv17avO2ets7YVcuuuk/uOa3PgBlxP4BdMbq9nLPqbJ5xDbSM9azFXpyujuSO+Bo5kcf0NPyj25We2YtEzaPxdfr6519Kz+UvqEIlELBKQZQ0eYRwC7HOPxXzVsZ6cPpK5x15ZKEiAgICAgICAgICCNc1tG40CzA2XHg4j4h9zhyFpr22p+s4Z7NNL/ALRlTX+1dVFBJOJrcTI2lxZHYcBx+sldWv3bzOMVn6fZy39OkRnNo+v3aoOx9JOxks8tqwHDPS+1IW8+IzGWZVrf9DZHSMR/j9yvo656zMz9V1rdLqdYwsoVIqwd87mNAc79Tvmd+JXJt332ftMy6temlP1jCasmggICAgICAgICAgwlmiib1SPDB7zhWrWZ4VtaI5QXb2l5ojYHvLjjIGB/dbR61sZlhPtVziFb3PYdd0luCvAZbXludVZ1huZQPgyTx4/atvWj4rxaZ6d/6Ye1/t1zSI6zx/bzti5YqaOpBeg8u41n/oa14cA4ccH7lPs1jZebVn8eyPUtOrXFbR+XdYx9xa90pjeXROaSCXDj+oysZ9S+Mx1bR7uvOJ6LGOWKVgfG8PafAtOQueazHLqraJjMMlCRAQEBAQEBAQRLNp4HTFx/2/4WtKR3Y32T2Udl8j3knk/aeSu6kREPPvaZlpY3DmyY8DyrzPZWv8tkvmFv7bg12RyR1DGeeMj2KnjE9JaeUx1hi1sgaet/U7JIOMcE8Dj7FMREcK2zPKMasr5XO6fmOVt5xEOadVplYU45IAOhxa72kLm2TFuXXqrNeF1WtlwDZeHfmHguO+vHDupszylLJsICAgICAg8cMjCQiYR5IVpFmc1Q5qLXHPgfbhbV2MLaYlqNQAYA4V/kV+PDA1fcp81fjYurtYMu4CmLZRNYhtZWBAI8CqzdaKN8df3LObtIokxwe5ZzZrFUloIGFnLWHqhIgICAgICAgxMbSpyjDAwAq3kr4MTWCnzR4MX02PGHDISNmETqieWba7QABwB4KJumKNgjaFXK0VZYChYQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEHzvuv1G7k1W9s6/Xamtaq15oaonmnsCR008HntaI4K8/s4HOeEGXZXqTud7uqtG7r6kNa5HdMU9aaw9zZde+FkrHsnr1+M2MZBPIKDRe9cO2K2mjs/V0m7X61lWzq32W+ZFEbfkSSO4B+GL9zw4QWm99TqFVmjsaSu7fUtxeNM2aTmSMBbHI9zWHqHVJlnDTxjPKCJL6sea502t1D7Ouhr0rNqxNM2CSNuwnkgjAi6ZOotdEc/Egibf1j/j+7JNL9DWdWg84TWn2ywtdFKyMZb5Tg0nLyG55x48IJ3bXqe/ea/a26dFtyTXtldDUqyOdNL5VqaDHS5gwXRxMe3xz1Y9iDKP1Sa7uefUnR7TyYqUVoEU5jY6pJZIz1RY4ZiMYd7TkexBA749Wr2gtCKlrIpGs17NjK29LLWmPmMsyiFkbIZsPEdKQu6y0eAQWdD1E2L93W1tzRyCDY3paev2NaxVlhIjidMfMb5vmse1kbi9pZ7MeKDt0BAQEBAQfEPU+lFY2++q2K1uSSezTnrReVsTTmiZVYHOd9LVuQyubIwANkbxz4FA7FsQ0NrrLNXX7N0eo1+3darGDYPjb5j6prxVRajjDetsRAjj4yM4CDre2uxO7q2hqtm7nua6w9rp5tfXgoSxwyTOMr42PlrPe4Nc8jJJQRDb3Oz1fYFrcV7As0mu3u7nbWkBZ9LSfG5nlxs/yySWRiNozwcBBx9EXadGTXz62+LG41+jZS6adhzS6vfnlkEjgzEZax7T8ePFBu3nbPdUXqJZsw6S5cqbCW1YdIY2lxhhfEGMjfHtoG9HxucwPEZy4/A7kMC87aq2Kmv7mdvxuqGmklFjUU4G2Yp21rdyW00t+kJkFl88pY9vDgwNDvEoK9np73FBcHdkrt2+rZd5FjQx7O0b8WvbzDKZhN1SSse573QdeAHkN+Ichj3p2rBvZq9vUnY2tcNQPqpZYZpJ44GxXqzHdVlzZZpib73mLHViI85c1BZ6OpsIe/6/XSuntevdsz6+8+pI0/yM1dtWVr2Z644P8rmyuj6S53jxkh9aQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBB/9k="};return(l,a)=>(f(),w("div",{class:M(ue+` ${ue}-styles`),"data-id":e.id,onMouseleave:g},[u.value.length>0&&e.show?(f(),w(S,{key:0},[x("div",{class:M(ue+"__header")},[x("div",{class:M(ue+"__header_button"),onClick:a[0]||(a[0]=e=>(d("chooseStyle",[]),void(p.value="")))},K,2),x("div",{class:M(ue+"__header_search")},[$,E(x("textarea",{class:"search","onUpdate:modelValue":a[1]||(a[1]=e=>p.value=e),dir:"ltr",rows:1,placeholder:C(t)("Type here to search styles ...")},null,8,ee),[[b,p.value]])],2)],2),x("div",{class:M(ue+"__content"),onMouseleave:c},[(f(!0),w(S,null,_(u.value,((t,l)=>(f(),w("div",{class:M(ue+"-item"),key:l,onMouseenter:e=>(async e=>{if(!e.imageSrc){if(e.imageLoading)return;e.imageLoading=!0;const t=await N(e.imgName).finally((()=>e.imageLoading=!1));e.imageSrc=t}m.name="zh-CN"==s&&e.name_cn?e.name_cn:e.name,m.positive=e.prompt,m.negative=e.negative_prompt,m.src=e.imageSrc})(t),onMouseleave:k((e=>g()),["stop"])},[x("span",{class:M([ue+"-item__tag",{hide:!(e.selectedStyles.includes(t.name)||-1!=v(t.name).indexOf(v(p.value))||t.name_cn&&-1!=v(t.name_cn).indexOf(v(p.value)))}]),onClick:e=>(e=>{let t=n.selectedStyles;t.includes(e.name)?t=t.filter((t=>t!==e.name)):t.push(e.name),d("chooseStyle",t)})(t)},[x("input",{type:"checkbox",name:t.name,checked:e.selectedStyles.includes(t.name)},null,8,le),x("span",null,B("zh-CN"==C(s)&&t.name_cn?t.name_cn:t.name),1)],10,se)],42,te)))),128))],34),(null==m?void 0:m.src)?(f(),w("div",{key:0,class:M(ue+"-preview")},[x("img",{src:m.src,ref:"image",alt:"preview",onError:H},null,40,ae),x("div",{class:M(ue+"-preview__text")},[x("b",null,B(m.name),1),x("div",{class:M(ue+"-preview__prompt")},[m.positive?(f(),w("h6",oe,[ne,x("span",null,B(m.positive),1)])):I("",!0),m.negative?(f(),w("h6",ie,[re,x("span",null,B(m.negative),1)])):I("",!0)],2)],2)],2)):I("",!0)],64)):I("",!0)],42,q))}},ce=["data-id"],pe=["onClick"],ve=["name","checked"],me="comfyui-easyuse-selector",ge={__name:"segSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selected:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:s}){const l=e,a=y([]);h((e=>l.type),(async e=>{switch(e){case"selfie_multiclass_256x256":a.value=["Background","Hair","Body","Face","Clothes","Others"];break;case"human_parsing_lip":a.value=["Background","Hat","Hair","Glove","Sunglasses","Upper-clothes","Dress","Coat","Socks","Pants","Jumpsuits","Scarf","Skirt","Face","Left-arm","Right-arm","Left-leg","Right-leg","Left-shoe","Right-shoe"]}}),{immediate:!0});const o=s;return(s,n)=>{var i;return f(),w("div",{class:M(me+` ${me}-seg`),"data-id":e.id},[(null==(i=a.value)?void 0:i.length)>0&&e.show?(f(!0),w(S,{key:0},_(a.value,((s,a)=>(f(),w("div",{class:M(me+"-item"),key:a},[x("span",{class:M(me+"-item__tag"),onClick:e=>(e=>{let t=T(l.selected);t.includes(e)?t=t.filter((t=>t!==e)):t.push(e),o("select",t)})(a)},[x("input",{type:"checkbox",name:s,checked:e.selected.includes(a)},null,8,ve),x("span",null,B(C(t)(s)),1)],10,pe)],2)))),128)):I("",!0)],10,ce)}}},ye=["data-id"],he=["onMousedown","onDblclick"],Ae="comfyui-easyuse-slider",fe="ipadapter layer weights",we={__name:"sliderControl",props:{id:{type:String|Number,default:""},mode:{type:String,default:""},type:{type:String,default:""},values:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["changeValues","showSlider"],setup(e,{emit:t}){const s=e,l=t,a=(e,t,s)=>(e-t)/(s-t)*100,o=(e,t,l=void 0)=>{if(s.mode===fe){let s={3:2.5,6:1}[t]||0;return{default:12==e?s:0,min:-1,max:3,step:.05,value:void 0!==l?l:12==e?s:0,top:void 0!==l?100-a(l,-1,3)+"%":null,height:void 0!==l?a(l,-1,3)+"%":null}}};h((e=>s.mode),(async(e,t)=>{var a;if(e!==t&&e===fe)if(!t&&(null==(a=s.values)?void 0:a.length)>0){const e=s.values.map((e=>{const t=e.split(":");return o(s.values.length,t[0],parseFloat(t[1]))}));await l("changeValues",e)}else{let e="sd1"==s.type?16:12,t=Array.from({length:e},((t,s)=>o(e,s)));await l("changeValues",t)}l("showSlider")}),{immediate:!0}),h((e=>s.type),((e,t)=>{if(e!=t&&s.mode==fe){let e="sd1"==s.type?16:12,t=Array.from({length:e},((t,s)=>o(e,s)));l("changeValues",t)}}));const n=y(null),i=y(null);return N((()=>{document.onmouseup=e=>document.onmousemove=null})),(t,o)=>{var r;return f(),w("div",{class:M(Ae),"data-id":e.id},[(null==(r=e.values)?void 0:r.length)>0&&e.show?(f(!0),w(S,{key:0},_(e.values,((t,o)=>(f(),w("div",{class:M([Ae+"-item",{positive:3==o&&"sdxl"==e.type&&e.mode==fe},{negative:6==o&&"sdxl"==e.type&&e.mode==fe}]),key:o},[x("div",{class:M(Ae+"-item-input")},B(t.value),3),x("div",{class:M(Ae+"-item-scroll"),ref_for:!0,ref_key:"scroll",ref:n},[x("div",{class:M(Ae+"-item-bar"),ref_for:!0,ref_key:"bar",ref:i,style:H({top:t.top||100-a(t.default,t.min,t.max)+"%"}),onMousedown:e=>((e,t,a)=>{let o=e||window.event,r=n.value[a],u=i.value[a],d=T(s.values),c=o.clientY-u.offsetTop;document.onmousemove=e=>{let s=(e||window.event).clientY-c;s<0?s=0:s>r.offsetHeight-u.offsetHeight&&(s=r.offsetHeight-u.offsetHeight);let o=(t.max-t.min)/t.step,n=(r.offsetHeight-u.offsetHeight)/o;s=Math.round(s/n)*n;const i=Math.floor(s/(r.offsetHeight-u.offsetHeight)*100)+"%",p=Math.floor((r.offsetHeight-u.offsetHeight-s)/(r.offsetHeight-u.offsetHeight)*100)+"%",v=parseFloat(parseFloat(t.max-(t.max-t.min)*(s/(r.offsetHeight-u.offsetHeight))).toFixed(2));d[a]={...d[a],top:i,height:p,value:v},l("changeValues",d),window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}})(e,t,o),onDblclick:e=>((e,t,a)=>{let o=T(s.values);o[a]={...o[a],top:null,height:null,value:t.default},l("changeValues",o)})(0,t,o)},null,46,he),x("div",{class:M(Ae+"-item-area"),style:H({height:t.height||a(t.default,t.min,t.max)+"%"})},null,6)],2),x("div",{class:M(Ae+"-item-label")},[x("span",null,B(t.label),1)],2)],2)))),128)):I("",!0)],8,ye)}}},Se={__name:"index",setup(e){const t=J(),{selectors:s,seg_selectors:l,slider_controls:a}=V(t),u=y({}),d=async e=>{var l,a,o,r,d,c;await n(1);const p=i(e,"styles"),v=(null==(l=e.properties.values)?void 0:l.length)>0?e.properties.values:[];let m=T(s.value);m.push({id:e.id,type:p.value,value:v,show:!1});const g=m.length-1;await t.setSelectors(m);let y=null==(r=null==(o=null==(a=u.value[e.id])?void 0:a._)?void 0:o.vnode)?void 0:r.el;if(!y)return;let h=e.addDOMWidget("select_styles","btn",y);e.properties.values||e.setProperty("values",[]),m[g].show=!0,await t.setSelectors(m);let A=p.value;Object.defineProperty(p,"value",{set:s=>{A=s,m[g].type=s,e.properties.values=[],m[g].value=[],t.setSelectors(m)},get:e=>A}),Object.defineProperty(h,"value",{set:e=>{setTimeout((s=>{m[g].value=e.split(","),t.setSelectors(m)}),150)},get:t=>{var l,a;return e.properties.values=(null==(a=null==(l=s.value)?void 0:l[g])?void 0:a.value)||[],e.properties.values.join(",")}}),((null==(d=e.size)?void 0:d[0])<150||(null==(c=e.size)?void 0:c[1])<150)&&e.setSize([425,500]);const f=e.onRemoved;e.onRemoved=function(){if(f&&(null==f||f.apply(this,arguments)),void 0!==s.value.findIndex((t=>t.id==e.id))){let e=T(s.value);e.splice(g,1),t.setSelectors(e)}return f}},c=y({}),p=async e=>{var s,a,o,u;await n(1);const d=i(e,"method"),p=(null==(s=e.properties.values)?void 0:s.length)>0?e.properties.values:[];let v=T(l.value);v.push({id:e.id,type:d.value,value:p,show:!1});const m=v.length-1;await t.setSegSelectors(v);let g=null==(u=null==(o=null==(a=c.value[e.id])?void 0:a._)?void 0:o.vnode)?void 0:u.el;if(!g)return;let y=e.addDOMWidget("mask_components","btn",g);e.properties.values||e.setProperty("values",[]),v[m].show=!0,await t.setSegSelectors(v);let h=d.value;Object.defineProperty(d,"value",{set:s=>{h=s,v[m].type=s,e.properties.values=[],v[m].value=[],r(e,i(e,"confidence"),"selfie_multiclass_256x256"===h),e.setSize([300,"selfie_multiclass_256x256"===h?260:500]),t.setSegSelectors(v)},get:e=>h}),Object.defineProperty(y,"value",{set:e=>{setTimeout((s=>{v[m].value=e.split(","),t.setSegSelectors(v)}),150)},get:t=>{var s;return e.properties.values=(null==(s=l.value)?void 0:s[m].value)||[],e.properties.values.join(",")}}),r(e,i(e,"confidence"),"selfie_multiclass_256x256"===h),e.setSize([300,"selfie_multiclass_256x256"===h?260:500]);const A=e.onRemoved;e.onRemoved=function(){if(A&&(null==A||A.apply(this,arguments)),void 0!==l.value.findIndex((t=>t.id==e.id))){let e=T(l.value);e.splice(m,1),t.setSegSelectors(e)}return A}},v=y({}),m=async e=>{var s,l,o,r;await n(1);const u=i(e,"mode"),d=i(e,"model_type"),c=(null==(s=e.properties.values)?void 0:s.length)>0?e.properties.values:[];let p=T(a.value);p.push({id:e.id,type:d.value,mode:u.value,value:c,show:!1});const m=p.length-1;await t.setSliderControls(p);let g=null==(r=null==(o=null==(l=v.value[e.id])?void 0:l._)?void 0:o.vnode)?void 0:r.el;if(!g)return;let y=e.addDOMWidget("values","btn",g);e.properties.values||e.setProperty("values",[]),Object.defineProperty(y,"value",{set:function(){},get:t=>{var s;const l=(null==(s=a.value)?void 0:s[m].value)||[];return e.properties.values=l.map(((e,t)=>`${t}:${e.value}`)),e.properties.values.join(",")}}),e.setSize("sdxl"==d.value?[375,320]:[455,320]),d.callback=s=>{p=T(a.value),p[m].type!=s&&(e.setSize("sdxl"==s?[375,320]:[455,320]),p[m].value=[],p[m].type=s,t.setSliderControls(p))};const h=e.onRemoved;e.onRemoved=function(){if(h&&(null==h||h.apply(this,arguments)),void 0!==a.value.findIndex((t=>t.id==e.id))){let e=T(a.value);e.splice(m,1),t.setSliderControls(e)}return h}};return N((e=>{o.registerExtension({name:"Comfy.EasyUse.Components",async beforeRegisterNodeDef(e,t){const s=e.prototype.onNodeCreated;"easy stylesSelector"==t.name&&(e.prototype.onNodeCreated=async function(){return s&&(null==s||s.apply(this,arguments)),await d(this),s}),"easy humanSegmentation"==t.name&&(e.prototype.onNodeCreated=async function(){return s&&(null==s||s.apply(this,arguments)),await p(this),s}),"easy sliderControl"==t.name&&(e.prototype.onNodeCreated=async function(){return s&&(null==s||s.apply(this,arguments)),await m(this),s}),"easy poseEditor"==t.name&&(e.prototype.onNodeCreated=async function(){s&&(null==s||s.apply(this,arguments));const e=document.createElement("div");return e.className="comfyui-easyuse-poseEditor",e.innerHTML='
This node is about to be removed, you can use ComfyUI_Custom_Nodes_AlekPet to replace it.
',this.addDOMWidget("editor","btn",e),s})}})})),(e,o)=>(f(),w(S,null,[(f(!0),w(S,null,_(C(s),((e,l)=>(f(),Q(de,{ref_for:!0,ref:t=>{t&&(u.value[e.id]=t)},type:e.type,key:l,id:e.id,show:e.show,selectedStyles:e.value,onChooseStyle:e=>((e,l)=>{let a=T(s.value);a[l].value=e,t.setSelectors(a)})(e,l)},null,8,["type","id","show","selectedStyles","onChooseStyle"])))),128)),(f(!0),w(S,null,_(C(l),((e,s)=>(f(),Q(ge,{ref_for:!0,ref:t=>{t&&(c.value[e.id]=t)},type:e.type,key:s,id:e.id,show:e.show,selected:e.value,onSelect:e=>((e,s)=>{let a=T(l.value);a[s].value=e,t.setSegSelectors(a)})(e,s)},null,8,["type","id","show","selected","onSelect"])))),128)),(f(!0),w(S,null,_(C(a),((e,s)=>(f(),Q(we,{ref_for:!0,ref:t=>{t&&(v.value[e.id]=t)},type:e.type,key:s,id:e.id,show:e.show,mode:e.mode,values:e.value,onChangeValues:e=>((e,s)=>{let l=T(a.value);l[s].value=e,t.setSliderControls(l)})(e,s),onShowSlider:e=>(e=>{let s=T(a.value);s[e].show=!0,t.setSliderControls(s)})(s)},null,8,["type","id","show","mode","values","onChangeValues","onShowSlider"])))),128))],64))}},xe={class:"no-result-placeholder"},Me={class:"no-result-placeholder-content"},Ee={key:0},be={__name:"noResultsPlaceholder",props:{icon:{type:String,default:"",required:!1},iconSize:{type:String,default:"3rem",required:!1},title:{type:String,required:!0},message:{type:String,required:!1},buttonLabel:{type:String,default:"",required:!1}},emits:["action"],setup:e=>(t,s)=>(f(),w("div",xe,[z(C(G),null,{content:j((()=>[x("div",Me,[x("i",{class:M(e.icon),style:H({"font-size":e.iconSize,"margin-bottom":".5rem"})},null,6),x("h3",null,B(e.title),1),e.message?(f(),w("p",Ee,B(e.message),1)):I("",!0),e.buttonLabel?(f(),Q(C(P),{key:1,label:e.buttonLabel,onClick:s[0]||(s[0]=e=>t.$emit("action")),class:"p-button-text"},null,8,["label"])):I("",!0)])])),_:1})]))},Ce={class:"left flex-1"},_e={key:1,class:"edit"},ke={key:2,class:"label"},Be={class:"right toolbar"},Ie={key:0,class:"nodes"},Ne={__name:"group",props:{item:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup(e){const t=e,s=u(),l=y(!1),a=y(null),n=y(""),i=e=>{var l,a;let n=t.item;if(!(null==(l=n.info)?void 0:l.is_edit)&&(null==(a=n.children)?void 0:a.length)>0){let e=o.canvas.graph._groups.find((e=>e.pos[0]==n.info.pos[0]&&e.pos[1]==n.info.pos[1]));e&&(e.show_nodes=!e.show_nodes,s.setGroups(o.canvas.graph._groups))}},r=async()=>{let e=t.item,a=o.canvas.graph._groups.find((t=>t.pos[0]==e.info.pos[0]&&t.pos[1]==e.info.pos[1]));a?(a.is_edit=!1,a.title=n.value,await s.setGroups(o.canvas.graph._groups),l.value=!1):l.value=!1};return(u,c)=>{var p,v,m;return f(),w(S,null,[x("div",{class:M("comfyui-easyuse-map-nodes-group"),onClick:i},[x("div",Ce,[e.item.children?(f(),w("i",{key:0,class:M(["icon",e.item.info.show_nodes?"pi pi-folder-open":"pi pi-folder"]),style:H({color:e.item.info.color})},null,6)):I("",!0),(null==(p=e.item.info)?void 0:p.is_edit)?(f(),w("div",_e,[z(C(W),{ref_key:"modifyRef",ref:a,modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=e=>n.value=e),variant:"outline",size:"small",type:"text",onBlur:r,onKeydown:[D(r,["enter"]),D(r,["esc"])],style:{width:"100%"}},null,8,["modelValue"])])):(f(),w("div",ke,[x("span",{onDblclick:c[1]||(c[1]=k((i=>(async()=>{var e,i;if(l.value)return;let r=t.item,u=o.canvas.graph._groups.find((e=>e.pos[0]==r.info.pos[0]&&e.pos[1]==r.info.pos[1]));u&&(u.is_edit=!u.is_edit,n.value=u.is_edit?r.info.title:"",await s.setGroups(o.canvas.graph._groups),l.value=!0,null==(i=null==(e=a.value)?void 0:e[0])||i.$el.focus())})(e.item)),["stop"]))},B(e.item.info.title),33)]))]),x("div",Be,[(null==(v=e.item.children)?void 0:v.length)>0?(f(),Q(C(P),{key:0,size:"small",icon:e.item.children.find((e=>e.mode==C(d).ALWAYS))?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:c[2]||(c[2]=k((e=>u.$emit("changeMode")),["stop"])),onMousedown:c[3]||(c[3]=k((e=>u.$emit("mousedown")),["stop"])),onMouseup:c[4]||(c[4]=k((e=>u.$emit("mouseup")),["stop"]))},null,8,["icon"])):I("",!0)])]),(null==(m=e.item.children)?void 0:m.length)>0&&e.item.info.show_nodes?(f(),w("div",Ie,[R(u.$slots,"default")])):I("",!0)],64)}}},He={key:1,class:"label error"},Qe={class:"right toolbar"},ze={__name:"node",props:{node:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup:e=>(t,s)=>(f(),w("div",{draggable:!1,class:M(["comfyui-easyuse-map-nodes-node",{never:void 0!==e.node.mode&&e.node.mode==C(d).NEVER},{bypass:void 0!==e.node.mode&&e.node.mode==C(d).BYPASS}])},[void 0!==e.node.title?(f(),w("span",{key:0,class:"label",onDblclick:s[0]||(s[0]=k((t=>C(c)(e.node.id)),["stop"]))},B(e.node.title),33)):(f(),w("span",He,B(e.node.type),1)),x("div",Qe,[z(C(P),{size:"small",icon:e.node.mode==C(d).ALWAYS?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:s[1]||(s[1]=k((e=>t.$emit("changeMode")),["stop"])),onMousedown:s[2]||(s[2]=k((e=>t.$emit("mousedown")),["stop"])),onMouseup:s[3]||(s[3]=k((e=>t.$emit("mouseup")),["stop"]))},null,8,["icon"])])],2))},je={class:"title"},De={class:"toolbar"},Re={key:0},Le=["onDragstart","onDragend","onDragover"],Ze={key:1,class:"no_result",style:{height:"100%"}},Ye="comfyui-easyuse-map-nodes",Oe={__name:"nodesMap",emits:["handleHeader"],setup(e){const s=u(),{groups_nodes:l,groups:n}=V(s),i=y(!1),r=e=>{i.value=!i.value,o.canvas.graph._groups.forEach((e=>{e.show_nodes=i.value})),s.setGroups(o.canvas.graph._groups)};let c,v=0,m=0,g=!1;const h=(e,t=!1)=>{if(g)return void(g=!1);const l=e.children.find((e=>e.mode==d.ALWAYS)),a=e.children.map((e=>e.id));o.canvas.graph._nodes.forEach((e=>{a.includes(e.id)&&(e.mode=l?t?d.NEVER:d.BYPASS:d.ALWAYS,e.graph.change())})),s.setNodes(o.canvas.graph._nodes)},A=(e,t=!1)=>{if(g)return void(g=!1);const l=e.mode==d.ALWAYS,a=o.canvas.graph._nodes.find((t=>t.id==e.id));a&&(a.mode=l?t?d.NEVER:d.BYPASS:d.ALWAYS,a.graph.change(),s.setNodes(o.canvas.graph._nodes))},b=(e,t="group")=>{v=(new Date).getTime(),clearTimeout(c),c=setTimeout((s=>{"group"==t?h(e,!0):A(e,!0)}),500)},N=e=>{m=(new Date).getTime(),m-v>500&&(g=!0),clearTimeout(c)};let H=y(null),D=y(null);y(!1);return(e,u)=>{var d,c;return f(),w("div",{class:M(Ye)},[x("div",{class:M(Ye+"__header"),onMousedown:u[0]||(u[0]=t=>e.$emit("handleHeader",t))},[x("div",je,B(C(t)("Nodes Map",!0)),1),x("div",De,[(null==(d=C(n))?void 0:d.length)>0?E((f(),Q(C(P),{key:0,icon:i.value?"pi pi-angle-double-down":"pi pi-angle-double-up",text:"",rounded:"",severity:"secondary",onClick:k(r,["stop"]),size:"small"},null,8,["icon"])),[[C(U),i.value?C(t)("Collapse All"):C(t)("Expand All"),void 0,{top:!0}]]):I("",!0),R(e.$slots,"icon")])],34),x("div",{class:M(Ye+"__content")},[(null==(c=C(l))?void 0:c.length)>0?(f(),w("ol",Re,[(f(!0),w(S,null,_(C(l),((e,l)=>(f(),w("li",{key:l,onDragstart:e=>((e,t)=>{H.value=t,e.currentTarget.style.opacity="0.6",e.currentTarget.style.border="1px dashed yellow",e.dataTransfer.effectAllowed="move"})(e,l),onDragend:e=>(e=>{if(e.target.style.opacity="1",e.currentTarget.style.border="1px dashed transparent","Manual drag&drop sorting"!==p("EasyUse.NodesMap.Sorting"))return void a.warn(t("For drag and drop sorting, please find Nodes map sorting mode in Settings->EasyUse and change it to manual"));let l=o.canvas.graph._groups,n=l[H.value],i=l[D.value];o.canvas.graph._groups[H.value]=i,o.canvas.graph._groups[D.value]=n,s.setGroups(o.canvas.graph._groups)})(e),onDragover:e=>((e,t)=>{e.preventDefault(),e.currentIndex!=H.value&&(D.value=t)})(e,l),draggable:!0},[void 0!==e.children?(f(),Q(Ne,{key:0,item:e,onChangeMode:t=>h(e),onMousedown:t=>b(e,"group"),onMouseup:N},{default:j((()=>[(f(!0),w(S,null,_(e.children,((e,t)=>(f(),Q(ze,{key:t,node:e,onChangeMode:t=>A(e),onMousedown:t=>b(e,"node"),onMouseup:N},null,8,["node","onChangeMode","onMousedown"])))),128))])),_:2},1032,["item","onChangeMode","onMousedown"])):(f(),Q(ze,{key:1,node:e.info,onChangeMode:t=>A(e.info),onMousedown:t=>b(e.info,"node"),onMouseup:N},null,8,["node","onChangeMode","onMousedown"]))],40,Le)))),128))])):(f(),w("div",Ze,[z(be,{icon:"pi pi-sitemap",title:C(t)("No Nodes",!0),message:C(t)("No nodes found in the map",!0)},null,8,["title","message"])]))],2)])}}},Ve=[x("svg",{class:"icon",t:"1714565543756",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"22538",width:"200",height:"200"},[x("path",{d:"M871.616 64H152.384c-31.488 0-60.416 25.28-60.416 58.24v779.52c0 32.896 26.24 58.24 60.352 58.24h719.232c34.112 0 60.352-25.344 60.352-58.24V122.24c0.128-32.96-28.8-58.24-60.288-58.24zM286.272 512c-23.616 0-44.672-20.224-44.672-43.008 0-22.784 20.992-43.008 44.608-43.008 23.616 0 44.608 20.224 44.608 43.008A43.328 43.328 0 0 1 286.272 512z m0-202.496c-23.616 0-44.608-20.224-44.608-43.008 0-22.784 20.992-43.008 44.608-43.008 23.616 0 44.608 20.224 44.608 43.008a43.456 43.456 0 0 1-44.608 43.008zM737.728 512H435.904c-23.68 0-44.672-20.224-44.672-43.008 0-22.784 20.992-43.008 44.608-43.008h299.264c23.616 0 44.608 20.224 44.608 43.008a42.752 42.752 0 0 1-41.984 43.008z m0-202.496H435.904c-23.616 0-44.608-20.224-44.608-43.008 0-22.784 20.992-43.008 44.608-43.008h299.264c23.616 0 44.608 20.224 44.608 43.008a42.88 42.88 0 0 1-42.048 43.008z","p-id":"22539",fill:"currentColor"})],-1)],Pe=[x("svg",{class:"icon",t:"1714565020764",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7999",width:"200",height:"200"},[x("path",{d:"M810.438503 379.664884l-71.187166-12.777183C737.426025 180.705882 542.117647 14.602496 532.991087 7.301248c-12.777184-10.951872-32.855615-10.951872-47.45811 0-9.12656 7.301248-204.434938 175.229947-206.26025 359.586453l-67.536542 10.951871c-18.253119 3.650624-31.030303 18.253119-31.030303 36.506239v189.832442c0 10.951872 5.475936 21.903743 12.777184 27.379679 7.301248 5.475936 14.602496 9.12656 23.729055 9.12656h5.475936l133.247772-23.729055c40.156863 47.458111 91.265597 73.012478 151.500891 73.012477 60.235294 0 111.344029-27.379679 151.500891-74.837789l136.898396 23.729055h5.475936c9.12656 0 16.427807-3.650624 23.729055-9.12656 9.12656-7.301248 12.777184-16.427807 12.777184-27.379679V412.520499c1.825312-14.602496-10.951872-29.204991-27.379679-32.855615zM620.606061 766.631016H401.568627c-20.078431 0-36.506239 16.427807-36.506238 36.506239v109.518716c0 14.602496 9.12656 29.204991 23.729055 34.680927 14.602496 5.475936 31.030303 1.825312 40.156863-9.126559l16.427807-18.25312 32.855615 80.313726c5.475936 14.602496 18.253119 23.729055 34.680927 23.729055 16.427807 0 27.379679-9.12656 34.680927-23.729055l32.855615-80.313726 16.427807 18.25312c10.951872 10.951872 25.554367 14.602496 40.156863 9.126559 14.602496-5.475936 23.729055-18.253119 23.729055-34.680927v-109.518716c-3.650624-20.078431-20.078431-36.506239-40.156862-36.506239z",fill:"currentColor","p-id":"8000"})],-1)],Ge="comfyui-easyuse-toolbar",We={__name:"index",setup(e){const s=u(),l=y(!1);h((e=>l.value),(e=>{e?s.watchGraph(!0):s.unwatchGraph()}));const a=y(null),o=e=>{const t=a.value;var s=e.clientX||0,l=e.clientY||0,o=t.offsetLeft,n=t.offsetTop;function i(e){var a=e.clientX,i=e.clientY,r=a-s,u=i-l;t.style.left=o+r+"px",t.style.top=n+u+"px"}document.addEventListener("mousemove",i),document.addEventListener("mouseup",(function e(){document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",e)}))};return(e,s)=>(f(),w(S,null,[x("div",{class:M(["flex-c",Ge])},[x("div",{class:M(["group flex-c",Ge+"-icon"]),onClick:s[0]||(s[0]=e=>l.value=!l.value)},Ve,2),x("div",{class:M(["rocket flex-c",Ge+"-icon"]),onClick:s[1]||(s[1]=(...e)=>C(v)&&C(v)(...e))},Pe,2)]),l.value?(f(),w("div",{key:0,ref_key:"nodesMapRef",ref:a,class:M(Ge+"-nodes-map")},[z(Oe,{onHandleHeader:o},{icon:j((()=>[E(z(C(P),{icon:"pi pi-times",text:"",rounded:"",severity:"secondary",onClick:s[2]||(s[2]=e=>l.value=!1),size:"small"},null,512),[[C(U),C(t)("Close"),void 0,{top:!0}]])])),_:1})],2)):I("",!0)],64))}},Ue={__name:"index",setup(e){const t=u();return N((e=>{t.watchGraph()})),(e,t)=>(f(),w("div",{class:M("comfyui-easyuse-map")},[z(Oe)]))}},Fe="Comfy.UseNewMenu",Te={__name:"App",setup(e){const s=y(p(Fe));return N((e=>{try{o.extensionManager.registerSidebarTab({id:m,icon:"pi pi-sitemap",title:t("Nodes Map",!0),tooltip:t("Nodes Map",!0),type:"custom",render:e=>{e.style.height="100%",L(Z(Ue,{}),e)}}),g(Fe,(e=>{s.value=e}))}catch(l){}})),(e,t)=>(f(),w(S,null,[z(Se),"Disabled"==s.value?(f(),Q(We,{key:0})):I("",!0)],64))}},Xe=null==(e=document.getElementsByClassName("graph-canvas-container"))?void 0:e[0],Je=document.createElement("div");Je.id="comfyui-easyuse-components",Xe?Xe.append(Je):document.body.append(Je);const qe=Y(Te);qe.use(X),qe.use(F()),qe.mount("#"+Je.id);