From 765462549c2ebbdd2a0aecba5f90281a78c0dc92 Mon Sep 17 00:00:00 2001 From: yolain Date: Fri, 17 Jan 2025 22:17:56 +0800 Subject: [PATCH] New way to display models thumbnail preview images --- __init__.py | 12 ------------ prestartup_script.py | 5 +---- web_version/v2/assets/extensions-B1YS9G41.js | 1 - web_version/v2/assets/extensions-DCfwleBT.js | 1 + web_version/v2/easyuse.js | 4 ++-- 5 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 web_version/v2/assets/extensions-B1YS9G41.js create mode 100644 web_version/v2/assets/extensions-DCfwleBT.js diff --git a/__init__.py b/__init__.py index 369e71a..d64af85 100644 --- a/__init__.py +++ b/__init__.py @@ -65,18 +65,6 @@ if not os.path.exists(example_path): with open(example_path, 'w', encoding='utf-8') as f: json.dump(data, f, indent=4, ensure_ascii=False) - -# Model thumbnails -from .py.libs.add_resources import add_static_resource -from .py.libs.model import easyModelManager -model_config = easyModelManager().models_config -for model in model_config: - paths = folder_paths.get_folder_paths(model) - for path in paths: - if not Path(path).exists(): - continue - add_static_resource(path, path, limit=True) - # get comfyui revision from .py.libs.utils import compare_revision diff --git a/prestartup_script.py b/prestartup_script.py index 83fab82..0719421 100644 --- a/prestartup_script.py +++ b/prestartup_script.py @@ -31,7 +31,4 @@ add_folder_path_and_extensions("mediapipe", [os.path.join(model_path, "mediapipe add_folder_path_and_extensions("inpaint", [os.path.join(model_path, "inpaint")], folder_paths.supported_pt_extensions) add_folder_path_and_extensions("prompt_generator", [os.path.join(model_path, "prompt_generator")], folder_paths.supported_pt_extensions) add_folder_path_and_extensions("t5", [os.path.join(model_path, "t5")], folder_paths.supported_pt_extensions) -add_folder_path_and_extensions("llm", [os.path.join(model_path, "LLM")], folder_paths.supported_pt_extensions) - -add_folder_path_and_extensions("checkpoints_thumb", [os.path.join(model_path, "checkpoints")], image_suffixs) -add_folder_path_and_extensions("loras_thumb", [os.path.join(model_path, "loras")], image_suffixs) \ No newline at end of file +add_folder_path_and_extensions("llm", [os.path.join(model_path, "LLM")], folder_paths.supported_pt_extensions) \ No newline at end of file diff --git a/web_version/v2/assets/extensions-B1YS9G41.js b/web_version/v2/assets/extensions-B1YS9G41.js deleted file mode 100644 index 63e709b..0000000 --- a/web_version/v2/assets/extensions-B1YS9G41.js +++ /dev/null @@ -1 +0,0 @@ -var e,t,s,i,n,o,a,l,r,d,u,c,p,h,m=Object.defineProperty,g=(e,t,s)=>((e,t,s)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);import{d as f,h as y}from"./vendor-DS46y2Fr.js";import{c as _}from"./lodash-CZi7izHi.js";let v=(null==(t=null==(e=window.comfyAPI)?void 0:e.app)?void 0:t.app)||null,b=(null==(i=null==(s=window.comfyAPI)?void 0:s.api)?void 0:i.api)||null,w=(null==(o=null==(n=window.comfyAPI)?void 0:n.ui)?void 0:o.$el)||null,L=(null==(l=null==(a=window.comfyAPI)?void 0:a.dialog)?void 0:l.ComfyDialog)||null,S=(null==(d=null==(r=window.comfyAPI)?void 0:r.widgets)?void 0:d.ComfyWidgets)||null,E=(null==(c=null==(u=window.comfyAPI)?void 0:u.utils)?void 0:c.applyTextReplacements)||null,C=(null==(h=null==(p=window.comfyAPI)?void 0:p.groupNode)?void 0:h.GroupNodeConfig)||null;const k=e=>{var t,s;return e?null==(s=null==(t=null==v?void 0:v.ui)?void 0:t.settings)?void 0:s.getSettingValue(e):null};function A(e,t=null){try{let s=e?k(e):null;return null==s&&(s=t?localStorage[t]:localStorage[e]||null),s}catch(s){return null}}function x(e,t=e=>{}){var s;const i=null==(s=v.ui.settings.settingsLookup)?void 0:s[e];i&&(i.onChange=e=>t(e))}async function I(e,t,s=null){var i,n;try{(null==(n=null==(i=null==v?void 0:v.ui)?void 0:i.settings)?void 0:n.setSettingValue)?v.ui.settings.setSettingValue(e,t):await b.storeSetting(e,t),s&&(localStorage[s]="object"==typeof t?JSON.stringify(t):t)}catch(o){}}const N="comfyui-easyuse-",T="dark-theme",O="#236692",D={PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd",FLOW_CONTROL:"#373780"},R=0x4000000000000,G=["loaders","latent","image","mask","sampling","_for_testing","advanced","utils","api"],M={ALWAYS:0,NEVER:2,BYPASS:4},P="easyuse_nodes_map",F=LGraphCanvas.node_colors.bgcolor,U={ColorPalette:{version:106,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:2,NODE_BOX_OUTLINE_COLOR:O,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:F,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:F,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:F,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:F,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:F,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:F,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:F,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:F,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:F,groupcolor:"#444"}}};let B=JSON.parse(JSON.stringify(U));delete B.NODE_COLORS,B.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mlpZDpiMmM0YTYwOS1iZmE3LWE4NDAtYjhhZS05NzMxNmYzNWRiMjciIHN0RXZ0OndoZW49IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCAyNS4xIChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4OTe6GAAAAx0lEQVR42u3WMQoAIQxFwRzJys77X8vSLiRgITif7bYbgrwYc/mKXyBoY4VVBgsWLFiwYFmOlTv+9jfDOjHmr8u6eVkGCxYsWLBgmc5S8ApewXvgYRksWLBgKXidpeBdloL3wMOCBctgwVLwCl7BuyyDBQsWLFiwTGcpeAWv4D3wsAwWLFiwFLzOUvAuS8F74GHBgmWwYCl4Ba/gXZbBggULFixYprMUvIJX8B54WAYLFixYCl5nKXiXpeA98LBgwTJYsGC9tg1o8f4TTtqzNQAAAABJRU5ErkJggg==",B.ColorPalette.colors.litegraph_base.CLEAR_BACKGROUND_COLOR="#09090b";const z=LGraphCanvas.node_colors.bgcolor,W={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:2,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: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"}}},j={"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 and Shift+Ctrl+Alt+Left/Right to align selected nodes":"启用 Shift+上/下/左/右 和 Shift+Ctrl+Alt+左/右 键对齐选中的节点","Enable Shift+Ctrl+Left/Right key to normalize selected nodes":"启用 Shift+Ctrl+左/右 键规范化选中的节点","Enable Shift+g to add selected nodes to a group":"启用 Shift+g 键将选中的节点添加一个组","Enable Shift+r to unload models and node cache":"启用 Shift+r 键卸载模型和节点缓存","Enable Shift+m to toggle nodes map":"启用 Shift+m 键显隐管理节点组","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":"模型缩略图太多啦,为您关闭了显示","Shift+Up/Down/Left/Right can align selected nodes, Shift+Ctrl+Alt+Left/Right can distribute horizontal/vertical nodes":"Shift+上/下/左/右 可以对齐选中的节点, Shift+Ctrl+Alt+左/右 可以水平/垂直分布节点","Enable Shift+Ctrl+Left key to normalize width and Shift+Ctrl+Right key to normalize height":"启用 Shift+Ctrl+左 键规范化宽度和 Shift+Ctrl+右 键规范化高度","After v1.2.39, Ctrl+g can be used instead of it":"从v1.2.39开始,可以使用Ctrl+g代替","Use three shortcut buttons in the right-click menu":"在右键菜单中使用三个快捷按钮","Enable Nodes Map":"启用节点组管理","You need to refresh the page to update successfully":"您需要刷新页面以成功更新","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:"手套",Glasses:"眼镜",Sunglasses:"太阳镜","Upper-clothes":"上衣","Top-clothes":"上衣","Bottom-clothes":"下身装","Torso-skin":"皮肤",Dress:"连衣裙",Coat:"外套",Socks:"袜子",Pants:"裤子",Jumpsuits:"连体衣",Scarf:"围巾",Skirt:"裙子","Left-arm":"左臂","Right-arm":"右臂","Left-leg":"左腿","Right-leg":"右腿","Left-foot":"左脚","Right-foot":"右脚","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"},V=A("Comfy.Locale"),Y=(e,t=!1)=>{switch(t?navigator.language:V){case"zh-CN":case"zh":return j[e]||e;default:return e}},H={addGroup:{id:"EasyUse.Hotkeys.AddGroup",name:Y("Enable Shift+g to add selected nodes to a group"),tooltip:Y("After v1.2.39, Ctrl+g can be used instead of it"),type:"boolean",defaultValue:!0},cleanVRAMUsed:{id:"EasyUse.Hotkeys.cleanVRAMUsed",name:Y("Enable Shift+r to unload models and node cache"),type:"boolean",defaultValue:!0},toggleSiteMap:{id:"EasyUse.Hotkeys.toggleNodesMap",name:Y("Enable Shift+m to toggle nodes map"),type:"boolean",defaultValue:!0},alignSelectedNodes:{id:"EasyUse.Hotkeys.AlignSelectedNodes",name:Y("Enable Shift+Up/Down/Left/Right key and Shift+Ctrl+Alt+Left/Right to align selected nodes"),tooltip:Y("Shift+Up/Down/Left/Right can align selected nodes, Shift+Ctrl+Alt+Left/Right can distribute horizontal/vertical nodes"),type:"boolean",defaultValue:!0},NormalizeSelectedNodes:{id:"EasyUse.Hotkeys.NormalizeSelectedNodes",name:Y("Enable Shift+Ctrl+Left/Right key to normalize selected nodes"),tooltip:Y("Enable Shift+Ctrl+Left key to normalize width and Shift+Ctrl+Right key to normalize height"),type:"boolean",defaultValue:!0},nodesTemplate:{id:"EasyUse.Hotkeys.NodesTemplate",name:Y("Enable Alt+1~9 to paste nodes from nodes template"),type:"boolean",defaultValue:!0},jumpNearestNodes:{id:"EasyUse.Hotkeys.JumpNearestNodes",name:Y("Enable Up/Down/Left/Right key to jump nearest nodes"),type:"boolean",defaultValue:!0},subDirectories:{id:"EasyUse.ContextMenu.SubDirectories",name:Y("Enable contextMenu auto nest subdirectories"),type:"boolean",defaultValue:!1},modelsThumbnails:{id:"EasyUse.ContextMenu.ModelsThumbnails",name:Y("Enable model thumbnails display"),type:"boolean",defaultValue:!1},modelsThumbnailsLimit:{id:"EasyUse.ContextMenu.ModelsThumbnailsLimit",name:Y("Maximum number of model thumbnails displayed"),tooltip:Y("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:Y("Enable right-click menu to add node A~Z sorting"),type:"boolean",defaultValue:!0},quickOptions:{id:"EasyUse.ContextMenu.QuickOptions",name:Y("Use three shortcut buttons in the right-click menu"),type:"combo",options:["At the forefront","At the end","Disable"],defaultValue:"At the forefront"},nodesRuntime:{id:"EasyUse.Nodes.Runtime",name:Y("Enable nodes runtime display"),type:"boolean",defaultValue:!0},chainGetSet:{id:"EasyUse.Nodes.ChainGetSet",name:Y("Enable chain get node and set node with parent nodes"),type:"boolean",defaultValue:!0},nodesMap:{id:"EasyUse.NodesMap.Sorting",name:Y("Nodes map sorting mode"),tooltip:Y("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"},enableNodesMap:{id:"EasyUse.NodesMap.Enable",name:Y("Enable Nodes Map"),tooltip:Y("You need to refresh the page to update successfully"),type:"boolean",defaultValue:!0}};function X(e=100,t){return new Promise((s=>{setTimeout((()=>{s(t)}),e)}))}function Z(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 i={MM:1,dd:2,yyyy:3,hh:4,mm:5,ss:6};return t.replace(/([Mmdhs]|y{2})\1/g,(t=>e[i[t]]))}const K=/Mac|iPod|iPhone|iPad/.test(navigator.platform),J=e=>K?e.replace(/Ctrl/g,"⌘").replace(/Alt/g,"⌥").replace(/Shift/g,"⇧"):e,$=f("groups",{state:e=>({groups:[],nodes:[],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 i=e.pos,n=!1;for(let s=0;so.pos[0]&&i[0]o.pos[1]&&i[1]e.pos[0]-t.pos[0])).sort(((e,t)=>e.pos[1]-t.pos[1])))},setNodes(e){this.nodes=_(e)},update(){var e,t,s;(((null==(e=v.extensionManager)?void 0:e.activeSidebarTab)||(null==(s=null==(t=v.extensionManager.sidebarTab)?void 0:t.activeSidebarTab)?void 0:s.id))===P||this.isWatching)&&setTimeout((e=>{this.setGroups(v.canvas.graph._groups),this.setNodes(v.canvas.graph._nodes)}),1)},watchGraph(e=!1){e&&(this.isWatching=!0);let t=this;this.update();const s=v.graph.onNodeAdded;v.graph.onNodeAdded=function(e){t.update();const i=e.onRemoved;return e.onRemoved=function(){return t.update(),null==i?void 0:i.apply(this,arguments)},null==s?void 0:s.apply(this,arguments)},v.canvas.onNodeMoved=function(e){t.update()};const i=LGraphCanvas.onNodeAlign;LGraphCanvas.onNodeAlign=function(e){return t.update(),null==i?void 0:i.apply(this,arguments)};const n=LGraphCanvas.onGroupAdd;LGraphCanvas.onGroupAdd=function(){return t.update(),null==n?void 0:n.apply(this,arguments)};const o=LGraphCanvas.onGroupAlign;LGraphCanvas.onGroupAlign=function(e){return t.update(),null==o?void 0:o.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}}});let q=null;const Q=["custom_obsidian","custom_obsidian_dark","custom_milk_white","obsidian_dark","obsidian","milk_white"],ee={"easy positive":"green","easy negative":"red","easy promptList":"cyan","easy promptLine":"cyan","easy promptConcat":"cyan","easy promptReplace":"cyan","easy forLoopStart":"blue","easy forLoopEnd":"blue","easy loadImagesForLoop":"blue"};let te=LGraphCanvas.node_colors,se=null,ie=null,ne=null,oe=null;for(let ms in H){const e="Disabled"==A("Comfy.UseNewMenu")?"👽 "+J(H[ms].name):J(H[ms].name),t=H[ms].tooltip?J(H[ms].tooltip):"";ae={...H[ms],name:e,tooltip:t},v.ui.settings.settingsLookup[ae.id]||v.ui.settings.addSetting(ae)}var ae;function le(e,t=!1){let s="after",i="before";t&&([i,s]=[s,i]),e.label=(e.label??e.name).replace(i,s),e.name=e.label}function re(e,t,s,i,n,o,a){t.strokeStyle=i,t.fillStyle=LiteGraph.use_legacy_node_error_indicator?"#F00":n;const l=LiteGraph.NODE_TITLE_HEIGHT,r=this.ds.scale<.5,{collapsed:d}=e.flags,u=e._shape||e.constructor.shape||LiteGraph.ROUND_SHAPE,{title_mode:c}=e.constructor,p=c!=LiteGraph.TRANSPARENT_TITLE&&c!=LiteGraph.NO_TITLE;let h=new Float32Array(4);h=[0,p?-l:0,s[0]+1,p?s[1]+l:s[1]];let m=t.globalAlpha;if(t.lineWidth=1,t.beginPath(),u==LiteGraph.BOX_SHAPE||r?t.fillRect(h[0],h[1],h[2],h[3]):u==LiteGraph.ROUND_SHAPE||u==LiteGraph.CARD_SHAPE?t.roundRect(h[0],h[1],h[2],h[3],u==LiteGraph.CARD_SHAPE?[this.round_radius,this.round_radius,0,0]:[this.round_radius]):u==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=i,t.fill(),e.has_errors&&!LiteGraph.use_legacy_node_error_indicator&&this.strokeShape(t,h,{shape:u,title_mode:c,title_height:l,padding:12,colour:LiteGraph.NODE_ERROR_COLOUR,collapsed:d,thickness:10}),!d&&p&&(t.shadowColor="transparent",t.fillStyle="rgba(0,0,0,0.2)",t.fillRect(0,-1,h[2],2)),t.shadowColor="transparent",e.onDrawBackground&&e.onDrawBackground(t,this,this.canvas,this.graph_mouse),p||c==LiteGraph.TRANSPARENT_TITLE){const n="dark"==function(e){let t=e.replace("#","");return s=parseInt(t.substring(0,2),16),i=parseInt(t.substring(2,4),16),n=parseInt(t.substring(4,6),16),.299*s+.587*i+.114*n>127.5?"light":"dark";var s,i,n}((null==e?void 0:e.color)||"#ffffff");if(e.onDrawTitleBar)e.onDrawTitleBar(t,l,s,this.ds.scale,i);else if(c!=LiteGraph.TRANSPARENT_TITLE&&(e.constructor.title_color||this.render_title_colored)){let n=e.constructor.title_color||i;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(),u==LiteGraph.BOX_SHAPE||r?t.rect(0,-l,s[0]+1,l):u!=LiteGraph.ROUND_SHAPE&&u!=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 p=10;if(e.onDrawTitleBox)e.onDrawTitleBox(t,l,s,this.ds.scale);else if(u==LiteGraph.ROUND_SHAPE||u==LiteGraph.CIRCLE_SHAPE||u==LiteGraph.CARD_SHAPE){const s=n?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR,i=n?"#eeeeee":e.boxcolor||a||LiteGraph.NODE_DEFAULT_BOXCOLOR;t.fillStyle=o?s:i,t.beginPath(),t.fillRect(10,0-1.05*p-1,1.1*p,.125*p),t.fillRect(10,0-1.45*p-1,1.1*p,.125*p),t.fillRect(10,0-1.85*p-1,1.1*p,.125*p)}else t.fillStyle=e.boxcolor||a||LiteGraph.NODE_DEFAULT_BOXCOLOR,t.fillRect(.5*(l-p),-.5*(l+p),p,p);if(t.globalAlpha=m,e.onDrawTitleText&&e.onDrawTitleText(t,l,s,this.ds.scale,this.title_text_font,o),!r){t.font=this.title_text_font;const s=e.getTitle()??`❌ ${e.type}`,i=String(s)+(e.pinned?"📌":"");i&&(t.fillStyle=o?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(i),t.fillText(i.substr(0,20),l,LiteGraph.NODE_TITLE_TEXT_Y-l),t.textAlign="left"):(t.textAlign="left",t.fillText(i,l,LiteGraph.NODE_TITLE_TEXT_Y-l)))}if(!d&&e.subgraph&&!e.skip_subgraph_button){let s=LiteGraph.NODE_TITLE_HEIGHT,i=e.size[0]-s,n=LiteGraph.isInsideRectangle(this.graph_mouse[0]-e.pos[0],this.graph_mouse[1]-e.pos[1],i+2,2-s,s-4,s-4);t.fillStyle=n?"#888":"#555",u==LiteGraph.BOX_SHAPE||r?t.fillRect(i+2,2-s,s-4,s-4):(t.beginPath(),t.roundRect(i+2,2-s,s-4,s-4,[4]),t.fill()),t.fillStyle="#333",t.beginPath(),t.moveTo(i+.2*s,.6*-s),t.lineTo(i+.8*s,.6*-s),t.lineTo(i+.5*s,.3*-s),t.fill()}e.onDrawTitle&&e.onDrawTitle(t)}if(o){e.onBounding&&e.onBounding(h),c==LiteGraph.TRANSPARENT_TITLE&&(h[1]-=l,h[3]+=l),t.lineWidth=2,t.globalAlpha=.8,t.beginPath();let n=0,o=0,a=1;u==LiteGraph.BOX_SHAPE?t.rect(n+h[0],n+h[1],o+h[2],o+h[3]):u==LiteGraph.ROUND_SHAPE||u==LiteGraph.CARD_SHAPE&&e.flags.collapsed?t.roundRect(n+h[0],n+h[1],o+h[2],o+h[3],[this.round_radius*a]):u==LiteGraph.CARD_SHAPE?t.roundRect(n+h[0],n+h[1],o+h[2],o+h[3],[this.round_radius*a,a,this.round_radius*a,a]):u==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=i,t.globalAlpha=1}e.execute_triggered>0&&e.execute_triggered--,e.action_triggered>0&&e.action_triggered--}function de(e,t,s,i){var n,o;if(!e.widgets||!e.widgets.length)return 0;let a=e.size[0],l=(e.size[1],e.widgets);t+=2;let r=LiteGraph.NODE_WIDGET_HEIGHT,d=this.ds.scale>.5;s.save(),s.globalAlpha=this.editor_alpha;let u=LiteGraph.WIDGET_OUTLINE_COLOR,c=LiteGraph.WIDGET_BGCOLOR,p=LiteGraph.WIDGET_TEXT_COLOR,h=LiteGraph.WIDGET_SECONDARY_TEXT_COLOR,m=12;for(let f=0;f1&&(a=1),s.fillStyle=y.options.hasOwnProperty("slider_color")?y.options.slider_color:i==y?u:O,s.beginPath(),s.roundRect(m,_,a*(v-24),r,[.25*r]),s.fill(),y.marker){let e=(y.marker-y.options.min)/t;e<0&&(e=0),e>1&&(e=1),s.fillStyle=y.options.hasOwnProperty("marker_color")?y.options.marker_color:"#AA9",s.roundRect(m+e*(v-24),_,2,r,[.25*r])}if(d){s.textAlign="center",s.fillStyle=p;let e=(y.label||y.name)+" : "+Number(y.value).toFixed(null!=y.options.precision?y.options.precision:3);s.fillText(e,.5*v,_+.7*r)}break;case"number":case"combo":if(s.textAlign="left",s.strokeStyle=u,s.fillStyle=c,s.beginPath(),d?s.roundRect(m,_,v-24,r,[.25*r]):s.rect(m,_,v-24,r),s.fill(),d){y.disabled||s.stroke(),s.fillStyle=p,y.disabled||(s.beginPath(),s.moveTo(24,_+6.5),s.lineTo(18,_+.5*r),s.lineTo(24,_+r-6.5),s.fill(),s.beginPath(),s.moveTo(v-m-12,_+6.5),s.lineTo(v-m-6,_+.5*r),s.lineTo(v-m-12,_+r-6.5),s.fill()),s.fillStyle=h,s.font="10px Inter",s.fillText(y.label||y.name,29,_+.7*r),s.fillStyle=p,s.textAlign="right";let e=6;if("number"==y.type)s.font="10px Inter",s.fillText(Number(y.value).toFixed(void 0!==y.options.precision?y.options.precision:3),v-24-e,_+.7*r);else{let t=y.value;if(y.options.values){let e=y.options.values;e.constructor===Function&&(e=e()),e&&e.constructor!==Array&&(t=e[y.value])}const i=v-48-(s.measureText(y.label||y.name).width+24),n=s.measureText(t).width;if(n>i){const e="…",o=s.measureText(e).width,a=s.measureText("a").width;if(i<=o)t="․";else{t=`${t}`;if(n+o-i+3*a>i){const e=i+3*a,s=Math.floor((e-o)/a);t=t.substr(0,s)}for(;s.measureText(t).width+o>i;)t=t.substr(0,t.length-1);t+=e}}s.fillText(t,v-24-e,_+.7*r)}}break;case"string":case"text":if(s.textAlign="left",s.strokeStyle=u,s.fillStyle=c,s.beginPath(),d?s.roundRect(m,_,v-24,r,[.25*r]):s.rect(m,_,v-24,r),s.fill(),d){y.disabled||s.stroke(),s.save(),s.beginPath(),s.rect(m,_,v-24,r),s.clip(),s.fillStyle=h;const e=y.label||y.name;s.font="10px Inter",null!=e&&s.fillText(e,24,_+.7*r),s.fillStyle=p,s.textAlign="right",s.fillText(String(y.value).substr(0,30),v-24,_+.7*r),s.restore()}break;default:y.draw&&y.draw(s,e,v,_,r)}t+=(y.computeSize?y.computeSize(v)[1]:r)+4,s.globalAlpha=this.editor_alpha}s.restore(),s.textAlign="left"}function ue(e,t,s,i,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),q||(q=$()),q.update()},i=LGraphCanvas.active_canvas;if(!i.selected_nodes||Object.keys(i.selected_nodes).length<=1)s(n);else for(var o in i.selected_nodes)s(i.selected_nodes[o])},parentMenu:i,node:n}),!1}function ce(e,t,s,i,n){if(!n)throw"no node for color";var o=[];for(var a in o.push({value:null,content:"No color"}),LGraphCanvas.node_colors){var l=LGraphCanvas.node_colors[a];e={value:a,content:""+a+""};o.push(e)}return new LiteGraph.ContextMenu(o,{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),q||(q=$()),q.update()},i=LGraphCanvas.active_canvas;if(!i.selected_nodes||Object.keys(i.selected_nodes).length<=1)s(n);else for(var o in i.selected_nodes)s(i.selected_nodes[o]);n.setDirtyCanvas(!0,!0)},parentMenu:i,node:n}),!1}function pe(e,t,s,i,n){var o=e.property||"title",a=n[o],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=o;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[o]=t,l.parentNode&&l.parentNode.removeChild(l);n.setDirtyCanvas(!0,!0),q||(q=$());q.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)}))}v.registerExtension({name:"Comfy.EasyUse.UI",init(){var e,t;const s="Comfy.CustomColorPalettes",i="Comfy.Settings.Comfy.CustomColorPalettes";if(ie||(ie=A(s,i)),ne||(ne=A("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 X(1),Object.assign(v.canvas.default_connection_color_byType,D),Object.assign(LGraphCanvas.link_type_colors,D)),"custom_milk_white"==e.value&&document.body.classList.remove(T)})),setTimeout((e=>he(A("Comfy.UseNewMenu")||"Disabled")),1);const t=null==(e=v.ui.settings.settingsLookup)?void 0:e["Comfy.UseNewMenu"];t&&(t.onChange=e=>he(e))},async nodeCreated(e){var t;if(ee.hasOwnProperty(e.comfyClass)){const t=ee[e.comfyClass],s=te[t];if(!s)return;s.color&&(e.color=s.color),s.bgcolor&&(e.bgcolor=s.bgcolor)}if(se||(se=A("Comfy.WidgetControlMode")),"before"==se){const s="before"==se;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 le(t,s),t.linkedWidgets))for(const e of t.linkedWidgets)await le(e,s)}}});const he=e=>{var t;const s=(null==(t=document.getElementById("crystools-root"))?void 0:t.children)||null,i=A("Comfy.Workflow.WorkflowTabsPosition",null);if((null==s?void 0:s.length)>0&&i)if(oe||(oe=document.getElementById("MonitorUI")),"Disabled"==e){document.getElementById("crystools-root").appendChild(oe)}else{let e=document.getElementById("crystools-root-easyuse");if(e)e.appendChild(oe);else{const e=document.getElementsByClassName("comfyui-menu-right");e.length>0&&e[0].before(w("div",{id:"crystools-root-easyuse"},oe))}}};let me={};const ge=(e,t)=>e.widgets.find((e=>e.name===t)),fe=(e,t,s=!1,i="")=>{var n;if(!t||((e,t)=>!!e.inputs&&e.inputs.some((e=>e.name===t)))(e,t.name))return;me[t.name]||(me[t.name]={origType:t.type,origComputeSize:t.computeSize});const o=e.size;t.type=s?me[t.name].origType:"easyHidden"+i,t.computeSize=s?me[t.name].origComputeSize:()=>[0,-4],null==(n=t.linkedWidgets)||n.forEach((i=>fe(e,i,":"+t.name,s)));const a=s?Math.max(e.computeSize()[1],o[1]):e.size[1];e.setSize([e.size[0],a])},ye=(e,t=0)=>{var s,i;if(e)return(null==(s=e.widgets)?void 0:s[t])?e.widgets[t].value:e.widgets_values?null==(i=e.widgets_values)?void 0:i[t]:void 0},_e=e=>e.setSize([e.size[0],e.computeSize()[1]]),ve=(e,t)=>graph.getNodeById(e),be=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 we(e,t,s){return e+(i=s,(.5-.5*Math.cos(Math.PI*i))*(t-e));var i}const Le=(e,t=!0)=>{var s,i;const n=(null==(i=null==(s=e.graph)?void 0:s.list_of_graphcanvas)?void 0:i[0])||null;if(!n)return;const[o,a]=e.pos,[l,r]=e.size;(([e,t],s)=>{const i=s.ds,n=document.body.clientWidth,o=document.body.clientHeight,a=i.scale,l=.5*n/a-e,r=.5*o/a-t,d=Date.now()+250,u=i.offset[0],c=i.offset[1],p=()=>{const e=d-Date.now();if(!(Date.now(){const t=ve(e);t&&Le(t)},Ee=(e,t=(()=>graph.links??[])())=>t[e],Ce=e=>e.toLowerCase().replace(/_./g,(e=>e.replace("_","").toUpperCase())),ke=e=>"easy getNode"===e.type,Ae=e=>"easy setNode"===e.type,xe=e=>ke(e)||Ae(e),Ie=(e=(()=>graph._nodes??[])())=>e.filter((e=>xe(e)));let Ne={},Te={};const Oe=(e,t,s=0)=>{e.widgets_values||(e.widgets_values=[]),e.widgets_values[s]=t,e.widgets[s].value=t},De=e=>graph.add(e),Re=e=>graph.remove(e),Ge=(e,t=0)=>{var s,i;if("Reroute"!==e.type)return[e,t];const n=e,o=null==(i=null==(s=n.inputs)?void 0:s[0])?void 0:i.link;if(!o)return[n,t];const a=Ee(o);if(!a)return[n,t];const l=ve(a.origin_id);return l?(setTimeout((()=>{Re(n)})),Ge(l,a.origin_slot)):[n,t]},Me=e=>{var t,s,i;if("Reroute"!==e.type)return e;const n=e,o=null==(s=null==(t=n.outputs)?void 0:t[0])?void 0:s.links;if(!o)return n;const a=o[0];if(!a)return n;const l=Ee(a);if(!l)return n;const r=ve(l.target_id);return r?(1===(null==(i=n.outputs[0].links)?void 0:i.length)&&setTimeout((()=>{Re(n)})),Me(r)):n},Pe=(e,t="width")=>{var s;const i=e[0],n="width"==t?0:1,o=null==(s=i.size)?void 0:s[n];o&&(e.forEach((e=>{e.size[n]=o})),LGraphCanvas.active_canvas.setDirty(!0,!0))},Fe=(e,t="horizontal")=>{if(e.length<3)return;const s="horizontal"===t?0:1;e.sort(((e,t)=>e.pos[s]-t.pos[s]));const i=Math.min(...e.map((e=>e.pos[s]))),n=(Math.max(...e.map((e=>e.pos[s]+e.size[s])))-i-e.reduce(((e,t)=>e+t.size[s]),0))/(e.length-1);let o=i;e.forEach((e=>{e.pos[s]=o,o+=e.size[s]+n})),LGraphCanvas.active_canvas.setDirty(!0,!0)};const Ue=new class{constructor(){g(this,"element",w(`div.${N}toast`)),g(this,"children",HTMLElement),g(this,"container",document.body),this.container.appendChild(this.element)}async show(e){let t=w(`div.${N}toast-container`,[w("div",[w("span",[...e.icon?[w("i",{className:e.icon})]:[],w("span",e.content)])])]);t.setAttribute("toast-id",e.id),this.element.replaceChildren(t),this.container.appendChild(this.element),await X(64),t.style.marginTop=`-${t.offsetHeight}px`,await X(64),t.classList.add("show"),e.duration&&(await X(e.duration),this.hide(e.id))}async hide(e){const t=document.querySelector(`.${N}toast > [toast-id="${e}"]`);(null==t?void 0:t.classList.contains("show"))&&(t.classList.remove("show"),await X(750)),t&&t.remove()}async clearAllMessages(){let e=document.querySelector(`.${N}container`);e&&(e.innerHTML="")}async info(e,t=3e3,s=[]){this.show({id:"toast-info",icon:`mdi mdi-information ${N}theme`,content:e,duration:t})}async success(e,t=3e3){this.show({id:"toast-success",icon:`mdi mdi-check-circle ${N}success`,content:e,duration:t})}async error(e,t=3e3){this.show({id:"toast-error",icon:`mdi mdi-close-circle ${N}error`,content:e,duration:t})}async warn(e,t=3e3){this.show({id:"toast-warn",icon:`mdi mdi-alert-circle ${N}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")}},Be=["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","encode"],ze=["LIGHT - SD1.5 only (low strength)","STANDARD (medium strength)","VIT-G (medium strength)","REGULAR - FLUX and SD3.5 only (high strength)","PLUS (high strength)","PLUS (kolors genernal)","PLUS FACE (portraits)","FULL FACE - SD1.5 only (portraits stronger)","COMPOSITION"],We=["FACEID","FACEID PLUS - SD1.5 only","FACEID PLUS V2","FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"],je=["easy seed","easy latentNoisy","easy wildcards","easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingSdTurbo","easy preSamplingCascade","easy preSamplingDynamicCFG","easy preSamplingLayerDiffusion","easy fullkSampler","easy fullCascadeKSampler"],Ve=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy hyditLoader","easy pixArtLoader"],Ye=["easy imageSize","easy imageSizeBySide","easy imageSizeByLongerSide","easy imageSizeShow","easy imageRatio","easy imagePixelPerfect"],He=["easy forLoopStart","easy forLoopEnd","easy whileLoopStart","easy whileLoopEnd"],Xe=["easy anythingIndexSwitch","easy imageIndexSwitch","easy textIndexSwitch","easy conditioningIndexSwitch"],Ze=["easy anythingInversedSwitch"],Ke=["easy loadImagesForLoop",...He,...Xe,...Ze],Je={"easy anythingInversedSwitch":"out","easy anythingIndexSwitch":"value","easy imageIndexSwitch":"image","easy textIndexSwitch":"text","easy conditioningIndexSwitch":"cond"};let $e=null;function qe(e,t){const s=e.comfyClass;let i=t.value;switch(t.name){case"range_mode":fe(e,ge(e,"step"),"step"==i),fe(e,ge(e,"num_steps"),"num_steps"==i),_e(e);break;case"text_combine_mode":fe(e,ge(e,"replace_text"),"replace"==i);break;case"lora_name":["lora_model_strength","lora_clip_strength"].map((t=>fe(e,ge(e,t),"None"!==i)));break;case"resolution":"自定义 x 自定义"===i&&(t.value="width x height (custom)"),["empty_latent_width","empty_latent_height","width","height"].map((t=>fe(e,ge(e,t),"width x height (custom)"===i)));break;case"ratio":["empty_latent_width","empty_latent_height"].map((t=>fe(e,ge(e,t),"custom"===i)));break;case"num_loras":var n=i+1,o=ge(e,"mode").value;for(let t=0;tfe(e,ge(e,t),"simple"!==o)));for(let t=n;t<21;t++)["lora_"+t+"_name","lora_"+t+"_strength","lora_"+t+"_model_strength","lora_"+t+"_clip_strength"].map((t=>fe(e,ge(e,t),!1)));_e(e);break;case"num_controlnet":n=i+1,o=ge(e,"mode").value;for(let t=0;tfe(e,ge(e,t),!0))),["start_percent_"+t,"end_percent_"+t].map((t=>fe(e,ge(e,t),"simple"!==o)));for(let t=n;t<21;t++)["controlnet_"+t,"controlnet_"+t+"_strength","scale_soft_weight_"+t,"start_percent_"+t,"end_percent_"+t].map((t=>fe(e,ge(e,t),!1)));_e(e);break;case"mode":switch(null==e?void 0:e.comfyClass){case"easy loraStack":n=ge(e,"num_loras").value+1,o=i;for(let t=0;tfe(e,ge(e,t),"simple"!==o)));_e(e);break;case"easy controlnetStack":n=ge(e,"num_controlnet").value+1,o=i;for(let t=0;tfe(e,ge(e,t),"simple"!==o)));_e(e);break;case"easy icLightApply":o=i;["lighting","remove_bg"].map((t=>fe(e,ge(e,t),"Foreground"===o))),fe(e,ge(e,"source"),"Foreground"!==o),_e(e)}break;case"toggle":t.type="toggle",t.options={on:"Enabled",off:"Disabled"};break;case"t5_type":["clip_name","padding"].map((t=>fe(e,ge(e,t),"sd3"==i))),["t5_name","device","dtype"].map((t=>fe(e,ge(e,t),"t5v11"==i))),_e(e);break;case"preset":if("FLUX.1-dev"==i&&(t.value="REGULAR - FLUX and SD3.5 only (high strength)"),ze.includes(i)){let t=ge(e,"use_tiled");fe(e,ge(e,"lora_strength")),fe(e,ge(e,"provider"),!!["REGULAR - FLUX and SD3.5 only (high strength)"].includes(i)),fe(e,ge(e,"weight_faceidv2")),fe(e,ge(e,"weight_kolors")),fe(e,ge(e,"use_tiled"),!0),fe(e,ge(e,"sharpening"),t&&t.value)}else We.includes(i)&&(fe(e,ge(e,"weight_faceidv2"),!!["FACEID PLUS V2","FACEID PLUS KOLORS"].includes(i)),fe(e,ge(e,"weight_kolors"),!!["FACEID PLUS KOLORS"].includes(t.value)),["FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"].includes(i)?fe(e,ge(e,"lora_strength"),!1):fe(e,ge(e,"lora_strength"),!0),fe(e,ge(e,"provider"),!0),fe(e,ge(e,"use_tiled")),fe(e,ge(e,"sharpening")));_e(e);break;case"use_tiled":fe(e,ge(e,"sharpening"),!!i),_e(e);break;case"num_embeds":n=i+1;for(let t=0;tfe(e,ge(e,t),!1)));break;case"brushnet_random":case"brushnet_segmentation":["dtype","scale","start_at","end_at"].map((t=>fe(e,ge(e,t),!0))),["fitting","function"].map((t=>fe(e,ge(e,t),!1)));break;case"powerpaint":["dtype","fitting","function","scale","start_at","end_at"].map((t=>fe(e,ge(e,t),!0)))}_e(e);break;case"encode":fe(e,ge(e,"noise_mask"),!!["inpaint_model_conditioning","different_diffusion"].includes(i)),_e(e);break;case"image_output":fe(e,ge(e,"link_id"),!!["Sender","Sender&Save"].includes(i)),fe(e,ge(e,"decode_vae_name"),!!["Hide","Hide&Save"].includes(i)),["save_prefix","output_path","embed_workflow","number_padding","overwrite_existing"].map((t=>fe(e,ge(e,t),!!["Save","Hide&Save","Sender&Save"].includes(i))));break;case"add_noise":var a=ge(e,"control_before_generate"),l=ge(e,"control_after_generate")||a;"disable"===i?(fe(e,ge(e,"seed")),l&&(l.last_value=l.value,l.value="fixed",fe(e,l))):("enable"===i&&(t.value="enable (CPU)"),fe(e,ge(e,"seed"),!0),l&&((null==l?void 0:l.last_value)&&(l.value=l.last_value),fe(e,l,!0))),_e(e);break;case"guider":switch(i){case"Basic":case"IP2P+Basic":["cfg_negative"].map((t=>fe(e,ge(e,t))));break;case"CFG":case"IP2P+CFG":fe(e,ge(e,"cfg"),!0),fe(e,ge(e,"cfg_negative"));break;case"DualCFG":case"IP2P+DualCFG":["cfg","cfg_negative"].map((t=>fe(e,ge(e,t),!0)))}_e(e);break;case"scheduler":["karrasADV","exponentialADV","polyExponential"].includes(i)?(["sigma_max","sigma_min"].map((t=>fe(e,ge(e,t),!0))),["denoise","beta_d","beta_min","eps_s","coeff"].map((t=>fe(e,ge(e,t))),!1),fe(e,ge(e,"rho"),"exponentialADV"!=i)):"vp"==i?(["sigma_max","sigma_min","denoise","rho","coeff"].map((t=>fe(e,ge(e,t)))),["beta_d","beta_min","eps_s"].map((t=>fe(e,ge(e,t),!0)))):(["sigma_max","sigma_min","beta_d","beta_min","eps_s","rho"].map((t=>fe(e,ge(e,t)))),fe(e,ge(e,"coeff"),"gits"==i),fe(e,ge(e,"denoise"),!0)),_e(e);break;case"conditioning_mode":["replace","concat","combine"].includes(i)?["average_strength","old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>fe(e,ge(e,t)))):"average"==i?(fe(e,ge(e,"average_strength"),!0),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>fe(e,ge(e,t),!1)))):"timestep"==i&&(["average_strength"].map((t=>fe(e,ge(e,t),!1))),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>fe(e,ge(e,t),!0))));break;case"rescale":ge(e,"rescale_after_model").value,fe(e,ge(e,"width"),"to Width/Height"===i),fe(e,ge(e,"height"),"to Width/Height"===i),fe(e,ge(e,"percent"),"by percentage"===i),fe(e,ge(e,"longer_side"),"to longer side - maintain aspect"===i),_e(e);break;case"upscale_method":["factor","crop"].map((t=>fe(e,ge(e,t),"None"!==i)));break;case"target_parameter":switch(s){case"easy XYInputs: Steps":["first_step","last_step"].map((t=>fe(e,ge(e,t),"steps"==i))),["first_start_step","last_start_step"].map((t=>fe(e,ge(e,t),"start_at_step"==i))),["first_end_step","last_end_step"].map((t=>fe(e,ge(e,t),"end_at_step"==i)));break;case"easy XYInputs: Sampler/Scheduler":let t=ge(e,"input_count").value+1;for(let s=0;sfe(e,ge(e,t),"strength"==i))),["first_start_percent","last_start_percent"].map((t=>fe(e,ge(e,t),"start_percent"==i))),["first_end_percent","last_end_percent"].map((t=>fe(e,ge(e,t),"end_percent"==i))),["strength","start_percent","end_percent"].map((t=>fe(e,ge(e,t),i!=t))),_e(e)}case"replace_count":n=i+1;for(let t=0;tfe(e,ge(e,t),!r)));for(let t=n;t<11;t++)["lora_name_"+t,"model_str_"+t,"clip_str_"+t].map((t=>fe(e,ge(e,t),!1)));_e(e);break;case"ckpt_count":n=i+1;var d=-1!=ge(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=ge(e,"input_mode").value.indexOf("VAE");for(let t=0;tfe(e,ge(e,t),!1)));_e(e);break;case"input_count":n=i+1;var c=ge(e,"target_parameter").value;for(let t=0;tfe(e,ge(e,s),!!t)));["model_strength","clip_strength"].map((s=>fe(e,ge(e,s),!t)));break;case"easy XYInputs: Checkpoint":n=ge(e,"ckpt_count").value+1,d=-1!=ge(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=ge(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,i;const n=(null==(i=null==(t=this.outputs[1])?void 0:t.links)?void 0:i.length)>0?this.outputs[1].links[0]:null,o=s.graph._nodes.find((e=>{var t;return null==(t=e.inputs)?void 0:t.find((e=>e.link==n))}));if(n&&o){const t=o.inputs.find((e=>e.link==n)).widget.name,s=o.widgets.find((e=>e.name==t));let i=(null==s?void 0:s.options.values)||null;i&&(i=i.join("\n"),e.value=i)}else Ue.error(Y("No COMBO link"),3e3)}),{serialize:!1})}),Ve.includes(t.name)){let t=function(e){var t="";for(let s=0;se.name===t+"_prompt")),i="comfy-multiline-input wildcard_"+t+"_"+this.id.toString();if(-1==s&&e){const s=document.createElement("textarea");s.className=i,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(i);e&&e[0]&&e[0].remove()}}};e.prototype.onExecuted=function(e){null==l||l.apply(this,arguments);const i=t(e.positive),n=t(e.negative);s.call(this,i,"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(){o&&o.apply(this,[]);const e=this.widgets.find((e=>"easing_mode"==e.name)),s=this.widgets.find((e=>"batch_size"==e.name)),i=this.widgets.find((e=>"scheduler"==e.name));setTimeout((n=>{i.value||(i.value=t(e.value,s.value,i.inputEl))}),1),e.callback=e=>{i.value=t(e,s.value,i.inputEl)},s.callback=s=>{i.value=t(e.value,s,i.inputEl)}}}if(je.includes(i)&&(e.prototype.onNodeCreated=async function(){o&&o.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),i=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"!=i.value&&(i.value="fixed"),e.value=Math.floor(Math.random()*R),s.queuePrompt(0,1)}),{serialize:!1});e.linkedWidgets=[t,i]}},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()*R))}),1)}),"easy convertAnything"==i&&(e.prototype.onNodeCreated=async function(){o&&o.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"==i){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 i=s.callback;s.callback=(...e)=>{t(this),i&&i.apply(s,[...e])},setTimeout((e=>{t(this)}),1)}}if(Ke.includes(i)){const t=e=>{switch(i){case"easy forLoopStart":return 0;case"easy forLoopEnd":return 1}},s=e=>{switch(i){case"easy forLoopStart":return 2;case"easy forLoopEnd":return 0}};e.prototype.onNodeCreated=async function(){if("easy loadImagesForLoop"==i&&(this.outputs[0].shape=5),He.includes(i)){const e=this.inputs.findIndex((e=>"flow"===e.name)),n=this.outputs.findIndex((e=>"flow"===e.name));if(-1!==e&&(this.inputs[e].shape=5),-1!==n&&(this.outputs[n].shape=5),"easy whileLoopStart"==i||"easy whileLoopEnd"==i)return;this.inputs=this.inputs.filter(((e,s)=>s<=t())),this.outputs=this.outputs.filter(((e,t)=>t<=s())),_e(this)}return Xe.includes(i)&&("easy textIndexSwitch"==i&&(this.widgets=this.widgets.filter(((e,t)=>t<=2))),this.inputs=this.inputs.filter(((e,t)=>t<=1)),_e(this)),null==o?void 0:o.apply(this,arguments)},e.prototype.onConnectionsChange=function(e,n,o,a){var l,r;if("easy whileLoopStart"!=i&&"easy whileLoopEnd"!=i&&a)if(1==e){let e=this.inputs.every((e=>null!==e.link)),s=this.inputs.filter((e=>!["condition","index","total"].includes(e.name)));if(He.includes(i)){if(e){if(s.length>=10)return void Ue.warn(Y("The maximum number of inputs is 10"));let e=s[s.length-1],t=parseInt(e.name.split("initial_value")[1])+1;if(this.inputs.find((e=>e.name==="initial_value"+t)))return;let i="initial_value"+t,n="value"+t;this.addInput(i,"*"),this.addOutput(n,"*")}else if(!o){const e=t();let s=this.inputs.findLastIndex((e=>e.link));if(n>=e&&(-1===s||n>=s)){let e=this.inputs[n];if(!e.name||["condition","total"].includes(e.name))return;let t=parseInt(e.name.split("initial_value")[1])+1,s=this.inputs.findIndex((e=>e.name==="initial_value"+t)),i=this.outputs.findIndex((e=>e.name==="value"+t));-1!==s&&this.removeInput(s),-1!==i&&this.removeOutput(i)}}}else if(Xe.includes(i))if(e){if(s.length>=10)return void Ue.warn(Y("The maximum number of inputs is 10"));let e=Je[i]+s.length;this.addInput(e,"*")}else o||n==this.inputs.length-2&&this.removeInput(n+1)}else if(2==e){let e=this.outputs.filter((e=>!["flow","index"].includes(e.name))),t=e.every((e=>{var t;return(null==(t=e.links)?void 0:t.length)>0}));if(He.includes(i)){if(t){if(e.length>=10)return void Ue.warn(Y("The maximum number of inputs is 10"));let t=e[e.length-1],s=parseInt(t.name.split("value")[1])+1;if(this.inputs.find((e=>e.name==="initial_value"+s)))return;if(this.outputs.find((e=>e.name==="value"+s)))return;let i="initial_value"+s,n="value"+s;this.addInput(i,"*"),this.addOutput(n,"*")}else if(!o){const e=s();let t=a.origin_slot,i=this.outputs.findLastIndex((e=>{var t;return(null==(t=e.links)?void 0:t.length)>0}));if(t>=e&&(-1===i||t>=i)){let e=this.outputs[t];if(!e.name||["flow","index"].includes(e.name))return;let s=parseInt(e.name.split("value")[1])+1,i=this.inputs.findIndex((e=>e.name==="initial_value"+s)),n=this.outputs.findIndex((e=>e.name==="value"+s));if(-1!==i&&(null==(l=this.inputs[i])?void 0:l.link))return;-1!==i&&this.removeInput(i),-1!==n&&this.removeOutput(n)}}}else if(Ze.includes(i))if(t){if(e.length>=10)return void Ue.warn(Y("The maximum number of inputs is 10"));let t=Je[i]+e.length;this.addOutput(t,"*")}else if(!o){let t=a.origin_slot;t==this.outputs.length-2&&0==(null==(r=e[t].links)?void 0:r.length)&&this.removeOutput(t+1)}}}}["easy fluxLoader","easy fullLoader"].includes(i)&&(e.prototype.onConnectionsChange=async function(e,t){var s,i,n,o;r&&r.apply(this,[]);const a=this.inputs.find((e=>"model_override"===e.name)),l=this.inputs.find((e=>"vae_override"===e.name));if(ge(this,"vae_name"),ge(this,"ckpt_name"),$e||($e=await b.getNodeDefs()),(null==a?void 0:a.link)&&0==t){const e=null==(o=null==(n=null==(i=null==(s=null==$e?void 0:$e.CheckpointLoaderSimple)?void 0:s.input)?void 0:i.required)?void 0:n.ckpt_name)?void 0:o[0];setTimeout((t=>{this.widgets[0].value=e[0],this.widgets_values[0]=e[0],fe(this,ge(this,"ckpt_name"),!(null==a?void 0:a.link))}),1)}else fe(this,ge(this,"ckpt_name"),!(null==a?void 0:a.link));(null==l?void 0:l.link)&&2==t?setTimeout((e=>{this.widgets[1].value="Baked VAE",this.widgets_values[1]="Baked VAE",fe(this,ge(this,"vae_name"),!(null==l?void 0:l.link))}),1):fe(this,ge(this,"vae_name"),!(null==l?void 0:l.link))})},nodeCreated(e){if(e.comfyClass.startsWith("easy ")){if(e.widgets)for(const s of e.widgets){if(!Be.includes(s.name))continue;let t=s.value;qe(e,s),Object.defineProperty(s,"value",{get:e=>t,set(i){i!==t&&(t=i,qe(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("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=>{"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(Ye.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)}))}}}});const Qe=LiteGraph.LGraphNode;v.registerExtension({name:"easy bookmark",registerCustomNodes(){class e extends Qe{constructor(){super("🔖"),g(this,"type","easy bookmark"),g(this,"title","🔖"),g(this,"slot_start_y",-20),g(this,"___collapsed_width",0),g(this,"isVirtualNode",!0),g(this,"serialize_widgets",!0),g(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=v.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=v.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"}}),v.registerExtension({name:"Comfy.EasyUse.ChainNode",init(){v.canvas._mousemove_callback=e=>{A("EasyUse.Nodes.ChainGetSet",null)&&((e=!1,t={})=>{var s,i,n,o,a;const l=Ie();if(!l||l.length<1)return;const r=be();if(0===r.length)return;let d=t.inputX||160,u=t.ouputX||60;if(r.filter((e=>xe(e))).length>1)return;for(const p of r){let o=t.inputY||10,a=t.outputY||30;const l=[],c=p.id;if(p.graph){Ne[c]||(Ne[c]=[]);for(const e of p.inputs??[]){const t=e.link;if(!t)continue;const{origin_id:s,target_slot:i}=Ee(t),n=ve(s);if(!n)continue;if(!xe(n))continue;let a=p.getConnectionPos(!0,i);Ne[c][i]||(Ne[c][i]=a),!Ne[c]||Ne[c][i][1]===a[1]&&Ne[c][i][0]===a[0]||(d=a[0]-Ne[c][i][0],o=a[1]-Ne[c][i][1],n.pos=[n.pos[0]+d,n.pos[1]+o]),Ne[c][i]=a,l.push(n)}Te[c]||(Te[c]=[]);for(const e of p.outputs??[])if(e.links&&p.graph)for(const t of e.links){const{target_id:e,target_slot:i,origin_slot:n}=Ee(t),o=ve(e);if(!o)continue;if(!xe(o))continue;const r=null==(s=o.outputs)?void 0:s.links;if((null==r?void 0:r.length)>1)return;const d=p.getConnectionPos(!1,n);Te[c][n]||(Te[c][n]=d),!Te[c]||Te[c][n][0]===d[0]&&Te[c][n][1]===d[1]||(u=d[0]-Te[c][n][0],a=d[1]-Te[c][n][1],o.pos=[o.pos[0]+u,o.pos[1]+a]),Te[c][n]=d,l.push(o)}if(e&&1===r.length){const e=[p,...l];(null==(n=null==(i=p.graph)?void 0:i.list_of_graphcanvas)?void 0:n[0]).selectNodes(e)}}}const c=r[0];if(!c)return;(null==(a=null==(o=c.graph)?void 0:o.list_of_graphcanvas)?void 0:a[0]).setDirty(!0,!0)})()};const e=LGraphCanvas.prototype.showLinkMenu;LGraphCanvas.prototype.showLinkMenu=function(t,s){return s.shiftKey?(((e,t=!1)=>{var s,i,n,o,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=ve(h),_=ve(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&&(xe(y)||xe(_)))return!1;let v=Ce((null==(s=_.getInputInfo(f))?void 0:s.name)??p.toLowerCase());v||(v=Ce((null==(n=null==(i=null==y?void 0:y.outputs)?void 0:i[g])?void 0:n.name)??(null==(a=null==(o=null==y?void 0:y.outputs)?void 0:o[g])?void 0:a.type.toString())??v+`_from_${h}_to_${m}`));let b,w=!1,L=!1;if(xe(y))v=ye(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=ve((null==(d=Ee(t))?void 0:d.target_id)??-1);e&&xe(e)&&Ae(e)&&(v=ye(e),L=!0)}if(!L){for(const e of Ie()){if(v!==ye(e)||!Ae(e))continue;const t=null==(u=e.inputs[0])?void 0:u.link;(null==(c=Ee(t))?void 0:c.origin_id)===y.id?L=!0:w=!0}w&&(v+=`_from_${h}_to_${m}`)}}if(!L){b=LiteGraph.createNode("easy setNode"),b.is_auto_link=!0;const e=y.getConnectionPos(!1,g);b.pos=[e[0]+20,e[1]],b.inputs[0].name=v,b.inputs[0].type=p,b.inputs[0].widget=_.inputs[f].widget,Oe(b,v),De(b),b.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,b,0),y.widgets_values=t,"PrimitiveNode"===y.type&&setTimeout((()=>{if(y){y.connect(g,b,0);for(const[e,s]of t.entries())Oe(y,s,e);null!==b&&b.setSize(b.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,s]),!1)}}});const et=async()=>{try{const{Running:e,Pending:t}=await b.getQueue();if(e.length>0||t.length>0)return void Ue.error(Y("Clean Failed")+":"+Y("Please stop all running tasks before cleaning GPU"));200==(await b.fetchApi("/easyuse/cleangpu",{method:"POST"})).status?Ue.success(Y("Clean SuccessFully")):Ue.error(Y("Clean Failed"))}catch(e){}};let tt=[];function st(e,t,s,i,n){var o=LGraphCanvas.active_canvas,a=o.getCanvasWindow(),l=o.graph;if(l)return function e(t,i){var r=LiteGraph.getNodeTypesCategories(o.filter||l.filter).filter((function(e){return e.startsWith(t)})),d=[];r.map((function(s){if(s){var i=new RegExp("^("+t+")"),n=s.replace(i,"").split("/")[0],o=""===t?n+"/":t+n+"/",a=n;-1!=a.indexOf("::")&&(a=a.split("::")[1]),-1===d.findIndex((function(e){return e.value===o}))&&d.push({value:o,content:a,has_submenu:!0,callback:function(t,s,i,n){e(t.value,n)}})}})),LiteGraph.getNodeTypesInCategory(t.slice(0,-1),o.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,i){var a=i.getFirstEvent();o.graph.beforeChange();var l=LiteGraph.createNode(e.value);l&&(l.pos=o.convertEventToCanvasOffset(a),o.graph.add(l)),n&&n(l),o.graph.afterChange()}};d.push(t)}}));const u=A("EasyUse.ContextMenu.NodesSort",null);""===t&&u&&(d=function(e){let t=[],s=[];return e.forEach((e=>{(null==e?void 0:e.value)&&G.includes(e.value.split("/")[0])?t.push(e):s.push(e)})),[{title:Y("ComfyUI Basic"),is_category_title:!0},...t,{title:Y("Others A~Z"),is_category_title:!0},...s.sort(((e,t)=>e.content.localeCompare(t.content)))]}(d)),new LiteGraph.ContextMenu(d,{event:s,parentMenu:i},a)}("",i),!1}v.registerExtension({name:"Comfy.EasyUse.ContextMenu",async setup(){LGraphCanvas.onMenuAdd=st;const e=A("EasyUse.ContextMenu.ModelsThumbnails",null),t=A("EasyUse.ContextMenu.ModelsThumbnailsLimit",null);if(e&&t>0){const e=await b.fetchApi(`/easyuse/models/thumbnail?limit=${t}`);if(200===e.status){let t=await e.json();tt=t}else Ue.error(Y("Too many thumbnails, have closed the display"))}const s=LiteGraph.ContextMenu;LiteGraph.ContextMenu=function(e,t){if(A("EasyUse.ContextMenu.SubDirectories",null)&&(null==t?void 0:t.callback)&&!e.some((e=>"string"!=typeof e))){const i=function(e,t){const s=e,i=[...s],n={},o=[],a=[],l=["ckpt","pt","bin","pth","safetensors"];if((null==e?void 0:e.length)>0){const t=at(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 ")?o.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(i.find((e=>e.endsWith(t.content)),s))},r=(e,t="")=>{const i=t?t+"\\"+ot(e):ot(e),n=at(e),o=(new Date).getTime();let a,r="";if(l.includes(n))for(let s=0;s{let s=[],i=[];const o=e.map((e=>{const o={},a=e.indexOf("/")>-1?"/":"\\",l=e.split(a);if(l.length>1){const e=l.shift();o[e]=o[e]||[],o[e].push(l.join(a))}if(Object.values(n).length>0){let t=Object.keys(o)[0];t&&o[t]?s.push({key:t,value:o[t][0]}):i.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])}}))),...i]}return o};for(const[t,i]of Object.entries(n))d.push({content:t,has_submenu:!0,callback:()=>{},submenu:{options:u(i,t)}});return d.push(...a.map((e=>r(e,"")))),o.length>0&&d.push(...o.map((e=>r(e,"")))),d}return null}(e,t);return i?s.call(this,i,t):s.apply(this,[...arguments])}if(t.parentMenu);else if(t.extra);else if(t.scale);else{const s=A("EasyUse.ContextMenu.QuickOptions",null);if(t.hasOwnProperty("extra")&&"Disable"!==s){if("At the forefront"==s?e.unshift(null):e.push(null),i=window.location.host,["192.168.","10.","127.",/^172\.((1[6-9]|2[0-9]|3[0-1])\.)/].some((e=>"string"==typeof e?i.startsWith(e):e.test(i)))){const t={content:`${Y("Reboot ComfyUI")}`,callback:e=>(async()=>{if(confirm(Y("Are you sure you'd like to reboot the server?")))try{b.fetchApi("/easyuse/reboot")}catch(e){}})()};"At the forefront"==s?e.unshift(t):e.push(t)}const t=A("EasyUse.Hotkeys.cleanVRAMUsed",null)?"("+J("Shift+r")+")":"",n={content:`${Y("Cleanup Of VRAM Usage")} ${t}`,callback:e=>et()};"At the forefront"==s?e.unshift(n):e.push(n);const o=A("EasyUse.Hotkeys.toggleNodesMap",null)?"("+J("Shift+m")+")":"",a={content:`${Y("Nodes Map")} ${o}`,callback:e=>{var t,s,i;const n=(null==(t=v.extensionManager)?void 0:t.sidebarTab)||v.extensionManager,o=(null==(s=v.extensionManager.sidebarTab)?void 0:s.activeSidebarTabId)||(null==(i=v.extensionManager)?void 0:i.activeSidebarTab);n.activeSidebarTabId=o==P?null:P}};"At the forefront"==s?e.unshift(a):e.push(a)}}return s.apply(this,[...arguments]);var i},LiteGraph.ContextMenu.prototype=s.prototype,A("EasyUse.ContextMenu.NodesSort",null)&&(LiteGraph.ContextMenu.prototype.addItem=nt)}});const it=e=>e&&"object"==typeof e&&"image"in e&&e.content;function nt(e,t,s){var i=this;s=s||{};var n=document.createElement("div");n.className="litemenu-entry submenu";var o,a=!1;function l(e){var t=this.value,n=!0;(i.current_submenu&&i.current_submenu.close(e),s.callback)&&(!0===s.callback.call(this,t,s,e,i,s.node)&&(n=!1));if(t){if(t.callback&&!s.ignore_item_callbacks&&!0!==t.disabled)!0===t.callback.call(this,t,s,e,i,s.extra)&&(n=!1);if(t.submenu){if(!t.submenu.options)throw"ContextMenu submenu needs options";new i.constructor(t.submenu.options,{callback:t.submenu.callback,event:e,parentMenu:i,ignore_item_callbacks:t.submenu.ignore_item_callbacks,title:t.submenu.title,extra:t.submenu.extra,autoopen:s.autoopen}),n=!1}}n&&!i.lock&&i.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&&it(t)&&(null==t?void 0:t.image)&&!t.submenu&&(n.textContent+=" *",w("div.pysssss-combo-image",{parent:n,style:{backgroundImage:`url(/pysssss/view/${o=t.image,encodeURIComponent(o).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 ot(e){return null==e?void 0:e.substring(0,e.lastIndexOf("."))}function at(e){return null==e?void 0:e.substring(e.lastIndexOf(".")+1)}class lt extends L{constructor(){super(),this.element.classList.add("easyuse-model-metadata")}show(e){super.show(w("div",Object.keys(e).map((t=>w("div",[w("label",{textContent:t}),w("span",{textContent:e[t]})])))))}}class rt extends L{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=b.fetchApi("/easyuse/metadata/"+encodeURIComponent(`${e}/${t}`));this.info=w("div",{style:{flex:"auto"}}),this.imgCurrent=0,this.imgList=w("div.easyuse-preview-list",{style:{display:"none"}}),this.imgWrapper=w("div.easyuse-preview",[w("div.easyuse-preview-group",[this.imgList])]),this.main=w("main",{style:{display:"flex"}},[this.imgWrapper,this.info]),this.content=w("div.easyuse-model-content",[w("div.easyuse-model-header",[w("h2",{textContent:this.name})]),this.main]);const i=w("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"),i.remove(),this.addInfo()}createButtons(){const e=super.createButtons();return this.viewMetadata=w("button",{type:"button",textContent:"View raw metadata",disabled:"disabled",style:{opacity:.5,cursor:"not-allowed"},onclick:e=>{this.metadata&&(new lt).show(this.metadata)}}),e.unshift(this.viewMetadata),e}parseNote(){if(!this.customNotes)return[];let e=[];const t=new RegExp("(\\bhttps?:\\/\\/[^\\s]+)","g");let s,i=0;do{let n;s=t.exec(this.customNotes);let o=0;s?(n=s.index,o=s.index+s[0].length):n=this.customNotes.length;let a=this.customNotes.substring(i,n);a&&(a=a.replaceAll("\n","
"),e.push(w("span",{innerHTML:a}))),s&&e.push(w("a",{href:s[0],textContent:s[0],target:"_blank"})),i=o}while(s);return e}addInfoEntry(e,t){return w("p",{parent:this.info},["string"==typeof e?w("label",{textContent:e+": "}):e,"string"==typeof t?w("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=w("span",{textContent:"ℹ️ Loading..."});return this.addInfoEntry(w("label",[w("img",{style:{width:"18px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),w("span",{textContent:"Civitai: "})]),t),e.then((e=>{var t,s;this.imgWrapper.style.display="block";let i=this.element.querySelector(".easyuse-model-header");i&&i.replaceChildren(w("h2",{textContent:this.name}),w("div.easyuse-model-header-remark",[w("h5",{textContent:Y("Updated At:")+Z(new Date(e.updatedAt),"yyyy/MM/dd")}),w("h5",{textContent:Y("Created At:")+Z(new Date(e.updatedAt),"yyyy/MM/dd")})]));let n=null,o=this.parseNote.call(this),a=Y("✏️ Edit"),l=w("div.easyuse-model-detail-textarea",[w("p",(null==o?void 0:o.length)>0?o:{textContent:Y("No notes")})]);if(o&&0!=o.length?l.classList.remove("empty"):l.classList.add("empty"),this.info.replaceChildren(w("div.easyuse-model-detail",[w("div.easyuse-model-detail-head.flex-b",[w("span",Y("Notes")),w("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){Ue.showLoading(Y("Saving Notes...")),this.customNotes=n.value;const e=await b.fetchApi("/easyuse/metadata/notes/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:this.customNotes});if(Ue.hideLoading(),200!==e.status)return Ue.error(Y("Saving Failed")),void alert(`Error saving notes (${e.status}) ${e.statusText}`);Ue.success(Y("Saving Succeed")),o=this.parseNote.call(this),l.replaceChildren(w("p",(null==o?void 0:o.length)>0?o:{textContent:Y("No notes")})),n.value?l.classList.remove("empty"):l.classList.add("empty")}else l.replaceChildren(w("p",{textContent:Y("No notes")})),l.classList.add("empty");e.target.textContent=a,n.remove(),n=null}else e.target.textContent="💾 Save",n=w("textarea",{placeholder:Y("Type your notes here"),style:{width:"100%",minWidth:"200px",minHeight:"50px",height:"100px"},textContent:this.customNotes}),l.replaceChildren(n),n.focus()}})]),l]),w("div.easyuse-model-detail",[w("div.easyuse-model-detail-head",{textContent:Y("Details")}),w("div.easyuse-model-detail-body",[w("div.easyuse-model-detail-item",[w("div.easyuse-model-detail-item-label",{textContent:Y("Type")}),w("div.easyuse-model-detail-item-value",{textContent:e.model.type})]),w("div.easyuse-model-detail-item",[w("div.easyuse-model-detail-item-label",{textContent:Y("BaseModel")}),w("div.easyuse-model-detail-item-value",{textContent:e.baseModel})]),w("div.easyuse-model-detail-item",[w("div.easyuse-model-detail-item-label",{textContent:Y("Download")}),w("div.easyuse-model-detail-item-value",{textContent:(null==(t=e.stats)?void 0:t.downloadCount)||0})]),w("div.easyuse-model-detail-item",[w("div.easyuse-model-detail-item-label",{textContent:Y("Trained Words")}),w("div.easyuse-model-detail-item-value",{textContent:(null==e?void 0:e.trainedWords.join(","))||"-"})]),w("div.easyuse-model-detail-item",[w("div.easyuse-model-detail-item-label",{textContent:Y("Source")}),w("div.easyuse-model-detail-item-value",[w("label",[w("img",{style:{width:"14px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),w("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(w("div.easyuse-preview-slide",[w("div.easyuse-preview-slide-content",[w("img",{src:e.url}),w("div.save",{textContent:"Save as preview",onclick:async()=>{if(this.isSaving)return;this.isSaving=!0,Ue.showLoading(Y("Saving Preview..."));const t=await(await fetch(e.url)).blob(),s="temp_preview."+new URL(e.url).pathname.split(".")[1],i=new FormData;i.append("image",new File([t],s)),i.append("overwrite","true"),i.append("type","temp");if(200!==(await b.fetchApi("/upload/image",{method:"POST",body:i})).status)return this.isSaving=!1,Ue.error(Y("Saving Failed")),Ue.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:s,type:"temp"}),headers:{"content-type":"application/json"}}).then((e=>{Ue.success(Y("Saving Succeed")),Ue.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=w("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=w("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&&w("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 dt extends rt{async addInfo(){await this.addCivitaiInfo()}}class ut extends rt{getTagFrequency(){if(!this.metadata.ss_tag_frequency)return[];const e=JSON.parse(this.metadata.ss_tag_frequency),t={};for(const s in e){const i=e[s];for(const e in i)e in t?t[e]+=i[e]:t[e]=i[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:i}of Object.values(t.buckets))e.push([i,`${s.join("x")} * ${i}`])}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(","),i=s[0].replace("(",""),n=s[1].replace(")","");e.push(`${i.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=>w("li.easyuse-model-tag",{dataset:{tag:e[0]},$:e=>{e.onclick=()=>{e.classList.toggle("easyuse-model-tag--selected")}}},[w("p",{textContent:e[0]}),w("span",{textContent:e[1]})])))}addTags(){let e,t=this.getTagFrequency();if(null==t?void 0:t.length){const s=t.length;let i;s>500&&(t=t.slice(0,500),e=w("p",[w("span",{textContent:"⚠️ Only showing first 500 tags "}),w("a",{href:"#",textContent:`Show all ${s}`,onclick:()=>{i.replaceChildren(...this.getTagList(this.getTagFrequency())),e.remove()}})])),i=w("ol.easyuse-model-tags-list",this.getTagList(t)),this.tags=w("div",[i])}else this.tags=w("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&&w("div",{parent:this.content,innerHTML:t.description,style:{maxHeight:"250px",overflow:"auto"}})}createButtons(){const e=super.createButtons();function t(e,t){const s=w("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(i){prompt("Copy to clipboard: Ctrl+C, Enter",text)}finally{document.body.removeChild(s)}}return e.unshift(w("button",{type:"button",textContent:"Copy Selected",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag--selected")])}}),w("button",{type:"button",textContent:"Copy All",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag")])}})),e}}const ct={pipe:{category:"Easy Pipe",nodes:["easy pipeIn","easy pipeOut","easy pipeEdit","easy pipeEditPrompt","easy pipeBatchIndex"],input:{pipe:"pipe"},output:{pipe:"pipe"},widget:{optional_positive:"optional_positive",optional_negative:"optional_negative"}},loaders:{category:"Easy Loaders",nodes:["easy fullLoader","easy a1111Loader","easy comfyLoader","easy kolorsLoader","easy hunyuanDiTLoader","easy pixArtLoader","easy fluxLoader"],input:{optional_lora_stack:"optional_lora_stack",optional_controlnet_stack:"optional_controlnet_stack",positive:"positive",negative:"negative"},output:{pipe:"pipe",model:"model",vae:"vae",clip:null,positive:null,negative:null,latent:null},widget:{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:{category:"Easy PreSampling",nodes:["easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingLayerDiffusion","easy fullkSampler"],input:{pipe:"pipe",image_to_latent:"image_to_latent",latent:"latent"},output:{pipe:"pipe"},widget:{steps:"steps",cfg:"cfg",cfg_scale_min:"cfg",sampler_name:"sampler_name",scheduler:"scheduler",denoise:"denoise",seed_num:"seed_num",seed:"seed"}},samplers:{category:"Custom Sampler",nodes:["KSamplerSelect","SamplerEulerAncestral","SamplerEulerAncestralCFG++","SamplerLMS","SamplerDPMPP_3M_SDE","SamplerDPMPP_2M_SDE","SamplerDPMPP_SDE","SamplerDPMAdaptative","SamplerLCMUpscale","SamplerTCD","SamplerTCD EulerA"],output:{SAMPLER:"SAMPLER"}},sigmas:{category:"Custom Sigmas",nodes:["BasicScheduler","KarrasScheduler","ExponentialScheduler","PolyexponentialScheduler","VPScheduler","BetaSamplingScheduler","SDTurboScheduler","SplitSigmas","SplitSigmasDenoise","FlipSigmas","AlignYourStepsScheduler","GITSScheduler"],output:{SIGMAS:"SIGMAS"}},kSampler:{category:"Easy kSampler",nodes:["easy kSampler","easy kSamplerTiled","easy kSamplerCustom","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerLayerDiffusion"],input:{pipe:"pipe",model:"model"},output:{pipe:"pipe",image:"image"},widget:{image_output:"image_output",save_prefix:"save_prefix",link_id:"link_id"}},controlNet:{category:"Easy ControlNet",nodes:["easy controlnetLoader","easy controlnetLoaderADV","easy controlnetLoader++","easy instantIDApply","easy instantIDApplyADV"],input:{pipe:"pipe",image:"image",image_kps:"image_kps",control_net:"control_net",positive:"positive",negative:"negative",mask:"mask"},output:{pipe:"pipe",positive:"positive",negative:"negative"},widget:{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"]}},adapter:{category:"Easy Adapter",nodes:["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition","easy ipadapterApplyFromParams","easy pulIDApply","easy pulIDApplyADV"],input:{model:"model",image:"image",image_style:"image",attn_mask:"attn_mask",optional_ipadapter:"optional_ipadapter"},output:{model:"model",tiles:"tiles",masks:"masks",ipadapter:"ipadapter"},widget:{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"}},positive:{category:"Easy Positive",nodes:["easy positive","easy wildcards"],input:{},output:{text:"positive",positive:"text"},widget:{text:"positive",positive:"text"}},loadImage:{category:"Easy LoadImage",nodes:["easy loadImageBase64","LoadImage","LoadImageMask"],input:{pipe:"pipe",image:"image",mask:"mask"},output:{IMAGE:"IMAGE",MASK:"MASK"},widget:{image:"image",base64_data:"base64_data",channel:"channel"}},saveImage:{category:"Save/Preview Image",nodes:["SaveImage","PreviewImage"]},inPaint:{category:"Easy Inpaint",nodes:["easy applyBrushNet","easy applyPowerPaint","easy applyInpaint"],input:{},output:{pipe:"pipe"},widget:{dtype:"dtype",fitting:"fitting",function:"function",scale:"scale",start_at:"start_at",end_at:"end_at"}},showAny:{category:"Show Anything",nodes:["easy showAnything","easy showAnythingLazy"],input:{anything:"anything"},output:{output:"output"}},saveText:{category:"Save Text",nodes:["easy saveText","easy saveTextLazy"],input:{image:"image",text:"text",output_file_path:"output_file_path",file_name:"file_name",file_extension:"file_extension",overwrite:"overwrite"},output:{text:"text",image:"image"},widget:{image:"image",text:"text",output_file_path:"output_file_path",file_name:"file_name",file_extension:"file_extension",overwrite:"overwrite"}},persona:{category:"LLM Party Persona",nodes:["load_persona","classify_persona","classify_persona_plus","custom_persona","translate_persona","flux_persona"],input:{file_content:"file_content"},output:{system_prompt:"system_prompt"},widget:{is_enable:"is_enable"}},llmModelLoader:{category:"LLM Model Loader",nodes:["LLM_api_loader","genai_api_loader","LLM_local_loader"],output:{model:"model"}},llmModelChain:{category:"LLM Model Chain",nodes:["LLM","LLM_local"],input:{model:"model",image:"images",images:"image",extra_parameters:"extra_parameters",system_prompt_input:"system_prompt_input",user_prompt_input:"user_prompt_input",tools:"tools",file_content:"file_content"},output:{assistant_response:"assistant_response",history:"history",tool:"tool",image:"image"},widget:{system_prompt:"system_prompt",user_prompt:"user_prompt",temperature:"temperature",is_memory:"is_memory",is_tools_in_sys_prompt:"is_tools_in_sys_prompt",max_length:"max_length",main_brain:"main_brain",conversation_rounds:"conversation_rounds",history_record:"history_record",is_enable:"is_enable"}},maskModify:{category:"Mask Modify",nodes:["CropMask","ThresholdMask","GrowMask","FeatherMask","LayerMask: MaskGrain","LayerMask: MaskEdgeUltraDetail","LayerMask: MaskEdgeUltraDetail V2"],input:{mask:"mask"},output:{MASK:"MASK",mask:"mask",image:"image"}},maskModifyWAS:{category:"Mask Modify (WAS)",nodes:["Mask Dilate Region","Mask Gaussian Region"],input:{masks:"masks"},output:{MASKS:"MASKS"}}};function pt(e,t,s){return function(){!function(e,t,s){var i;const n=LiteGraph.createNode(t);if(n){if(v.graph.add(n),n.pos=e.pos.slice(),n.size=e.size.slice(),(null==(i=e.widgets)?void 0:i.length)>0&&e.widgets.forEach((e=>{var t,i,o;if(null==(i=null==(t=ct[s])?void 0:t.widget)?void 0:i[e.name]){const t=ct[s].widget[e.name];if(t&&n.widgets){const s=(o=t,n.widgets.find((e=>"object"==typeof o?o.includes(e.name):e.name===o)));s&&(s.value=e.value,"seed_num"==e.name&&(s.linkedWidgets[0].value=e.linkedWidgets[0].value),"converted-widget"==e.type&&vt(n,s,e))}}})),e.inputs&&e.inputs.forEach(((t,i)=>{var o,a,l;if(t&&t.link&&(null==(a=null==(o=ct[s])?void 0:o.input)?void 0:a[t.name])){const i=null==(l=ct[s])?void 0:l.input[t.name];if(null===i)return;const o=n.findInputSlot(i);if(-1!==o){const s=e.graph.links[t.link];if(s){const t=e.graph.getNodeById(s.origin_id);t&&t.connect(s.origin_slot,n,o)}}}})),e.outputs&&e.outputs.forEach(((t,i)=>{var o,a;if(t&&t.links&&(null==(a=null==(o=ct[s])?void 0:o.output)?void 0:a[t.name])){const i=ct[s].output[t.name];if(null===i)return;const o=n.findOutputSlot(i);-1!==o&&t.links.forEach((t=>{const s=e.graph.links[t];if(s){const t=e.graph.getNodeById(s.target_id);t&&n.connect(o,t,s.target_slot)}}))}})),v.graph.remove(e),"easy fullkSampler"==n.type){const e=n.outputs[0].links;if(e&&e[0]){const t=v.graph._nodes.find((t=>t.inputs&&t.inputs[0]&&t.inputs[0].link==e[0]));t&&v.graph.remove(t)}}else if(ct.preSampling.nodes.includes(n.type)){const e=n.outputs[0].links;if(!e||!e[0]){const e=LiteGraph.createNode("easy kSampler");v.graph.add(e),e.pos=n.pos.slice(),e.pos[0]=e.pos[0]+n.size[0]+20;const t=n.findInputSlot("pipe");-1!==t&&n&&n.connect(0,e,t)}}n.setSize([n.size[0],n.computeSize()[1]])}}(e,t,s)}}const ht=(e,t)=>{const s=e.prototype.getExtraMenuOptions;e.prototype.getExtraMenuOptions=function(){const e=s.apply(this,arguments);return t.apply(this,arguments),e}},mt=(e,t,s,i,n=!0)=>{ht(i,(function(i,o){o.unshift({content:e,has_submenu:n,callback:(e,i,n,o,a)=>gt(e,i,n,o,a,t,s)}),"loaders"==t&&(o.unshift({content:Y("💎 View Lora Info..."),callback:(e,t,s,i,n)=>{let o=n.widgets.find((e=>"lora_name"==e.name)).value;o&&"None"!=o&&new ut(o).show("loras",o)}}),o.unshift({content:Y("💎 View Checkpoint Info..."),callback:(e,t,s,i,n)=>{let o=n.widgets[0].value;o&&"None"!=o&&new dt(o).show("checkpoints",o)}}))}))},gt=(e,t,s,i,n,o,a)=>{const l=[];return a.map((e=>{n.type!==e&&l.push({content:`${e}`,callback:pt(n,e,o)})})),new LiteGraph.ContextMenu(l,{event:s,callback:null,parentMenu:i,node:n}),!1},ft="converted-widget",yt=Symbol();function _t(e,t,s=""){if(t.origType=t.type,t.origComputeSize=t.computeSize,t.origSerializeValue=t.serializeValue,t.computeSize=()=>[0,-4],t.type=ft+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 i of t.linkedWidgets)_t(e,i,":"+t.name)}function vt(e,t,s){_t(e,t);const{type:i}=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,i,{widget:{name:t.name,[yt]:()=>s}});for(const o of e.widgets)o.last_y+=LiteGraph.NODE_SLOT_HEIGHT;e.setSize([Math.max(n[0],e.size[0]),Math.max(n[1],e.size[1])])}const bt=function(e){var t,s,i,n;const o=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,s=e.findInputSlot(t),i=e.getInputNode(s),n=e.getInputLink(s);p.push([n.origin_slot,i,t])}if(e.outputs)for(const y of e.outputs)if(y.links){const e=y.name;for(const t of y.links){const s=graph.links[t],i=graph._nodes_by_id[s.target_id];h.push([e,i,s.target_slot])}}v.graph.remove(e);let m=v.graph.add(LiteGraph.createNode(o,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&&vt(m,t,s.widget)}for(let e of p){const[t,s,i]=e;s.connect(t,m.id,i)}for(let e of h){const[t,s,i]=e;m.connect(t,s,i)}}m.inputs.map(((t,s)=>{m.inputs[s].label=e.inputs[s].label})),m.outputs.map(((t,s)=>{m.outputs[s].label=e.outputs[s].label}));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();if(f){let e=function(e,t){var s,i,n,o,a,l;if(!0===e||!1===e){if((null==(s=t.options)?void 0:s.on)&&(null==(i=t.options)?void 0:i.off))return{value:e,pass:!0}}else if("number"==typeof e){if((null==(n=t.options)?void 0:n.min)<=e&&e<=(null==(o=t.options)?void 0:o.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 o=(null==f?void 0:f.length)<=(null==(s=m.widgets)?void 0:s.length);let a=o?0:f.length-1;const l=s=>{var i;const n=u.widgets[s];let l=m.widgets[s];if(l.name===n.name&&l.type===n.type){for(;(o?a=0)&&!t;){let{value:t,pass:s}=e(f[a],l);if(s&&null!==t){l.value=t;break}a+=o?1:-1}a++,o||(a=f.length-((null==(i=m.widgets)?void 0:i.length)-1-s))}};if(o&&(null==(i=m.widgets)?void 0:i.length)>0)for(let s=0;s0)for(let s=m.widgets.length-1;s>=0;s--)l(s)}g()};v.registerExtension({name:"Comfy.EasyUse.ExtraMenu",async beforeRegisterNodeDef(e,t,s){ht(e,(function(e,s){s.unshift({content:Y("🔃 Reload Node"),callback:(e,t,s,i,n)=>{let o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)bt(n);else for(let a in o.selected_nodes)bt(o.selected_nodes[a])}}),"easy ckptNames"==t.name&&s.unshift({content:Y("💎 View Checkpoint Info..."),callback:(e,t,s,i,n)=>{n.widgets[0].value}})}));for(const i in ct)ct[i].nodes.includes(t.name)&&mt(`↪️ Swap ${ct[i].category}`,i,ct[i].nodes,e)}});const wt=LiteGraph.LGraphNode,Lt="➡️";v.registerExtension({name:"easy setNode",registerCustomNodes(){class e extends wt{constructor(t){super("Set"),g(this,"defaultVisibility",!0),g(this,"serialize_widgets",!0),this.properties||(this.properties={previousName:""}),this.properties.showOutputText=e.defaultVisibility;const s=this;s.color=LGraphCanvas.node_colors.blue.color,this.addWidget("text","Constant","",((e,t,i,n,o)=>{s.validateName(s.graph),""!==this.widgets[0].value&&(this.title=Lt+this.widgets[0].value),this.properties.previousName=this.widgets[0].value,this.update()}),{}),this.addInput("*","*"),this.onConnectionsChange=function(e,t,i,n,o){if(1!=e||i||(this.inputs[t].type="*",this.inputs[t].name="*",this.title="Set"),n&&s.graph&&1==e&&i){const e=s.graph._nodes.find((e=>e.id==n.origin_id)).outputs[n.origin_slot];if(!e)return;const t=e.type,i=s.is_auto_link?this.widgets[0].value:e.name;"Set"===this.title&&(this.title=Lt+i,this.widgets[0].value=i),"*"===this.widgets[0].value&&(this.widgets[0].value=i),this.validateName(s.graph),this.inputs[0]&&(this.inputs[0].type=t,this.inputs[0].name=i),setTimeout((e=>{this.title=Lt+this.widgets[0].value,this.properties.previousName=this.widgets[0].value}),1)}this.update()},this.validateName=function(e){let t=s.widgets[0].value;if(""!=t){let i=0,n=[];do{n=e._nodes.filter((e=>e!=this&&("easy setNode"==e.type&&e.widgets[0].value===t))),n.length>0&&(t=s.widgets[0].value+i),i++}while(n.length>0);s.widgets[0].value=t,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(s.graph){this.findGetters(s.graph).forEach((e=>{e.setType(this.inputs[0].type)})),this.widgets[0].value&&this.findGetters(s.graph,!0).forEach((e=>{e.setName(this.widgets[0].value)}));s.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"}}),v.registerExtension({name:"easy getNode",registerCustomNodes(){class e extends wt{constructor(t){super("Get"),g(this,"defaultVisibility",!0),g(this,"serialize_widgets",!0),this.properties||(this.properties={}),this.properties.showOutputText=e.defaultVisibility;const s=this;s.color=LGraphCanvas.node_colors.blue.color,this.addWidget("combo","Constant","",(e=>{this.onRename()}),{values:()=>s.graph._nodes.filter((e=>"easy setNode"==e.type)).map((e=>e.widgets[0].value)).sort()}),this.addOutput("*","*"),this.onConnectionsChange=function(e,t,s,i,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){s.widgets[0].value=e,s.onRename(),s.serialize()},this.onRename=function(e=0){const t=this.findSetter(s.graph);if(t){const s=t.inputs[0].type,i=t.inputs[0].name;this.setType(s,i),this.outputs[e].type=s,this.outputs[e].name=i,this.title="⬅️"+t.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 t=s.graph.links[e];t&&t.type!=this.outputs[0].type&&"*"!=t.type&&s.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"}}),b.addEventListener("easyuse-global-seed",(function(e){let t=app.graph._nodes_by_id;for(let s in t){let i=t[s];if("easy globalSeed"==i.type){if(i.widgets){const t=i.widgets.find((e=>"value"==e.name));i.widgets.find((e=>"last_seed"==e.name)).value=t.value,t.value=e.detail.value}}else if(i.widgets){const t=i.widgets.find((e=>"seed_num"==e.name||"seed"==e.name||"noise_seed"==e.name));t&&null!=e.detail.seed_map[i.id]&&(t.value=e.detail.seed_map[i.id])}}}));const St=b.queuePrompt;b.queuePrompt=async function(e,{output:t,workflow:s}){s.seed_widgets={};for(let i in app.graph._nodes_by_id){let e=app.graph._nodes_by_id[i].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[i]=parseInt(t))}return await St.call(b,e,{output:t,workflow:s})};const Et=["easy imageSave","easy fullkSampler","easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo","easy detailerFix"];v.registerExtension({name:"Comfy.EasyUse.SaveImageExtraOutput",async beforeRegisterNodeDef(e,t,s){if(Et.includes(t.name)){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0,i=this.widgets.find((e=>"filename_prefix"===e.name||"save_prefix"===e.name));return i.serializeValue=()=>E(s,i.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 Ct=["easy wildcards","easy positive","easy negative","easy stylesSelector","easy promptConcat","easy promptReplace"],kt=["easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingDynamicCFG","easy preSamplingSdTurbo","easy preSamplingLayerDiffusion"],At=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo"],xt=["easy controlnetLoader","easy controlnetLoaderADV"],It=["easy instantIDApply","easy instantIDApplyADV"],Nt=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition"],Tt=["easy pipeIn","easy pipeOut","easy pipeEdit","easy pipeEditPrompt"],Ot=["easy XYPlot","easy XYPlotAdvanced"],Dt=["easy setNode"],Rt=["Reroute","RescaleCFG","LoraLoaderModelOnly","LoraLoader","FreeU","FreeU_v2",...Nt,...Dt],Gt={"easy seed":{from:{INT:["Reroute",...kt,"easy fullkSampler"]}},"easy positive":{from:{STRING:["Reroute",...Ct]}},"easy negative":{from:{STRING:["Reroute",...Ct]}},"easy wildcards":{from:{STRING:["Reroute","easy showAnything",...Ct]}},"easy stylesSelector":{from:{STRING:["Reroute","easy showAnything",...Ct]}},"easy promptConcat":{from:{STRING:["Reroute","easy showAnything",...Ct]}},"easy promptReplace":{from:{STRING:["Reroute","easy showAnything",...Ct]}},"easy fullLoader":{from:{PIPE_LINE:["Reroute",...kt,"easy fullkSampler",...Tt,...Dt],MODEL:Rt},to:{STRING:["Reroute",...Ct]}},"easy a1111Loader":{from:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Tt,...Dt],MODEL:Rt},to:{STRING:["Reroute",...Ct]}},"easy comfyLoader":{from:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Tt,...Dt],MODEL:Rt},to:{STRING:["Reroute",...Ct]}},"easy hunyuanDiTLoader":{from:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Tt,...Dt],MODEL:Rt},to:{STRING:["Reroute",...Ct]}},"easy kolorsLoader":{from:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Tt,...Dt],MODEL:Rt},to:{STRING:["Reroute",...Ct]}},"easy pixArtLoader":{from:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Tt,...Dt],MODEL:Rt},to:{STRING:["Reroute",...Ct]}},"easy fluxLoader":{from:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Tt,...Dt],MODEL:Rt},to:{STRING:["Reroute",...Ct]}},"easy svdLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Tt,...Dt],MODEL:Rt},to:{STRING:["Reroute",...Ct]}},"easy zero123Loader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Tt,...Dt],MODEL:Rt},to:{STRING:["Reroute",...Ct]}},"easy sv3dLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Tt,...Dt],MODEL:Rt},to:{STRING:["Reroute",...Ct]}},"easy preSampling":{from:{PIPE_LINE:["Reroute",...At,...Tt,...xt,...Ot,...Dt]}},"easy preSamplingAdvanced":{from:{PIPE_LINE:["Reroute",...At,...Tt,...xt,...Ot,...Dt]}},"easy preSamplingDynamicCFG":{from:{PIPE_LINE:["Reroute",...At,...Tt,...xt,...Ot,...Dt]}},"easy preSamplingCustom":{from:{PIPE_LINE:["Reroute",...At,...Tt,...xt,...Ot,...Dt]}},"easy preSamplingLayerDiffusion":{from:{PIPE_LINE:["Reroute","easy kSamplerLayerDiffusion",...At,...Tt,...xt,...Ot,...Dt]}},"easy preSamplingNoiseIn":{from:{PIPE_LINE:["Reroute",...At,...Tt,...xt,...Ot,...Dt]}},"easy fullkSampler":{from:{PIPE_LINE:["Reroute",...Tt.reverse(),"easy preDetailerFix","easy preMaskDetailerFix",...kt,...Dt]}},"easy kSampler":{from:{PIPE_LINE:["Reroute",...Tt.reverse(),"easy preDetailerFix","easy preMaskDetailerFix","easy hiresFix",...kt,...Dt]}},"easy controlnetLoader":{from:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Tt,...Dt]}},"easy controlnetLoaderADV":{from:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Tt,...Dt]}},"easy instantIDApply":{from:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Tt,...Dt],MODEL:Rt},to:{COMBO:["Reroute","easy promptLine"]}},"easy instantIDApplyADV":{from:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Tt,...Dt],MODEL:Rt},to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApply":{to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApplyADV":{to:{STRING:["Reroute","easy sliderControl",...Ct],COMBO:["Reroute","easy promptLine"]}},"easy ipadapterStyleComposition":{to:{COMBO:["Reroute","easy promptLine"]}},"easy preDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Tt,...Dt]},to:{PIPE_LINE:["Reroute","easy ultralyticsDetectorPipe","easy samLoaderPipe","easy kSampler","easy fullkSampler"]}},"easy preMaskDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Tt,...Dt]}},"easy samLoaderPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Tt,...Dt]}},"easy ultralyticsDetectorPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Tt,...Dt]}},"easy cascadeLoader":{from:{PIPE_LINE:["Reroute","easy fullCascadeKSampler","easy preSamplingCascade",...xt,...Tt,...Dt],MODEL:Rt.filter((e=>!Nt.includes(e)))}},"easy fullCascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Tt,...Dt]}},"easy preSamplingCascade":{from:{PIPE_LINE:["Reroute","easy cascadeKSampler",...Tt,...Dt]}},"easy cascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Tt,...Dt]}},"easy pipeEdit":{from:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Dt]},to:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Tt,...Dt]}},"easy pipeEditPrompt":{from:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Dt]},to:{PIPE_LINE:["Reroute",...kt,...xt,...It,...Tt,...Dt]}}};v.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),i=s.nodeFrom&&null!==s.slotFrom,n=!i&&s.nodeTo&&null!==s.slotTo;if(!i&&!n)return!1;if(!s.nodeType)return!1;var o=i?s.nodeFrom:s.nodeTo,a=i?s.slotFrom:s.slotTo,l=o.type,r=!1;switch(typeof a){case"string":r=i?o.findOutputSlot(a,!1):o.findInputSlot(a,!1),a=i?o.outputs[a]:o.inputs[a];break;case"object":r=i?o.findOutputSlot(a.name):o.findInputSlot(a.name);break;case"number":r=a,a=i?o.outputs[a]:o.inputs[a];break;default:return!1}var d=a.type==LiteGraph.EVENT?"_event_":a.type,u=i?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in;if(u&&u[d]){a.link;let e=!1;const n=i?"from":"to";if(Gt[l]&&Gt[l][n]&&(null==(t=Gt[l][n][d])?void 0:t.length)>0){for(var c in Gt[l][n][d])if(s.nodeType==Gt[l][n][d][c]||"AUTO"==s.nodeType){e=Gt[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)],i?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,allow_searchbox:this.allow_searchbox,showSearchBox:this.showSearchBox},e),i=this,n=s.nodeFrom&&s.slotFrom,o=!n&&s.nodeTo&&s.slotTo;if(!n&&!o)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];s.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(Gt[p]&&Gt[p][e]&&(null==(t=Gt[p][e][u])?void 0:t.length)>0)for(var h in Gt[p][e][u])d.push(Gt[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,o){switch(e){case"Add Node":LGraphCanvas.onMenuAdd(null,null,o,m,(function(e){n?s.nodeFrom.connectByType(r,e,u):s.nodeTo.connectByTypeOutput(r,e,u)}));break;case"Search":n?s.showSearchBox(o,{node_from:s.nodeFrom,slot_from:l,type_filter_in:u}):s.showSearchBox(o,{node_to:s.nodeTo,slot_from:l,type_filter_out:u});break;default:i.createDefaultNodeForSlot(Object.assign(s,{position:[s.e.canvasX,s.e.canvasY],nodeType:e}))}}});return!1}}}),v.registerExtension({name:"Comfy.EasyUse.TimeTaken",setup(){let e=new Map,t=0;b.addEventListener("execution_start",(e=>{graph&&graph._nodes.forEach((e=>{e.executionDuration&&delete e.executionDuration}))})),b.addEventListener("executing",(s=>{if(!A("EasyUse.Nodes.Runtime",null))return;const i=(null==s?void 0:s.node)||(null==s?void 0:s.detail)||null,n=e.get(t);if(e.delete(t),t&&n){const e=Date.now()-n,s=ve(t);s&&(s.executionDuration||(s.executionDuration=0),s.executionDuration=s.executionDuration+e/1e3)}t=i,e.set(i,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;t=parseFloat(t).toFixed(3)+Y("s"),e.save(),e.fillStyle=LiteGraph.NODE_DEFAULT_BGCOLOR,function(e,t,s,i,n,o){e.beginPath(),e.moveTo(t+o,s),e.lineTo(t+i-o,s),e.arcTo(t+i,s,t+i,s+o,o),e.lineTo(t+i,s+n-o),e.arcTo(t+i,s+n,t+i-o,s+n,o),e.lineTo(t+o,s+n),e.arcTo(t,s+n,t,s+n-o,o),e.lineTo(t,s+o),e.arcTo(t,s,t+o,s,o),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,i,n="#000",o=12,a="Inter"){e.font=`${o}px ${a}`,e.fillStyle=n,e.fillText(t,s,i)}(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 Mt=null;v.registerExtension({name:"Comfy.EasyUse.HotKeys",setup(){if(void 0!==y){y("up,down,left,right",(function(e,t){var s,i,n,o,a,l,r,d,u,c,p,h,m,g,f;e.preventDefault();if(!A("EasyUse.Hotkeys.JumpNearestNodes",null))return;const y=be();if(0===y.length)return;const _=y[0];switch(t.key){case"up":case"left":let e=null;if(ke(_)){const e=null==(s=_.widgets_values)?void 0:s[0],t=null==(i=_.graph)?void 0:i._nodes,n=null==t?void 0:t.find((t=>{var s;if(Ae(t)){if((null==(s=t.widgets_values)?void 0:s[0])===e)return t}return null}));n&&Le(n)}else if((null==(n=_.inputs)?void 0:n.length)>0){for(let t=0;t<_.inputs.length;t++)if(_.inputs[t].link){e=_.inputs[t].link;break}if(e){const t=null==(o=_.graph)?void 0:o.links;if(t[e]){const s=null==(a=t[e])?void 0:a.origin_id,i=null==(r=null==(l=_.graph)?void 0:l._nodes_by_id)?void 0:r[s];i&&Le(i)}}}break;case"down":case"right":let t=null;if(Ae(_)){const e=null==(d=_.widgets_values)?void 0:d[0],t=null==(u=_.graph)?void 0:u._nodes,s=null==t?void 0:t.find((t=>{var s;if(ke(t)){if((null==(s=t.widgets_values)?void 0:s[0])===e)return t}return null}));s&&Le(s)}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 s=null==(m=e[t])?void 0:m.target_id,i=null==(f=null==(g=_.graph)?void 0:g._nodes_by_id)?void 0:f[s];i&&Le(i)}}}}})),y("shift+up,shift+down,shift+left,shift+right,shift+alt+⌘+left,shift+alt+⌘+right,shift+alt+ctrl+left,shift+alt+ctrl+right",(function(e,t){e.preventDefault();if(!A("EasyUse.Hotkeys.AlignSelectedNodes",null))return;const s=be();if(s.length<=1)return;const i=s;switch(t.key){case"shift+up":LGraphCanvas.alignNodes(i,"top",i[0]);break;case"shift+down":LGraphCanvas.alignNodes(i,"bottom",i[0]);break;case"shift+left":LGraphCanvas.alignNodes(i,"left",i[0]);break;case"shift+right":LGraphCanvas.alignNodes(i,"right",i[0]);break;case"shift+alt+ctrl+left":case"shift+alt+⌘+left":Fe(i,"horizontal");break;case"shift+alt+ctrl+right":case"shift+alt+⌘+right":Fe(i,"vertical")}Mt||(Mt=$()),Mt&&Mt.update()})),y("shift+⌘+left,shift+⌘+right,shift+ctrl+left,shift+ctrl+right",(function(e,t){e.preventDefault();if(!A("EasyUse.Hotkeys.NormalizeSelectedNodes",null))return;const s=be();if(s.length<=1)return;const i=s;switch(t.key){case"shift+ctrl+left":case"shift+⌘+left":Pe(i,"width");break;case"shift+ctrl+right":case"shift+⌘+right":Pe(i,"height")}Mt||(Mt=$()),Mt&&Mt.update()})),y("shift+g",(function(e,t){e.preventDefault();A("EasyUse.Hotkeys.AddGroup",null)&&(Ft(),Mt||(Mt=$()),Mt&&Mt.update())})),y("shift+r",(function(e,t){e.preventDefault();A("EasyUse.Hotkeys.cleanVRAMused",null)&&et()})),y("shift+m",(function(e,t){var s,i,n;if(!A("EasyUse.Hotkeys.toggleNodesMap",null))return;let o=(null==(s=v.extensionManager)?void 0:s.sidebarTab)||v.extensionManager,a=(null==(i=v.extensionManager.sidebarTab)?void 0:i.activeSidebarTabId)||(null==(n=v.extensionManager)?void 0:n.activeSidebarTab);o.activeSidebarTabId=a==P?null:P}));const e=[];Array.from(Array(10).keys()).forEach((t=>e.push(`alt+${t}`))),y(e.join(","),(async function(e,t){e.preventDefault();if(!A("EasyUse.Hotkeys.NodesTemplate",null))return;const s=t.key;let i=parseInt(s.split("+")[1]);const n=await b.getUserData("comfy.templates.json");let o=null;if(200==n.status)try{o=await n.json()}catch(l){Ue.error(Y("Get Node Templates File Failed"))}else localStorage["Comfy.NodeTemplates"]?o=JSON.parse(localStorage["Comfy.NodeTemplates"]):Ue.warn(Y("No Node Templates Found"));if(!o)return void Ue.warn(Y("No Node Templates Found"));i=0===i?9:i-1;const a=o[i];if(a)try{const e=(null==a?void 0:a.name)||"Group",t=(null==a?void 0:a.data)?JSON.parse(a.data):[];Pt((async()=>{await C.registerFromWorkflow(t.groupNodes,{}),localStorage.litegrapheditor_clipboard=a.data,v.canvas.pasteFromClipboard(),t.groupNodes||Ft(e)}))}catch(l){Ue.error(l)}else Ue.warn(Y("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===be().length)return;Mt||(Mt=$()),Mt&&Mt.update()}};window.addEventListener("keydown",t,!0)}}});const Pt=async e=>{const t=localStorage.litegrapheditor_clipboard;await e(),localStorage.litegrapheditor_clipboard=t},Ft=e=>{const t=be();if(0===t.length)return;const s=t;let i=new LiteGraph.LGraphGroup;i.title=e||"Group",((e,t=[],s=20)=>{var i,n,o,a,l,r,d,u,c,p;for(var h of(n=o=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==(i=p.flags)?void 0:i.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);o-=Math.round(1.4*e.font_size),e.pos=[n-s,o-s],e.size=[a-n+2*s,l-o+2*s]})(i,s),v.canvas.graph.add(i)};function Ut(e,t,s,i){const n=[];return e.workflow.links.forEach((e=>{s&&e[1]===t&&!n.includes(e[3])&&n.push(e[3]),i&&e[3]===t&&!n.includes(e[1])&&n.push(e[1])})),n}async function Bt(e,t=!1){const s=structuredClone(await v.graphToPrompt()),i=[];if(s.workflow.nodes.forEach((e=>{i.push(e.id)})),s.workflow.links=s.workflow.links.filter((e=>i.includes(e[1])&&i.includes(e[3]))),t)for(;!v.graph._nodes_by_id[e].isChooser;)e=Ut(s,e,!0,!1)[0];const n=function(e,t){const s=[],i=[t];for(;i.length>0;){const t=i.pop();s.push(t),i.push(...Ut(e,t,!0,!1).filter((e=>!(s.includes(e)||i.includes(e)))))}i.push(...s.filter((e=>e!=t)));const n=[t];for(;i.length>0;){const t=i.pop();n.push(t),i.push(...Ut(e,t,!1,!0).filter((e=>!(n.includes(e)||i.includes(e)))))}const o=[];return o.push(...s),o.push(...n.filter((e=>!o.includes(e)))),o}(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 o={};for(const[r,d]of Object.entries(s.output))n.includes(parseInt(r))&&(o[r]=d);const a={};for(const[r,d]of Object.entries(o[e.toString()].inputs))Array.isArray(d)||(a[r]=d);o[e.toString()].inputs=a,s.output=o;const l=v.graphToPrompt;v.graphToPrompt=()=>(v.graphToPrompt=l,s),v.queuePrompt(0)}const zt=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 v.runningNodeId!=this.current_node_id&&(this.current_node_id=v.runningNodeId,this.current_node_id?(this.class_of_current_node=null==(t=null==(e=v.graph)?void 0:e._nodes_by_id[v.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)}},Wt=class e{constructor(){}static idle(){return!v.runningNodeId}static paused(){return!0}static paused_here(t){return e.here(t)}static running(){return!e.idle()}static here(e){return v.runningNodeId==e}static state(){return"Paused"}};g(Wt,"cancelling",!1);let jt=Wt;function Vt(e,t){const s=new FormData;s.append("message",t),s.append("id",e),b.fetchApi("/easyuse/image_chooser_message",{method:"POST",body:s})}function Yt(){Vt(-1,"__cancel__"),jt.cancelling=!0,b.interrupt(),jt.cancelling=!1}var Ht=0;function Xt(){Ht+=1}const Zt=["easy kSampler","easy kSamplerTiled","easy fullkSampler"];function Kt(e){const t=v.graph._nodes_by_id[e.detail.id];if(t){t.selected_images=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=()=>{v.graph.setDirtyCanvas(!0)},s.src=`/view?filename=${encodeURIComponent(t.filename)}&type=temp&subfolder=${v.getPreviewFormatParam()}`})),null==(s=e.setSizeForImage)||s.call(e),e.imgs}(t,e.detail.urls);return{node:t,image:s,isKSampler:Zt.includes(t.type)}}}function Jt(e,t,s){var i;if(e.imageRects)i=e.imageRects[t];else{const t=e.imagey;i=[1,t+1,e.size[0]-2,e.size[1]-t-2]}s.strokeRect(i[0]+1,i[1]+1,i[2]-2,i[3]-2)}class $t extends L{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 i=w("img",{src:e.src,onclick:e=>{this.select_index.includes(s)?(this.select_index=this.select_index.filter((e=>e!==s)),i.classList.remove("selected")):(this.select_index.push(s),i.classList.add("selected")),t.selected_images.has(s)?t.selected_images.delete(s):t.selected_images.add(s)}});return i}));super.show(w("div.comfyui-easyuse-chooser-dialog",[w("h5.comfyui-easyuse-chooser-dialog-title",Y("Choose images to continue")),w("div.comfyui-easyuse-chooser-dialog-images",s)]))}createButtons(){const e=super.createButtons();return e[0].onclick=e=>{jt.running()&&Yt(),super.close()},e.unshift(w("button",{type:"button",textContent:Y("Choose Selected Images"),onclick:e=>{Vt(this.node.id,[...this.node.selected_images,-1,...this.node.anti_selected]),jt.idle()&&(Xt(),Bt(this.node.id).then((()=>{Vt(this.node.id,[...this.node.selected_images,-1,...this.node.anti_selected])}))),super.close()}})),e}}function qt(){const e=v.graph._nodes_by_id[this.node_id];if(e){const t=[...e.selected_images];(null==t?void 0:t.length)>0&&e.setProperty("values",t),Vt(e.id,[...e.selected_images,-1,...e.anti_selected]),jt.idle()&&(Xt(),Bt(e.id).then((()=>{Vt(e.id,[...e.selected_images,-1,...e.anti_selected])})))}}function Qt(){jt.running()&&Yt()}function es(e){Object.defineProperty(e,"clicked",{get:function(){return this._clicked},set:function(e){this._clicked=e&&""!=this.name}})}function ts(e){e.options||(e.options={}),e.options.serialize=!1}v.registerExtension({name:"Comfy.EasyUse.imageChooser",init(){window.addEventListener("beforeunload",Yt,!0)},setup(e){const t=LGraphCanvas.prototype.draw;LGraphCanvas.prototype.draw=function(){zt.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:s,isKSampler:i}=Kt(e);if(i){(new $t).show(s,t)}}));const s=b.interrupt;b.interrupt=function(){jt.cancelling||Yt(),s.apply(this,arguments)},b.addEventListener("execution_start",(function(){(Ht>0?(Ht-=1,0):(Vt(-1,"__start__"),1))&&e.graph._nodes.forEach((e=>{(e.selected_images||e.anti_selected)&&(e.selected_images.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,i,n){if(s.isPrimary){const t=function(e,t){var s,i;if((null==(s=e.imgs)?void 0:s.length)>1)for(var n=0;n0&&s0&&ie.imagey)return 0;return-1}(e,i);t>=0&&this.imageClicked(t)}return t&&t.apply(this,arguments)},e.send_button_widget=e.addWidget("button","","",qt),e.cancel_button_widget=e.addWidget("button","","",Qt),es(e.cancel_button_widget),es(e.send_button_widget),ts(e.cancel_button_widget),ts(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;if(e.imgs){if(e.imageRects)for(let s=0;s{Jt(e,s,t)})),t.strokeStyle="#F88",null==(s=null==e?void 0:e.anti_selected)||s.forEach((s=>{Jt(e,s,t)}))}}(this,e)},e.prototype.imageClicked=function(t){"easy imageChooser"===(null==e?void 0:e.comfyClass)&&(this.selected_images.has(t)?this.selected_images.delete(t):this.selected_images.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_images?this.selected_images.size:0)+(this.anti_selected?this.anti_selected.size:0),s=(null==(e=this.imgs)?void 0:e.length)||0;jt.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=jt.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,i,n=0,o=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{o=l.toString().split(".")[1].length}catch(r){}return s=Number(a.toString().replace(".","")),i=Number(l.toString().replace(".","")),s/i*Math.pow(10,o-n)}(this,e)};let ss=[],is=0;const ns={sd3:6.5,"sd3-turbo":4};class os extends L{constructor(){super(),this.lists=[],this.dialog_div=null,this.user_div=null}addItem(e,t){return w("div.easyuse-account-dialog-item",[w("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);ss[t].name=e.target.value},value:ss[e].name}),w("input.key",{type:"text",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);ss[t].key=e.target.value},placeholder:"Enter APIKEY",value:ss[e].key}),w("button.choose",{textContent:Y("Choose"),onclick:async e=>{var s,i,n;const o=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);let a=ss[o].name,l=ss[o].key;if(!a)return void Ue.error(Y("Please enter the account name"));if(!l)return void Ue.error(Y("Please enter the APIKEY"));let r=!0;for(let t=0;t{(new os).show(t)}},[w("div.user",[w("div.avatar",o?[w("img",{src:o})]:"😀"),w("div.info",[w("h5.name",a),w("h6.remark","Credits: "+l)])]),w("div.edit",{textContent:Y("Edit")})])),Ue.success(Y("Save Succeed"))}else Ue.success(Y("Save Succeed"));this.close()}else Ue.error(Y("Save Failed"))}}),w("button.delete",{textContent:Y("Delete"),onclick:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);ss.length<=1?Ue.error(Y("At least one account is required")):(ss.splice(t,1),this.dialog_div.removeChild(e.target.parentNode))}})])}show(e){ss.forEach(((t,s)=>{this.lists.push(this.addItem(s,e))})),this.dialog_div=w("div.easyuse-account-dialog",this.lists),super.show(w("div.easyuse-account-dialog-main",[w("div",[w("a",{href:"https://platform.stability.ai/account/keys",target:"_blank",textContent:Y("Getting Your APIKEY")})]),this.dialog_div]))}createButtons(){const e=super.createButtons();return e.unshift(w("button",{type:"button",textContent:Y("Save Account Info"),onclick:e=>{let t=!0;for(let s=0;s{200==e.status?Ue.success(Y("Save Succeed")):Ue.error(Y("Save Failed"))}))}else Ue.error(Y("APIKEY is not Empty"))}})),e.unshift(w("button",{type:"button",textContent:Y("Add Account"),onclick:e=>{const t="Account "+ss.length.toString();ss.push({name:t,key:""});const s=this.addItem(ss.length-1);this.lists.push(s),this.dialog_div.appendChild(s)}})),e}}v.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,i;t&&(null==t||t.apply(this,arguments));const n=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),o=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="-"+ns[e]};const l=this.addWidget("text","cost_credit","0",(e=>{}),{serialize:!1});l.disabled=!0,setTimeout((e=>{"control_before_generate"==o.name&&0===n.value&&(n.value=Math.floor(4294967294*Math.random())),l.value="-"+ns[a.value]}),100);let r=w("div.easyuse-account-user",[Y("Loading UserInfo...")]);this.addDOMWidget("account","btn",w("div.easyuse-account",r)),b.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)?ns[e.model]:0;if(t){let e=function(e,t){let s,i,n,o,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{i=l.split(".")[1].length}catch(r){i=0}return n=Math.pow(10,Math.max(s,i)),o=s>=i?s:i,((e*n-t*n)/n).toFixed(o)}(parseFloat(s[0].innerText.replace(/Credits: /g,"")),t);e>0&&(s[0].innerText="Credits: "+e.toString())}}await X(1e4);const i=await b.fetchApi("/easyuse/stability/balance");if(200==i.status){const e=await i.json();if(null==e?void 0:e.balance){const i=(null==(t=e.balance)?void 0:t.credits)||0;s&&s[0]&&(s[0].innerText="Credits: "+i)}}}));const d=await b.fetchApi("/easyuse/stability/api_keys");if(200==d.status){let t=await d.json();if(ss=t.keys,is=t.current,ss.length>0&&void 0!==is){const t=ss[is].key,n=ss[is].name;if(t){const t=await b.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,o=(null==(s=n.account)?void 0:s.email)||null,a=(null==(i=n.balance)?void 0:i.credits)||0;r.replaceChildren(w("div.easyuse-account-user-info",{onclick:e=>{(new os).show(r)}},[w("div.user",[w("div.avatar",t?[w("img",{src:t})]:"😀"),w("div.info",[w("h5.name",o),w("h6.remark","Credits: "+a)])]),w("div.edit",{textContent:Y("Edit")})]))}}}else r.replaceChildren(w("div.easyuse-account-user-info",{onclick:e=>{(new os).show(r)}},[w("div.user",[w("div.avatar","😀"),w("div.info",[w("h5.name",n),w("h6.remark",Y("Click to set the APIKEY first"))])]),w("div.edit",{textContent:Y("Edit")})]))}}}}}});let as=null;function ls(){as&&(as.removeEventListeners(),as.dropdown.remove(),as=null)}function rs(e,t,s,i=!1){ls(),new ds(e,t,s,i)}class ds{constructor(e,t,s,i=!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=i,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),as=this}buildNestedDropdown(e,t){let s=0;Object.keys(e).forEach((i=>{const n=e[i];if("object"==typeof n&&null!==n){const e=document.createElement("ul");e.setAttribute("role","listbox"),e.classList.add("easy-nested-dropdown");const o=document.createElement("li");o.classList.add("folder"),o.textContent=i,o.appendChild(e),o.addEventListener("mouseover",this.onMouseOver.bind(this,s,t)),t.appendChild(o),this.buildNestedDropdown(n,e),s+=1}else{const e=document.createElement("li");e.classList.add("item"),e.setAttribute("role","option"),e.textContent=i,e.addEventListener("mouseover",this.onMouseOver.bind(this,s,t)),e.addEventListener("mousedown",this.onMouseDown.bind(this,i)),t.appendChild(e),s+=1}}))}addListItem(e,t,s){const i=document.createElement("li");i.setAttribute("role","option"),i.textContent=e,i.addEventListener("mouseover",this.onMouseOver.bind(this,t)),i.addEventListener("mousedown",this.onMouseDown.bind(this,e)),s.appendChild(i)}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(as)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 i=s.querySelector(".easy-nested-dropdown");i&&(this.focusedDropdown=i,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 us(e){const t=e.min||0,s=e.max||0,i=e.step||1;if(0===i)return[];const n=[];let o=t;for(;o<=s;){if(Number.isInteger(i))n.push(Math.round(o)+"; ");else{let e=o.toFixed(3);-0==e&&(e="0.000"),/\.\d{3}$/.test(e)||(e+="0"),n.push(e+"; ")}o+=i}return s>=0&&t>=0?n:n.reverse()}let cs={},ps={};function hs(e,t){String(e.id);const s=t.name,i=t.value.replace(/^(loader|preSampling):\s/,"");ps[s]?ps[s]!=cs[i]&&(ps[s]=cs[i]):ps={...ps,[s]:cs[i]}}v.registerExtension({name:"Comfy.EasyUse.XYPlot",async beforeRegisterNodeDef(e,t,s){if("easy XYPlot"===t.name){cs=t.input.hidden.plot_dict[0];for(const e in cs){const t=cs[e];if(Array.isArray(t)){let s=[];for(const e of t)s.push(e+"; ");cs[e]=s}else cs[e]="object"==typeof t?"seed"==e?t+"; ":us(t):t+"; "}cs.None=[],cs["---------------------"]=[]}},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(i){i!==s&&(s=i,hs(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,i,n){return e&&(t[i]=e),t.map((e=>s(e,n))).filter((e=>""!==e)).join("")},s=function(e,t){if(e=i(e),n(e,t))return e+"; ";let s=o(e,t);return 1===s.length||2===s.length?s[0]:n(a(e),t)?a(e)+"; ":""},i=function(e){return e.replace(/(\n|;| )/g,"")},n=function(e,t){return t.includes(e+"; ")},o=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 i=(null==ps?void 0:ps[s])||[];if(0===i.length)return;const n=e.inputEl.value,o=e.inputEl.selectionStart;let a=n.split("; ");const l=n.substring(0,o).split("; ").length-1,r=a[l].replace(/\n/g,"").toLowerCase(),d=i.filter((e=>e.toLowerCase().includes(r))).map((e=>e.replace(/; /g,"")));if(d.length>0)rs(e.inputEl,d,(s=>{const n=t(s,a,l,i);e.inputEl.value=n}));else{ls();const s=t(null,a,l,i);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))}});export{Y as $,M as N,b as a,v as b,fe as c,A as d,et as e,P as f,ge as g,x as h,Se as j,V as l,X as s,Ue as t,$ as u}; diff --git a/web_version/v2/assets/extensions-DCfwleBT.js b/web_version/v2/assets/extensions-DCfwleBT.js new file mode 100644 index 0000000..f75d71e --- /dev/null +++ b/web_version/v2/assets/extensions-DCfwleBT.js @@ -0,0 +1 @@ +var e,t,n,s,i,o,a,l,r,A,d,u,c,p,h=Object.defineProperty,m=(e,t,n)=>((e,t,n)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);import{d as f,h as y}from"./vendor-DS46y2Fr.js";import{c as g}from"./lodash-CZi7izHi.js";let v=(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,_=(null==(o=null==(i=window.comfyAPI)?void 0:i.ui)?void 0:o.$el)||null,L=(null==(l=null==(a=window.comfyAPI)?void 0:a.dialog)?void 0:l.ComfyDialog)||null,w=(null==(A=null==(r=window.comfyAPI)?void 0:r.widgets)?void 0:A.ComfyWidgets)||null,S=(null==(u=null==(d=window.comfyAPI)?void 0:d.utils)?void 0:u.applyTextReplacements)||null,k=(null==(p=null==(c=window.comfyAPI)?void 0:c.groupNode)?void 0:p.GroupNodeConfig)||null;const E=e=>{var t,n;return e?null==(n=null==(t=null==v?void 0:v.ui)?void 0:t.settings)?void 0:n.getSettingValue(e):null};function x(e,t=null){try{let n=e?E(e):null;return null==n&&(n=t?localStorage[t]:localStorage[e]||null),n}catch(n){return null}}function N(e,t=e=>{}){var n;const s=null==(n=v.ui.settings.settingsLookup)?void 0:n[e];s&&(s.onChange=e=>t(e))}async function C(e,t,n=null){var s,i;try{(null==(i=null==(s=null==v?void 0:v.ui)?void 0:s.settings)?void 0:i.setSettingValue)?v.ui.settings.setSettingValue(e,t):await b.storeSetting(e,t),n&&(localStorage[n]="object"==typeof t?JSON.stringify(t):t)}catch(o){}}const T="comfyui-easyuse-",I="dark-theme",O="#236692",R={PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd",FLOW_CONTROL:"#373780"},D=0x4000000000000,M=["loaders","latent","image","mask","sampling","_for_testing","advanced","utils","api"],P={ALWAYS:0,NEVER:2,BYPASS:4},G="easyuse_nodes_map",z=LGraphCanvas.node_colors.bgcolor,j={ColorPalette:{version:106,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:2,NODE_BOX_OUTLINE_COLOR:O,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 V=JSON.parse(JSON.stringify(j));delete V.NODE_COLORS,V.ColorPalette.id="obsidian_dark",V.ColorPalette.name="Obsidian Dark",V.ColorPalette.colors.litegraph_base.BACKGROUND_IMAGE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGlmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDEgNzkuMTQ2Mjg5OSwgMjAyMy8wNi8yNS0yMDowMTo1NSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS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_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:2,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:U,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:U,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:U,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:U,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:U,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:U,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:U,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:U,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:U,groupcolor:"#444"}}},F={"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 and Shift+Ctrl+Alt+Left/Right to align selected nodes":"启用 Shift+上/下/左/右 和 Shift+Ctrl+Alt+左/右 键对齐选中的节点","Enable Shift+Ctrl+Left/Right key to normalize selected nodes":"启用 Shift+Ctrl+左/右 键规范化选中的节点","Enable Shift+g to add selected nodes to a group":"启用 Shift+g 键将选中的节点添加一个组","Enable Shift+r to unload models and node cache":"启用 Shift+r 键卸载模型和节点缓存","Enable Shift+m to toggle nodes map":"启用 Shift+m 键显隐管理节点组","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":"模型缩略图太多啦,为您关闭了显示","Shift+Up/Down/Left/Right can align selected nodes, Shift+Ctrl+Alt+Left/Right can distribute horizontal/vertical nodes":"Shift+上/下/左/右 可以对齐选中的节点, Shift+Ctrl+Alt+左/右 可以水平/垂直分布节点","Enable Shift+Ctrl+Left key to normalize width and Shift+Ctrl+Right key to normalize height":"启用 Shift+Ctrl+左 键规范化宽度和 Shift+Ctrl+右 键规范化高度","After v1.2.39, Ctrl+g can be used instead of it":"从v1.2.39开始,可以使用Ctrl+g代替","Use three shortcut buttons in the right-click menu":"在右键菜单中使用三个快捷按钮","Enable Nodes Map":"启用节点组管理","You need to refresh the page to update successfully":"您需要刷新页面以成功更新","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:"手套",Glasses:"眼镜",Sunglasses:"太阳镜","Upper-clothes":"上衣","Top-clothes":"上衣","Bottom-clothes":"下身装","Torso-skin":"皮肤",Dress:"连衣裙",Coat:"外套",Socks:"袜子",Pants:"裤子",Jumpsuits:"连体衣",Scarf:"围巾",Skirt:"裙子","Left-arm":"左臂","Right-arm":"右臂","Left-leg":"左腿","Right-leg":"右腿","Left-foot":"左脚","Right-foot":"右脚","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=x("Comfy.Locale"),Z=(e,t=!1)=>{switch(t?navigator.language:X){case"zh-CN":case"zh":return F[e]||e;default:return e}},q={addGroup:{id:"EasyUse.Hotkeys.AddGroup",name:Z("Enable Shift+g to add selected nodes to a group"),tooltip:Z("After v1.2.39, Ctrl+g can be used instead of it"),type:"boolean",defaultValue:!0},cleanVRAMUsed:{id:"EasyUse.Hotkeys.cleanVRAMUsed",name:Z("Enable Shift+r to unload models and node cache"),type:"boolean",defaultValue:!0},toggleSiteMap:{id:"EasyUse.Hotkeys.toggleNodesMap",name:Z("Enable Shift+m to toggle nodes map"),type:"boolean",defaultValue:!0},alignSelectedNodes:{id:"EasyUse.Hotkeys.AlignSelectedNodes",name:Z("Enable Shift+Up/Down/Left/Right key and Shift+Ctrl+Alt+Left/Right to align selected nodes"),tooltip:Z("Shift+Up/Down/Left/Right can align selected nodes, Shift+Ctrl+Alt+Left/Right can distribute horizontal/vertical nodes"),type:"boolean",defaultValue:!0},NormalizeSelectedNodes:{id:"EasyUse.Hotkeys.NormalizeSelectedNodes",name:Z("Enable Shift+Ctrl+Left/Right key to normalize selected nodes"),tooltip:Z("Enable Shift+Ctrl+Left key to normalize width and Shift+Ctrl+Right key to normalize height"),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},rightMenuNodesSort:{id:"EasyUse.ContextMenu.NodesSort",name:Z("Enable right-click menu to add node A~Z sorting"),type:"boolean",defaultValue:!0},quickOptions:{id:"EasyUse.ContextMenu.QuickOptions",name:Z("Use three shortcut buttons in the right-click menu"),type:"combo",options:["At the forefront","At the end","Disable"],defaultValue:"At the forefront"},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"},enableNodesMap:{id:"EasyUse.NodesMap.Enable",name:Z("Enable Nodes Map"),tooltip:Z("You need to refresh the page to update successfully"),type:"boolean",defaultValue:!0}};function H(e=100,t){return new Promise((n=>{setTimeout((()=>{n(t)}),e)}))}function K(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 Y=/Mac|iPod|iPhone|iPad/.test(navigator.platform),J=e=>Y?e.replace(/Ctrl/g,"⌘").replace(/Alt/g,"⌥").replace(/Shift/g,"⇧"):e,B=f("groups",{state:e=>({groups:[],nodes:[],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,i=!1;for(let n=0;no.pos[0]&&s[0]o.pos[1]&&s[1]e.pos[0]-t.pos[0])).sort(((e,t)=>e.pos[1]-t.pos[1])))},setNodes(e){this.nodes=g(e)},update(){var e,t,n;(((null==(e=v.extensionManager)?void 0:e.activeSidebarTab)||(null==(n=null==(t=v.extensionManager.sidebarTab)?void 0:t.activeSidebarTab)?void 0:n.id))===G||this.isWatching)&&setTimeout((e=>{this.setGroups(v.canvas.graph._groups),this.setNodes(v.canvas.graph._nodes)}),1)},watchGraph(e=!1){e&&(this.isWatching=!0);let t=this;this.update();const n=v.graph.onNodeAdded;v.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)},v.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 i=LGraphCanvas.onGroupAdd;LGraphCanvas.onGroupAdd=function(){return t.update(),null==i?void 0:i.apply(this,arguments)};const o=LGraphCanvas.onGroupAlign;LGraphCanvas.onGroupAlign=function(e){return t.update(),null==o?void 0:o.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}}});let Q=null;const $=["custom_obsidian","custom_obsidian_dark","custom_milk_white","obsidian_dark","obsidian","milk_white"],ee={"easy positive":"green","easy negative":"red","easy promptList":"cyan","easy promptLine":"cyan","easy promptConcat":"cyan","easy promptReplace":"cyan","easy forLoopStart":"blue","easy forLoopEnd":"blue","easy loadImagesForLoop":"blue"};let te=LGraphCanvas.node_colors,ne=null,se=null,ie=null,oe=null;for(let yn in q){const e="Disabled"==x("Comfy.UseNewMenu")?"👽 "+J(q[yn].name):J(q[yn].name),t=q[yn].tooltip?J(q[yn].tooltip):"";ae={...q[yn],name:e,tooltip:t},v.ui.settings.settingsLookup[ae.id]||v.ui.settings.addSetting(ae)}var ae;function le(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 re(e,t,n,s,i,o,a){t.strokeStyle=s,t.fillStyle=LiteGraph.use_legacy_node_error_indicator?"#F00":i;const l=LiteGraph.NODE_TITLE_HEIGHT,r=this.ds.scale<.5,{collapsed:A}=e.flags,d=e._shape||e.constructor.shape||LiteGraph.ROUND_SHAPE,{title_mode:u}=e.constructor,c=u!=LiteGraph.TRANSPARENT_TITLE&&u!=LiteGraph.NO_TITLE;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.has_errors&&!LiteGraph.use_legacy_node_error_indicator&&this.strokeShape(t,p,{shape:d,title_mode:u,title_height:l,padding:12,colour:LiteGraph.NODE_ERROR_COLOUR,collapsed:A,thickness:10}),!A&&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 i="dark"==function(e){let t=e.replace("#","");return n=parseInt(t.substring(0,2),16),s=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16),.299*n+.587*s+.114*i>127.5?"light":"dark";var n,s,i}((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 i=e.constructor.title_color||s;if(e.flags.collapsed&&(t.shadowColor=LiteGraph.DEFAULT_SHADOW_COLOR),this.use_gradients){let e=LGraphCanvas.gradients[i];e||(e=LGraphCanvas.gradients[i]=t.createLinearGradient(0,0,400,0),e.addColorStop(0,i),e.addColorStop(1,"#000")),t.fillStyle=e}else t.fillStyle=i;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=i?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR,s=i?"#eeeeee":e.boxcolor||a||LiteGraph.NODE_DEFAULT_BOXCOLOR;t.fillStyle=o?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,o),!r){t.font=this.title_text_font;const n=e.getTitle()??`❌ ${e.type}`,s=String(n)+(e.pinned?"📌":"");s&&(t.fillStyle=o?i?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR:i?"#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(!A&&e.subgraph&&!e.skip_subgraph_button){let n=LiteGraph.NODE_TITLE_HEIGHT,s=e.size[0]-n,i=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=i?"#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(o){e.onBounding&&e.onBounding(p),u==LiteGraph.TRANSPARENT_TITLE&&(p[1]-=l,p[3]+=l),t.lineWidth=2,t.globalAlpha=.8,t.beginPath();let i=0,o=0,a=1;d==LiteGraph.BOX_SHAPE?t.rect(i+p[0],i+p[1],o+p[2],o+p[3]):d==LiteGraph.ROUND_SHAPE||d==LiteGraph.CARD_SHAPE&&e.flags.collapsed?t.roundRect(i+p[0],i+p[1],o+p[2],o+p[3],[this.round_radius*a]):d==LiteGraph.CARD_SHAPE?t.roundRect(i+p[0],i+p[1],o+p[2],o+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 Ae(e,t,n,s){var i,o;if(!e.widgets||!e.widgets.length)return 0;let a=e.size[0],l=(e.size[1],e.widgets);t+=2;let r=LiteGraph.NODE_WIDGET_HEIGHT,A=this.ds.scale>.5;n.save(),n.globalAlpha=this.editor_alpha;let d=LiteGraph.WIDGET_OUTLINE_COLOR,u=LiteGraph.WIDGET_BGCOLOR,c=LiteGraph.WIDGET_TEXT_COLOR,p=LiteGraph.WIDGET_SECONDARY_TEXT_COLOR,h=12;for(let f=0;f1&&(a=1),n.fillStyle=y.options.hasOwnProperty("slider_color")?y.options.slider_color:s==y?d:O,n.beginPath(),n.roundRect(h,g,a*(v-24),r,[.25*r]),n.fill(),y.marker){let e=(y.marker-y.options.min)/t;e<0&&(e=0),e>1&&(e=1),n.fillStyle=y.options.hasOwnProperty("marker_color")?y.options.marker_color:"#AA9",n.roundRect(h+e*(v-24),g,2,r,[.25*r])}if(A){n.textAlign="center",n.fillStyle=c;let e=(y.label||y.name)+" : "+Number(y.value).toFixed(null!=y.options.precision?y.options.precision:3);n.fillText(e,.5*v,g+.7*r)}break;case"number":case"combo":if(n.textAlign="left",n.strokeStyle=d,n.fillStyle=u,n.beginPath(),A?n.roundRect(h,g,v-24,r,[.25*r]):n.rect(h,g,v-24,r),n.fill(),A){y.disabled||n.stroke(),n.fillStyle=c,y.disabled||(n.beginPath(),n.moveTo(24,g+6.5),n.lineTo(18,g+.5*r),n.lineTo(24,g+r-6.5),n.fill(),n.beginPath(),n.moveTo(v-h-12,g+6.5),n.lineTo(v-h-6,g+.5*r),n.lineTo(v-h-12,g+r-6.5),n.fill()),n.fillStyle=p,n.font="10px Inter",n.fillText(y.label||y.name,29,g+.7*r),n.fillStyle=c,n.textAlign="right";let e=6;if("number"==y.type)n.font="10px Inter",n.fillText(Number(y.value).toFixed(void 0!==y.options.precision?y.options.precision:3),v-24-e,g+.7*r);else{let t=y.value;if(y.options.values){let e=y.options.values;e.constructor===Function&&(e=e()),e&&e.constructor!==Array&&(t=e[y.value])}const s=v-48-(n.measureText(y.label||y.name).width+24),i=n.measureText(t).width;if(i>s){const e="…",o=n.measureText(e).width,a=n.measureText("a").width;if(s<=o)t="․";else{t=`${t}`;if(i+o-s+3*a>s){const e=s+3*a,n=Math.floor((e-o)/a);t=t.substr(0,n)}for(;n.measureText(t).width+o>s;)t=t.substr(0,t.length-1);t+=e}}n.fillText(t,v-24-e,g+.7*r)}}break;case"string":case"text":if(n.textAlign="left",n.strokeStyle=d,n.fillStyle=u,n.beginPath(),A?n.roundRect(h,g,v-24,r,[.25*r]):n.rect(h,g,v-24,r),n.fill(),A){y.disabled||n.stroke(),n.save(),n.beginPath(),n.rect(h,g,v-24,r),n.clip(),n.fillStyle=p;const e=y.label||y.name;n.font="10px Inter",null!=e&&n.fillText(e,24,g+.7*r),n.fillStyle=c,n.textAlign="right",n.fillText(String(y.value).substr(0,30),v-24,g+.7*r),n.restore()}break;default:y.draw&&y.draw(n,e,v,g,r)}t+=(y.computeSize?y.computeSize(v)[1]:r)+4,n.globalAlpha=this.editor_alpha}n.restore(),n.textAlign="left"}function de(e,t,n,s,i){return new LiteGraph.ContextMenu(LiteGraph.NODE_MODES,{event:n,callback:function(e){if(!i)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),Q||(Q=B()),Q.update()},s=LGraphCanvas.active_canvas;if(!s.selected_nodes||Object.keys(s.selected_nodes).length<=1)n(i);else for(var o in s.selected_nodes)n(s.selected_nodes[o])},parentMenu:s,node:i}),!1}function ue(e,t,n,s,i){if(!i)throw"no node for color";var o=[];for(var a in o.push({value:null,content:"No color"}),LGraphCanvas.node_colors){var l=LGraphCanvas.node_colors[a];e={value:a,content:""+a+""};o.push(e)}return new LiteGraph.ContextMenu(o,{event:n,callback:function(e){if(!i)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),Q||(Q=B()),Q.update()},s=LGraphCanvas.active_canvas;if(!s.selected_nodes||Object.keys(s.selected_nodes).length<=1)n(i);else for(var o in s.selected_nodes)n(s.selected_nodes[o]);i.setDirtyCanvas(!0,!0)},parentMenu:s,node:i}),!1}function ce(e,t,n,s,i){var o=e.property||"title",a=i[o],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=o;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)h();else if(13!=e.keyCode&&"textarea"!=e.target.localName)return;e.preventDefault(),e.stopPropagation()})));var A=LGraphCanvas.active_canvas.canvas,d=A.getBoundingClientRect(),u=-20,c=-20;d&&(u-=d.left,c-=d.top),event?(l.style.left=event.clientX+u+"px",l.style.top=event.clientY+c+"px"):(l.style.left=.5*A.width+u+"px",l.style.top=.5*A.height+c+"px"),l.querySelector("button").addEventListener("click",h),A.parentNode.appendChild(l),r&&r.focus();var p=null;function h(){r&&function(t){"Number"==e.type?t=Number(t):"Boolean"==e.type&&(t=Boolean(t));i[o]=t,l.parentNode&&l.parentNode.removeChild(l);i.setDirtyCanvas(!0,!0),Q||(Q=B());Q.update()}(r.value)}l.addEventListener("mouseleave",(function(e){LiteGraph.dialog_close_on_mouse_leave&&!l.is_modified&&LiteGraph.dialog_close_on_mouse_leave&&(p=setTimeout(l.close,LiteGraph.dialog_close_on_mouse_leave_delay))})),l.addEventListener("mouseenter",(function(e){LiteGraph.dialog_close_on_mouse_leave&&p&&clearTimeout(p)}))}v.registerExtension({name:"Comfy.EasyUse.UI",init(){var e,t;const n="Comfy.CustomColorPalettes",s="Comfy.Settings.Comfy.CustomColorPalettes";if(se||(se=x(n,s)),ie||(ie=x("Comfy.ColorPalette","Comfy.Settings.Comfy.ColorPalette")||"dark"),(!(null==(e=null==se?void 0:se.obsidian)?void 0:e.version)||se.obsidian.version{(null==e?void 0:e.value)&&(null==e?void 0:e.oldValue)&&(await H(1),Object.assign(v.canvas.default_connection_color_byType,R),Object.assign(LGraphCanvas.link_type_colors,R)),"custom_milk_white"==e.value&&document.body.classList.remove(I)})),setTimeout((e=>pe(x("Comfy.UseNewMenu")||"Disabled")),1);const t=null==(e=v.ui.settings.settingsLookup)?void 0:e["Comfy.UseNewMenu"];t&&(t.onChange=e=>pe(e))},async nodeCreated(e){var t;if(ee.hasOwnProperty(e.comfyClass)){const t=ee[e.comfyClass],n=te[t];if(!n)return;n.color&&(e.color=n.color),n.bgcolor&&(e.bgcolor=n.bgcolor)}if(ne||(ne=x("Comfy.WidgetControlMode")),"before"==ne){const n="before"==ne;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 le(t,n),t.linkedWidgets))for(const e of t.linkedWidgets)await le(e,n)}}});const pe=e=>{var t;const n=(null==(t=document.getElementById("crystools-root"))?void 0:t.children)||null,s=x("Comfy.Workflow.WorkflowTabsPosition",null);if((null==n?void 0:n.length)>0&&s)if(oe||(oe=document.getElementById("MonitorUI")),"Disabled"==e){document.getElementById("crystools-root").appendChild(oe)}else{let e=document.getElementById("crystools-root-easyuse");if(e)e.appendChild(oe);else{const e=document.getElementsByClassName("comfyui-menu-right");e.length>0&&e[0].before(_("div",{id:"crystools-root-easyuse"},oe))}}};let he={};const me=(e,t)=>e.widgets.find((e=>e.name===t)),fe=(e,t,n=!1,s="")=>{var i;if(!t||((e,t)=>!!e.inputs&&e.inputs.some((e=>e.name===t)))(e,t.name))return;he[t.name]||(he[t.name]={origType:t.type,origComputeSize:t.computeSize});const o=e.size;t.type=n?he[t.name].origType:"easyHidden"+s,t.computeSize=n?he[t.name].origComputeSize:()=>[0,-4],null==(i=t.linkedWidgets)||i.forEach((s=>fe(e,s,":"+t.name,n)));const a=n?Math.max(e.computeSize()[1],o[1]):e.size[1];e.setSize([e.size[0],a])},ye=(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},ge=e=>e.setSize([e.size[0],e.computeSize()[1]]),ve=(e,t)=>graph.getNodeById(e),be=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 _e(e,t,n){return e+(s=n,(.5-.5*Math.cos(Math.PI*s))*(t-e));var s}const Le=(e,t=!0)=>{var n,s;const i=(null==(s=null==(n=e.graph)?void 0:n.list_of_graphcanvas)?void 0:s[0])||null;if(!i)return;const[o,a]=e.pos,[l,r]=e.size;(([e,t],n)=>{const s=n.ds,i=document.body.clientWidth,o=document.body.clientHeight,a=s.scale,l=.5*i/a-e,r=.5*o/a-t,A=Date.now()+250,d=s.offset[0],u=s.offset[1],c=()=>{const e=A-Date.now();if(!(Date.now(){const t=ve(e);t&&Le(t)},Se=(e,t=(()=>graph.links??[])())=>t[e],ke=e=>e.toLowerCase().replace(/_./g,(e=>e.replace("_","").toUpperCase())),Ee=e=>"easy getNode"===e.type,xe=e=>"easy setNode"===e.type,Ne=e=>Ee(e)||xe(e),Ce=(e=(()=>graph._nodes??[])())=>e.filter((e=>Ne(e)));let Te={},Ie={};const Oe=(e,t,n=0)=>{e.widgets_values||(e.widgets_values=[]),e.widgets_values[n]=t,e.widgets[n].value=t},Re=e=>graph.add(e),De=e=>graph.remove(e),Me=(e,t=0)=>{var n,s;if("Reroute"!==e.type)return[e,t];const i=e,o=null==(s=null==(n=i.inputs)?void 0:n[0])?void 0:s.link;if(!o)return[i,t];const a=Se(o);if(!a)return[i,t];const l=ve(a.origin_id);return l?(setTimeout((()=>{De(i)})),Me(l,a.origin_slot)):[i,t]},Pe=e=>{var t,n,s;if("Reroute"!==e.type)return e;const i=e,o=null==(n=null==(t=i.outputs)?void 0:t[0])?void 0:n.links;if(!o)return i;const a=o[0];if(!a)return i;const l=Se(a);if(!l)return i;const r=ve(l.target_id);return r?(1===(null==(s=i.outputs[0].links)?void 0:s.length)&&setTimeout((()=>{De(i)})),Pe(r)):i},Ge=(e,t="width")=>{var n;const s=e[0],i="width"==t?0:1,o=null==(n=s.size)?void 0:n[i];o&&(e.forEach((e=>{e.size[i]=o})),LGraphCanvas.active_canvas.setDirty(!0,!0))},ze=(e,t="horizontal")=>{if(e.length<3)return;const n="horizontal"===t?0:1;e.sort(((e,t)=>e.pos[n]-t.pos[n]));const s=Math.min(...e.map((e=>e.pos[n]))),i=(Math.max(...e.map((e=>e.pos[n]+e.size[n])))-s-e.reduce(((e,t)=>e+t.size[n]),0))/(e.length-1);let o=s;e.forEach((e=>{e.pos[n]=o,o+=e.size[n]+i})),LGraphCanvas.active_canvas.setDirty(!0,!0)};const je=new class{constructor(){m(this,"element",_(`div.${T}toast`)),m(this,"children",HTMLElement),m(this,"container",document.body),this.container.appendChild(this.element)}async show(e){let t=_(`div.${T}toast-container`,[_("div",[_("span",[...e.icon?[_("i",{className:e.icon})]:[],_("span",e.content)])])]);t.setAttribute("toast-id",e.id),this.element.replaceChildren(t),this.container.appendChild(this.element),await H(64),t.style.marginTop=`-${t.offsetHeight}px`,await H(64),t.classList.add("show"),e.duration&&(await H(e.duration),this.hide(e.id))}async hide(e){const t=document.querySelector(`.${T}toast > [toast-id="${e}"]`);(null==t?void 0:t.classList.contains("show"))&&(t.classList.remove("show"),await H(750)),t&&t.remove()}async clearAllMessages(){let e=document.querySelector(`.${T}container`);e&&(e.innerHTML="")}async info(e,t=3e3,n=[]){this.show({id:"toast-info",icon:`mdi mdi-information ${T}theme`,content:e,duration:t})}async success(e,t=3e3){this.show({id:"toast-success",icon:`mdi mdi-check-circle ${T}success`,content:e,duration:t})}async error(e,t=3e3){this.show({id:"toast-error",icon:`mdi mdi-close-circle ${T}error`,content:e,duration:t})}async warn(e,t=3e3){this.show({id:"toast-warn",icon:`mdi mdi-alert-circle ${T}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")}},Ve=["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","encode"],Ue=["LIGHT - SD1.5 only (low strength)","STANDARD (medium strength)","VIT-G (medium strength)","REGULAR - FLUX and SD3.5 only (high strength)","PLUS (high strength)","PLUS (kolors genernal)","PLUS FACE (portraits)","FULL FACE - SD1.5 only (portraits stronger)","COMPOSITION"],We=["FACEID","FACEID PLUS - SD1.5 only","FACEID PLUS V2","FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"],Fe=["easy seed","easy latentNoisy","easy wildcards","easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingSdTurbo","easy preSamplingCascade","easy preSamplingDynamicCFG","easy preSamplingLayerDiffusion","easy fullkSampler","easy fullCascadeKSampler"],Xe=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy hyditLoader","easy pixArtLoader"],Ze=["easy imageSize","easy imageSizeBySide","easy imageSizeByLongerSide","easy imageSizeShow","easy imageRatio","easy imagePixelPerfect"],qe=["easy forLoopStart","easy forLoopEnd","easy whileLoopStart","easy whileLoopEnd"],He=["easy anythingIndexSwitch","easy imageIndexSwitch","easy textIndexSwitch","easy conditioningIndexSwitch"],Ke=["easy anythingInversedSwitch"],Ye=["easy loadImagesForLoop",...qe,...He,...Ke],Je={"easy anythingInversedSwitch":"out","easy anythingIndexSwitch":"value","easy imageIndexSwitch":"image","easy textIndexSwitch":"text","easy conditioningIndexSwitch":"cond"};let Be=null;function Qe(e,t){const n=e.comfyClass;let s=t.value;switch(t.name){case"range_mode":fe(e,me(e,"step"),"step"==s),fe(e,me(e,"num_steps"),"num_steps"==s),ge(e);break;case"text_combine_mode":fe(e,me(e,"replace_text"),"replace"==s);break;case"lora_name":["lora_model_strength","lora_clip_strength"].map((t=>fe(e,me(e,t),"None"!==s)));break;case"resolution":"自定义 x 自定义"===s&&(t.value="width x height (custom)"),["empty_latent_width","empty_latent_height","width","height"].map((t=>fe(e,me(e,t),"width x height (custom)"===s)));break;case"ratio":["empty_latent_width","empty_latent_height"].map((t=>fe(e,me(e,t),"custom"===s)));break;case"num_loras":var i=s+1,o=me(e,"mode").value;for(let t=0;tfe(e,me(e,t),"simple"!==o)));for(let t=i;t<21;t++)["lora_"+t+"_name","lora_"+t+"_strength","lora_"+t+"_model_strength","lora_"+t+"_clip_strength"].map((t=>fe(e,me(e,t),!1)));ge(e);break;case"num_controlnet":i=s+1,o=me(e,"mode").value;for(let t=0;tfe(e,me(e,t),!0))),["start_percent_"+t,"end_percent_"+t].map((t=>fe(e,me(e,t),"simple"!==o)));for(let t=i;t<21;t++)["controlnet_"+t,"controlnet_"+t+"_strength","scale_soft_weight_"+t,"start_percent_"+t,"end_percent_"+t].map((t=>fe(e,me(e,t),!1)));ge(e);break;case"mode":switch(null==e?void 0:e.comfyClass){case"easy loraStack":i=me(e,"num_loras").value+1,o=s;for(let t=0;tfe(e,me(e,t),"simple"!==o)));ge(e);break;case"easy controlnetStack":i=me(e,"num_controlnet").value+1,o=s;for(let t=0;tfe(e,me(e,t),"simple"!==o)));ge(e);break;case"easy icLightApply":o=s;["lighting","remove_bg"].map((t=>fe(e,me(e,t),"Foreground"===o))),fe(e,me(e,"source"),"Foreground"!==o),ge(e)}break;case"toggle":t.type="toggle",t.options={on:"Enabled",off:"Disabled"};break;case"t5_type":["clip_name","padding"].map((t=>fe(e,me(e,t),"sd3"==s))),["t5_name","device","dtype"].map((t=>fe(e,me(e,t),"t5v11"==s))),ge(e);break;case"preset":if("FLUX.1-dev"==s&&(t.value="REGULAR - FLUX and SD3.5 only (high strength)"),Ue.includes(s)){let t=me(e,"use_tiled");fe(e,me(e,"lora_strength")),fe(e,me(e,"provider"),!!["REGULAR - FLUX and SD3.5 only (high strength)"].includes(s)),fe(e,me(e,"weight_faceidv2")),fe(e,me(e,"weight_kolors")),fe(e,me(e,"use_tiled"),!0),fe(e,me(e,"sharpening"),t&&t.value)}else We.includes(s)&&(fe(e,me(e,"weight_faceidv2"),!!["FACEID PLUS V2","FACEID PLUS KOLORS"].includes(s)),fe(e,me(e,"weight_kolors"),!!["FACEID PLUS KOLORS"].includes(t.value)),["FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"].includes(s)?fe(e,me(e,"lora_strength"),!1):fe(e,me(e,"lora_strength"),!0),fe(e,me(e,"provider"),!0),fe(e,me(e,"use_tiled")),fe(e,me(e,"sharpening")));ge(e);break;case"use_tiled":fe(e,me(e,"sharpening"),!!s),ge(e);break;case"num_embeds":i=s+1;for(let t=0;tfe(e,me(e,t),!1)));break;case"brushnet_random":case"brushnet_segmentation":["dtype","scale","start_at","end_at"].map((t=>fe(e,me(e,t),!0))),["fitting","function"].map((t=>fe(e,me(e,t),!1)));break;case"powerpaint":["dtype","fitting","function","scale","start_at","end_at"].map((t=>fe(e,me(e,t),!0)))}ge(e);break;case"encode":fe(e,me(e,"noise_mask"),!!["inpaint_model_conditioning","different_diffusion"].includes(s)),ge(e);break;case"image_output":fe(e,me(e,"link_id"),!!["Sender","Sender&Save"].includes(s)),fe(e,me(e,"decode_vae_name"),!!["Hide","Hide&Save"].includes(s)),["save_prefix","output_path","embed_workflow","number_padding","overwrite_existing"].map((t=>fe(e,me(e,t),!!["Save","Hide&Save","Sender&Save"].includes(s))));break;case"add_noise":var a=me(e,"control_before_generate"),l=me(e,"control_after_generate")||a;"disable"===s?(fe(e,me(e,"seed")),l&&(l.last_value=l.value,l.value="fixed",fe(e,l))):("enable"===s&&(t.value="enable (CPU)"),fe(e,me(e,"seed"),!0),l&&((null==l?void 0:l.last_value)&&(l.value=l.last_value),fe(e,l,!0))),ge(e);break;case"guider":switch(s){case"Basic":case"IP2P+Basic":["cfg_negative"].map((t=>fe(e,me(e,t))));break;case"CFG":case"IP2P+CFG":fe(e,me(e,"cfg"),!0),fe(e,me(e,"cfg_negative"));break;case"DualCFG":case"IP2P+DualCFG":["cfg","cfg_negative"].map((t=>fe(e,me(e,t),!0)))}ge(e);break;case"scheduler":["karrasADV","exponentialADV","polyExponential"].includes(s)?(["sigma_max","sigma_min"].map((t=>fe(e,me(e,t),!0))),["denoise","beta_d","beta_min","eps_s","coeff"].map((t=>fe(e,me(e,t))),!1),fe(e,me(e,"rho"),"exponentialADV"!=s)):"vp"==s?(["sigma_max","sigma_min","denoise","rho","coeff"].map((t=>fe(e,me(e,t)))),["beta_d","beta_min","eps_s"].map((t=>fe(e,me(e,t),!0)))):(["sigma_max","sigma_min","beta_d","beta_min","eps_s","rho"].map((t=>fe(e,me(e,t)))),fe(e,me(e,"coeff"),"gits"==s),fe(e,me(e,"denoise"),!0)),ge(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=>fe(e,me(e,t)))):"average"==s?(fe(e,me(e,"average_strength"),!0),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>fe(e,me(e,t),!1)))):"timestep"==s&&(["average_strength"].map((t=>fe(e,me(e,t),!1))),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>fe(e,me(e,t),!0))));break;case"rescale":me(e,"rescale_after_model").value,fe(e,me(e,"width"),"to Width/Height"===s),fe(e,me(e,"height"),"to Width/Height"===s),fe(e,me(e,"percent"),"by percentage"===s),fe(e,me(e,"longer_side"),"to longer side - maintain aspect"===s),ge(e);break;case"upscale_method":["factor","crop"].map((t=>fe(e,me(e,t),"None"!==s)));break;case"target_parameter":switch(n){case"easy XYInputs: Steps":["first_step","last_step"].map((t=>fe(e,me(e,t),"steps"==s))),["first_start_step","last_start_step"].map((t=>fe(e,me(e,t),"start_at_step"==s))),["first_end_step","last_end_step"].map((t=>fe(e,me(e,t),"end_at_step"==s)));break;case"easy XYInputs: Sampler/Scheduler":let t=me(e,"input_count").value+1;for(let n=0;nfe(e,me(e,t),"strength"==s))),["first_start_percent","last_start_percent"].map((t=>fe(e,me(e,t),"start_percent"==s))),["first_end_percent","last_end_percent"].map((t=>fe(e,me(e,t),"end_percent"==s))),["strength","start_percent","end_percent"].map((t=>fe(e,me(e,t),s!=t))),ge(e)}case"replace_count":i=s+1;for(let t=0;tfe(e,me(e,t),!r)));for(let t=i;t<11;t++)["lora_name_"+t,"model_str_"+t,"clip_str_"+t].map((t=>fe(e,me(e,t),!1)));ge(e);break;case"ckpt_count":i=s+1;var A=-1!=me(e,"input_mode").value.indexOf("ClipSkip"),d=-1!=me(e,"input_mode").value.indexOf("VAE");for(let t=0;tfe(e,me(e,t),!1)));ge(e);break;case"input_count":i=s+1;var u=me(e,"target_parameter").value;for(let t=0;tfe(e,me(e,n),!!t)));["model_strength","clip_strength"].map((n=>fe(e,me(e,n),!t)));break;case"easy XYInputs: Checkpoint":i=me(e,"ckpt_count").value+1,A=-1!=me(e,"input_mode").value.indexOf("ClipSkip"),d=-1!=me(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 i=(null==(s=null==(t=this.outputs[1])?void 0:t.links)?void 0:s.length)>0?this.outputs[1].links[0]:null,o=n.graph._nodes.find((e=>{var t;return null==(t=e.inputs)?void 0:t.find((e=>e.link==i))}));if(i&&o){const t=o.inputs.find((e=>e.link==i)).widget.name,n=o.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 je.error(Z("No COMBO link"),3e3)}),{serialize:!1})}),Xe.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 i=this.addDOMWidget(t+"_prompt","customtext",n,{getValue:e=>n.value,setValue(e){n.value=e},serialize:!1});i.inputEl=n,i.inputEl.readOnly=!0,n.addEventListener("input",(()=>{var e;null==(e=i.callback)||e.call(i,i.value)})),i.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),i=t(e.negative);n.call(this,s,"positive"),n.call(this,i,"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(){o&&o.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((i=>{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(Fe.includes(s)&&(e.prototype.onNodeCreated=async function(){o&&o.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()*D),n.queuePrompt(0,1)}),{serialize:!1});e.linkedWidgets=[t,s]}},e.prototype.onAdded=async function(){i&&i.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()*D))}),1)}),"easy convertAnything"==s&&(e.prototype.onNodeCreated=async function(){o&&o.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 0;case"easy forLoopEnd":return 1}},n=e=>{switch(s){case"easy forLoopStart":return 2;case"easy forLoopEnd":return 0}};e.prototype.onNodeCreated=async function(){if("easy loadImagesForLoop"==s&&(this.outputs[0].shape=5),qe.includes(s)){const e=this.inputs.findIndex((e=>"flow"===e.name)),i=this.outputs.findIndex((e=>"flow"===e.name));if(-1!==e&&(this.inputs[e].shape=5),-1!==i&&(this.outputs[i].shape=5),"easy whileLoopStart"==s||"easy whileLoopEnd"==s)return;this.inputs=this.inputs.filter(((e,n)=>n<=t())),this.outputs=this.outputs.filter(((e,t)=>t<=n())),ge(this)}return He.includes(s)&&("easy textIndexSwitch"==s&&(this.widgets=this.widgets.filter(((e,t)=>t<=2))),this.inputs=this.inputs.filter(((e,t)=>t<=1)),ge(this)),null==o?void 0:o.apply(this,arguments)},e.prototype.onConnectionsChange=function(e,i,o,a){var l,r;if("easy whileLoopStart"!=s&&"easy whileLoopEnd"!=s&&a)if(1==e){let e=this.inputs.every((e=>null!==e.link)),n=this.inputs.filter((e=>!["condition","index","total"].includes(e.name)));if(qe.includes(s)){if(e){if(n.length>=10)return void je.warn(Z("The maximum number of inputs is 10"));let e=n[n.length-1],t=parseInt(e.name.split("initial_value")[1])+1;if(this.inputs.find((e=>e.name==="initial_value"+t)))return;let s="initial_value"+t,i="value"+t;this.addInput(s,"*"),this.addOutput(i,"*")}else if(!o){const e=t();let n=this.inputs.findLastIndex((e=>e.link));if(i>=e&&(-1===n||i>=n)){let e=this.inputs[i];if(!e.name||["condition","total"].includes(e.name))return;let t=parseInt(e.name.split("initial_value")[1])+1,n=this.inputs.findIndex((e=>e.name==="initial_value"+t)),s=this.outputs.findIndex((e=>e.name==="value"+t));-1!==n&&this.removeInput(n),-1!==s&&this.removeOutput(s)}}}else if(He.includes(s))if(e){if(n.length>=10)return void je.warn(Z("The maximum number of inputs is 10"));let e=Je[s]+n.length;this.addInput(e,"*")}else o||i==this.inputs.length-2&&this.removeInput(i+1)}else if(2==e){let e=this.outputs.filter((e=>!["flow","index"].includes(e.name))),t=e.every((e=>{var t;return(null==(t=e.links)?void 0:t.length)>0}));if(qe.includes(s)){if(t){if(e.length>=10)return void je.warn(Z("The maximum number of inputs is 10"));let t=e[e.length-1],n=parseInt(t.name.split("value")[1])+1;if(this.inputs.find((e=>e.name==="initial_value"+n)))return;if(this.outputs.find((e=>e.name==="value"+n)))return;let s="initial_value"+n,i="value"+n;this.addInput(s,"*"),this.addOutput(i,"*")}else if(!o){const e=n();let t=a.origin_slot,s=this.outputs.findLastIndex((e=>{var t;return(null==(t=e.links)?void 0:t.length)>0}));if(t>=e&&(-1===s||t>=s)){let e=this.outputs[t];if(!e.name||["flow","index"].includes(e.name))return;let n=parseInt(e.name.split("value")[1])+1,s=this.inputs.findIndex((e=>e.name==="initial_value"+n)),i=this.outputs.findIndex((e=>e.name==="value"+n));if(-1!==s&&(null==(l=this.inputs[s])?void 0:l.link))return;-1!==s&&this.removeInput(s),-1!==i&&this.removeOutput(i)}}}else if(Ke.includes(s))if(t){if(e.length>=10)return void je.warn(Z("The maximum number of inputs is 10"));let t=Je[s]+e.length;this.addOutput(t,"*")}else if(!o){let t=a.origin_slot;t==this.outputs.length-2&&0==(null==(r=e[t].links)?void 0:r.length)&&this.removeOutput(t+1)}}}}["easy fluxLoader","easy fullLoader"].includes(s)&&(e.prototype.onConnectionsChange=async function(e,t){var n,s,i,o;r&&r.apply(this,[]);const a=this.inputs.find((e=>"model_override"===e.name)),l=this.inputs.find((e=>"vae_override"===e.name));if(me(this,"vae_name"),me(this,"ckpt_name"),Be||(Be=await b.getNodeDefs()),(null==a?void 0:a.link)&&0==t){const e=null==(o=null==(i=null==(s=null==(n=null==Be?void 0:Be.CheckpointLoaderSimple)?void 0:n.input)?void 0:s.required)?void 0:i.ckpt_name)?void 0:o[0];setTimeout((t=>{this.widgets[0].value=e[0],this.widgets_values[0]=e[0],fe(this,me(this,"ckpt_name"),!(null==a?void 0:a.link))}),1)}else fe(this,me(this,"ckpt_name"),!(null==a?void 0:a.link));(null==l?void 0:l.link)&&2==t?setTimeout((e=>{this.widgets[1].value="Baked VAE",this.widgets_values[1]="Baked VAE",fe(this,me(this,"vae_name"),!(null==l?void 0:l.link))}),1):fe(this,me(this,"vae_name"),!(null==l?void 0:l.link))})},nodeCreated(e){if(e.comfyClass.startsWith("easy ")){if(e.widgets)for(const n of e.widgets){if(!Ve.includes(n.name))continue;let t=n.value;Qe(e,n),Object.defineProperty(n,"value",{get:e=>t,set(s){s!==t&&(t=s,Qe(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("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=>{"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(Ze.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)}))}}}});const $e=LiteGraph.LGraphNode;v.registerExtension({name:"easy bookmark",registerCustomNodes(){class e extends $e{constructor(){super("🔖"),m(this,"type","easy bookmark"),m(this,"title","🔖"),m(this,"slot_start_y",-20),m(this,"___collapsed_width",0),m(this,"isVirtualNode",!0),m(this,"serialize_widgets",!0),m(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=v.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=v.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"}}),v.registerExtension({name:"Comfy.EasyUse.ChainNode",init(){v.canvas._mousemove_callback=e=>{x("EasyUse.Nodes.ChainGetSet",null)&&((e=!1,t={})=>{var n,s,i,o,a;const l=Ce();if(!l||l.length<1)return;const r=be();if(0===r.length)return;let A=t.inputX||160,d=t.ouputX||60;if(r.filter((e=>Ne(e))).length>1)return;for(const c of r){let o=t.inputY||10,a=t.outputY||30;const l=[],u=c.id;if(c.graph){Te[u]||(Te[u]=[]);for(const e of c.inputs??[]){const t=e.link;if(!t)continue;const{origin_id:n,target_slot:s}=Se(t),i=ve(n);if(!i)continue;if(!Ne(i))continue;let a=c.getConnectionPos(!0,s);Te[u][s]||(Te[u][s]=a),!Te[u]||Te[u][s][1]===a[1]&&Te[u][s][0]===a[0]||(A=a[0]-Te[u][s][0],o=a[1]-Te[u][s][1],i.pos=[i.pos[0]+A,i.pos[1]+o]),Te[u][s]=a,l.push(i)}Ie[u]||(Ie[u]=[]);for(const e of c.outputs??[])if(e.links&&c.graph)for(const t of e.links){const{target_id:e,target_slot:s,origin_slot:i}=Se(t),o=ve(e);if(!o)continue;if(!Ne(o))continue;const r=null==(n=o.outputs)?void 0:n.links;if((null==r?void 0:r.length)>1)return;const A=c.getConnectionPos(!1,i);Ie[u][i]||(Ie[u][i]=A),!Ie[u]||Ie[u][i][0]===A[0]&&Ie[u][i][1]===A[1]||(d=A[0]-Ie[u][i][0],a=A[1]-Ie[u][i][1],o.pos=[o.pos[0]+d,o.pos[1]+a]),Ie[u][i]=A,l.push(o)}if(e&&1===r.length){const e=[c,...l];(null==(i=null==(s=c.graph)?void 0:s.list_of_graphcanvas)?void 0:i[0]).selectNodes(e)}}}const u=r[0];if(!u)return;(null==(a=null==(o=u.graph)?void 0:o.list_of_graphcanvas)?void 0:a[0]).setDirty(!0,!0)})()};const e=LGraphCanvas.prototype.showLinkMenu;LGraphCanvas.prototype.showLinkMenu=function(t,n){return n.shiftKey?(((e,t=!1)=>{var n,s,i,o,a,l,r,A,d,u;const{type:c}=e;if("*"===c)return;let{origin_id:p,target_id:h,origin_slot:m,target_slot:f}=e,y=ve(p),g=ve(h);if(!y||!g)return!1;if("Reroute"===y.type){let e=0;[y,e]=Me(y),p=null==y?void 0:y.id,m=e,void 0!==m&&-1!==m||(m=0)}if("Reroute"===g.type&&(g=Pe(g),h=null==g?void 0:g.id,f=null==g?void 0:g.inputs.findIndex((e=>e.type===c)),void 0!==f&&-1!==f||(f=0)),void 0===p||void 0===h||!y||!g)return!1;if(t&&(Ne(y)||Ne(g)))return!1;let v=ke((null==(n=g.getInputInfo(f))?void 0:n.name)??c.toLowerCase());v||(v=ke((null==(i=null==(s=null==y?void 0:y.outputs)?void 0:s[m])?void 0:i.name)??(null==(a=null==(o=null==y?void 0:y.outputs)?void 0:o[m])?void 0:a.type.toString())??v+`_from_${p}_to_${h}`));let b,_=!1,L=!1;if(Ne(y))v=ye(y),L=!0;else{const e=null==(r=null==(l=y.outputs)?void 0:l[m])?void 0:r.links;if(e)for(const t of e){const e=ve((null==(A=Se(t))?void 0:A.target_id)??-1);e&&Ne(e)&&xe(e)&&(v=ye(e),L=!0)}if(!L){for(const e of Ce()){if(v!==ye(e)||!xe(e))continue;const t=null==(d=e.inputs[0])?void 0:d.link;(null==(u=Se(t))?void 0:u.origin_id)===y.id?L=!0:_=!0}_&&(v+=`_from_${p}_to_${h}`)}}if(!L){b=LiteGraph.createNode("easy setNode"),b.is_auto_link=!0;const e=y.getConnectionPos(!1,m);b.pos=[e[0]+20,e[1]],b.inputs[0].name=v,b.inputs[0].type=c,b.inputs[0].widget=g.inputs[f].widget,Oe(b,v),Re(b),b.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(m,b,0),y.widgets_values=t,"PrimitiveNode"===y.type&&setTimeout((()=>{if(y){y.connect(m,b,0);for(const[e,n]of t.entries())Oe(y,n,e);null!==b&&b.setSize(b.computeSize())}}))}const w=LiteGraph.createNode("easy getNode"),S=g.getConnectionPos(!0,f);w.pos=[S[0]-150,S[1]],w.outputs[0].name=v,w.outputs[0].type=c,w.outputs[0].widget=g.inputs[f].widget,Re(w),Oe(w,v),null===w||(w.flags.collapsed=!0,w.setSize(w.computeSize()),w.connect(0,g,f))})(t),!1):(e.apply(this,[t,n]),!1)}}});const et=async()=>{try{const{Running:e,Pending:t}=await b.getQueue();if(e.length>0||t.length>0)return void je.error(Z("Clean Failed")+":"+Z("Please stop all running tasks before cleaning GPU"));200==(await b.fetchApi("/easyuse/cleangpu",{method:"POST"})).status?je.success(Z("Clean SuccessFully")):je.error(Z("Clean Failed"))}catch(e){}};let tt={};function nt(e,t,n,s,i){var o=LGraphCanvas.active_canvas,a=o.getCanvasWindow(),l=o.graph;if(l)return function e(t,s){var r=LiteGraph.getNodeTypesCategories(o.filter||l.filter).filter((function(e){return e.startsWith(t)})),A=[];r.map((function(n){if(n){var s=new RegExp("^("+t+")"),i=n.replace(s,"").split("/")[0],o=""===t?i+"/":t+i+"/",a=i;-1!=a.indexOf("::")&&(a=a.split("::")[1]),-1===A.findIndex((function(e){return e.value===o}))&&A.push({value:o,content:a,has_submenu:!0,callback:function(t,n,s,i){e(t.value,i)}})}})),LiteGraph.getNodeTypesInCategory(t.slice(0,-1),o.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();o.graph.beforeChange();var l=LiteGraph.createNode(e.value);l&&(l.pos=o.convertEventToCanvasOffset(a),o.graph.add(l)),i&&i(l),o.graph.afterChange()}};A.push(t)}}));const d=x("EasyUse.ContextMenu.NodesSort",null);""===t&&d&&(A=function(e){let t=[],n=[];return e.forEach((e=>{(null==e?void 0:e.value)&&M.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)))]}(A)),new LiteGraph.ContextMenu(A,{event:n,parentMenu:s},a)}("",s),!1}function st(e){return encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))}v.registerExtension({name:"Comfy.EasyUse.ContextMenu",async setup(){LGraphCanvas.onMenuAdd=nt,at();const e=LiteGraph.ContextMenu;LiteGraph.ContextMenu=function(t,n){if(!(null==n?void 0:n.callback)||t.some((e=>"string"!=typeof e))){if(n.parentMenu);else if(n.extra);else if(n.scale);else{const e=x("EasyUse.ContextMenu.QuickOptions",null);if(n.hasOwnProperty("extra")&&"Disable"!==e){if("At the forefront"==e?t.unshift(null):t.push(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)))){const n={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){}})()};"At the forefront"==e?t.unshift(n):t.push(n)}const n=x("EasyUse.Hotkeys.cleanVRAMUsed",null)?"("+J("Shift+r")+")":"",i={content:`${Z("Cleanup Of VRAM Usage")} ${n}`,callback:e=>et()};"At the forefront"==e?t.unshift(i):t.push(i);const o=x("EasyUse.Hotkeys.toggleNodesMap",null)?"("+J("Shift+m")+")":"",a={content:`${Z("Nodes Map")} ${o}`,callback:e=>{var t,n,s;const i=(null==(t=v.extensionManager)?void 0:t.sidebarTab)||v.extensionManager,o=(null==(n=v.extensionManager.sidebarTab)?void 0:n.activeSidebarTabId)||(null==(s=v.extensionManager)?void 0:s.activeSidebarTab);i.activeSidebarTabId=o==G?null:G}};"At the forefront"==e?t.unshift(a):t.push(a)}}return e.apply(this,[...arguments])}{const s=function(e,t){const n=x("EasyUse.ContextMenu.ModelsThumbnails",null),s=x("EasyUse.ContextMenu.SubDirectories",null);if(!n&&!s)return null;const i=["ckpt","pt","bin","pth","safetensors"];if((null==e?void 0:e.length)>0){const t=null==(o=e[e.length-1])?void 0:o.substring(o.lastIndexOf(".")+1);if(!i.includes(t))return null}var o;const a=t.callback,l=[...e];t.callback=null;const r=(e,t)=>{["None","无","無","なし"].includes(e.content)?a("None",t):a(l.find((t=>t.endsWith(e.content)),t))};if(n&&!s)return e.map((e=>{var t,n;let s=null==(t=tt[e])?void 0:t.folder,i=null==(n=tt[e])?void 0:n.pathIndex;const o=window.location.protocol,a=window.location.host;let l=s?`${`${o}//${a}`}/api/experiment/models/preview/${s}/${i}/${st(e)}`:"";return{content:e,title:_("div.comfyui-easyuse-contextmenu-model",{},[_("span",{},e)]).outerHTML,thumbnail:l,callback:r}}));const A=e,d={},u=[],c=[];for(const p of A){const e=p.indexOf("/")>-1?"/":"\\",t=p.split(e);if(t.length>1){const n=t.shift();d[n]=d[n]||[],d[n].push({value:t.join(e),fullValue:p})}else"CHOOSE"===p||p.startsWith("DISABLE ")?u.push({value:p,fullValue:p}):c.push({value:p,fullValue:p})}if(Object.values(d).length>0){const e=t.callback;t.callback=null;const s=(t,n)=>{["None","无","無","なし"].includes(t.content)?e("None",n):e(l.find((e=>e.endsWith(t.content)),n))},i=(e,t="",i)=>{var o,a;let l;l=_("div.comfyui-easyuse-contextmenu-model",{},[_("span",{},e)]);let r=null==(o=tt[i])?void 0:o.folder,A=null==(a=tt[i])?void 0:a.pathIndex;const d=window.location.protocol,u=window.location.host;let c=r?`${`${d}//${u}`}/api/experiment/models/preview/${r}/${A}/${st(i)}`:"";return{content:e,thumbnail:n?c:null,title:l.outerHTML,callback:s}},o=[],a=(e,t)=>{let n=[],s=[];const o=e.map((({value:e,fullValue:o})=>{const a={},l=e.indexOf("/")>-1?"/":"\\",r=e.split(l);if(r.length>1){const e=r.shift();a[e]=a[e]||[],a[e].push({value:r.join(l),fullValue:o})}if(Object.values(d).length>0){let t=Object.keys(a)[0];t&&a[t]?n.push({key:t,value:a[t][0]}):s.push(i(e,t,o))}return i(e,t,o)}));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:a(e[1],e[0])}}))),...s]}return o};for(const[t,n]of Object.entries(d))o.push({content:t,has_submenu:!0,callback:()=>{},submenu:{options:a(n,t)}});return o.push(...c.map((e=>i(e.value,"",e.fullValue)))),u.length>0&&o.push(...u.map((e=>i(e.value,"",e.fullValue)))),o}return null}(t,n);return s?e.call(this,s,n):e.apply(this,[...arguments])}var s},LiteGraph.ContextMenu.prototype=e.prototype,x("EasyUse.ContextMenu.NodesSort",null)&&(LiteGraph.ContextMenu.prototype.addItem=ot)}});const it=e=>e&&"object"==typeof e&&"image"in e&&e.content;function ot(e,t,n){var s=this;n=n||{};var i=document.createElement("div");i.className="litemenu-entry submenu";var o=!1;function a(e){var t=this.value,i=!0;(s.current_submenu&&s.current_submenu.close(e),n.callback)&&(!0===n.callback.call(this,t,n,e,s,n.node)&&(i=!1));if(t){if(t.callback&&!n.ignore_item_callbacks&&!0!==t.disabled)!0===t.callback.call(this,t,n,e,s,n.extra)&&(i=!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}),i=!1}}i&&!s.lock&&s.close()}return null===t?i.classList.add("separator"):t.is_category_title?(i.classList.remove("litemenu-entry"),i.classList.remove("submenu"),i.classList.add("litemenu-title"),i.innerHTML=t.title):(i.innerHTML=t&&t.title?t.title:e,i.value=t,t&&(t.disabled&&(o=!0,i.classList.add("disabled")),(t.submenu||t.has_submenu)&&i.classList.add("has_submenu")),"function"==typeof t?(i.dataset.value=e,i.onclick_callback=t):i.dataset.value=t,t.className&&(i.className+=" "+t.className)),i&&it(t)&&(null==t?void 0:t.image)&&!t.submenu&&(i.textContent+=" *",_("div.pysssss-combo-image",{id:`pysssss-image-combo-${e}`,parent:document.body,style:{backgroundImage:`url(/pysssss/view/${st(t.image)})`}})),i&&(null==t?void 0:t.thumbnail)&&(i.addEventListener("mouseenter",lt(i,t.thumbnail,this.root),{passive:!0}),i.addEventListener("mouseleave",rt(),{passive:!0}),i.addEventListener("click",rt(),{passive:!0})),this.root.appendChild(i),o||i.addEventListener("click",a),!o&&n.autoopen&&LiteGraph.pointerListenerAdd(i,"enter",(function(e){var t=this.value;if(!t||!t.has_submenu)return;a.call(this,e)})),i}const at=async()=>{["checkpoints","loras","diffusion_models"].map((async e=>{const t=await b.getModels(e);(null==t?void 0:t.length)>0&&t.map((t=>{tt[t.name]={folder:e,pathIndex:t.pathIndex}}))}))},lt=(e,t,n)=>s=>{setTimeout((s=>{const i=n.getBoundingClientRect();if(!i)return;const o=document.body.getBoundingClientRect();if(!o)return;const{left:a,top:l}=((e,t,n)=>{const{x:s}=e.getBoundingClientRect();let{top:i,left:o}=t;const{width:a,height:l}=n;return s<=a&&(o+=t.width),t.top<=l||(i=l),{left:o,top:i}})(e,i,o),r=document.getElementById("easyuse-model-thumbnail");r.src=t,r.style.left=`${a}px`,r.style.top=`${l}px`,r.style.display="block",r.style.opacity=1,r.onerror=e=>{r.src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAABkAAD/4QMyaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/9k="}}),10)},rt=()=>e=>{const t=document.getElementById("easyuse-model-thumbnail");t.style.display="none",t.style.opacity=0,t.src="",t.style.left="0px",t.style.top="0px"};class At extends L{constructor(){super(),this.element.classList.add("easyuse-model-metadata")}show(e){super.show(_("div",Object.keys(e).map((t=>_("div",[_("label",{textContent:t}),_("span",{textContent:e[t]})])))))}}class dt extends L{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=_("div",{style:{flex:"auto"}}),this.imgCurrent=0,this.imgList=_("div.easyuse-preview-list",{style:{display:"none"}}),this.imgWrapper=_("div.easyuse-preview",[_("div.easyuse-preview-group",[this.imgList])]),this.main=_("main",{style:{display:"flex"}},[this.imgWrapper,this.info]),this.content=_("div.easyuse-model-content",[_("div.easyuse-model-header",[_("h2",{textContent:this.name})]),this.main]);const s=_("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=_("button",{type:"button",textContent:"View raw metadata",disabled:"disabled",style:{opacity:.5,cursor:"not-allowed"},onclick:e=>{this.metadata&&(new At).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 i;n=t.exec(this.customNotes);let o=0;n?(i=n.index,o=n.index+n[0].length):i=this.customNotes.length;let a=this.customNotes.substring(s,i);a&&(a=a.replaceAll("\n","
"),e.push(_("span",{innerHTML:a}))),n&&e.push(_("a",{href:n[0],textContent:n[0],target:"_blank"})),s=o}while(n);return e}addInfoEntry(e,t){return _("p",{parent:this.info},["string"==typeof e?_("label",{textContent:e+": "}):e,"string"==typeof t?_("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=_("span",{textContent:"ℹ️ Loading..."});return this.addInfoEntry(_("label",[_("img",{style:{width:"18px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),_("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(_("h2",{textContent:this.name}),_("div.easyuse-model-header-remark",[_("h5",{textContent:Z("Updated At:")+K(new Date(e.updatedAt),"yyyy/MM/dd")}),_("h5",{textContent:Z("Created At:")+K(new Date(e.updatedAt),"yyyy/MM/dd")})]));let i=null,o=this.parseNote.call(this),a=Z("✏️ Edit"),l=_("div.easyuse-model-detail-textarea",[_("p",(null==o?void 0:o.length)>0?o:{textContent:Z("No notes")})]);if(o&&0!=o.length?l.classList.remove("empty"):l.classList.add("empty"),this.info.replaceChildren(_("div.easyuse-model-detail",[_("div.easyuse-model-detail-head.flex-b",[_("span",Z("Notes")),_("a",{textContent:a,href:"#",style:{fontSize:"12px",float:"right",color:"var(--warning-color)",textDecoration:"none"},onclick:async e=>{if(e.preventDefault(),i){if(i.value!=this.customNotes){je.showLoading(Z("Saving Notes...")),this.customNotes=i.value;const e=await b.fetchApi("/easyuse/metadata/notes/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:this.customNotes});if(je.hideLoading(),200!==e.status)return je.error(Z("Saving Failed")),void alert(`Error saving notes (${e.status}) ${e.statusText}`);je.success(Z("Saving Succeed")),o=this.parseNote.call(this),l.replaceChildren(_("p",(null==o?void 0:o.length)>0?o:{textContent:Z("No notes")})),i.value?l.classList.remove("empty"):l.classList.add("empty")}else l.replaceChildren(_("p",{textContent:Z("No notes")})),l.classList.add("empty");e.target.textContent=a,i.remove(),i=null}else e.target.textContent="💾 Save",i=_("textarea",{placeholder:Z("Type your notes here"),style:{width:"100%",minWidth:"200px",minHeight:"50px",height:"100px"},textContent:this.customNotes}),l.replaceChildren(i),i.focus()}})]),l]),_("div.easyuse-model-detail",[_("div.easyuse-model-detail-head",{textContent:Z("Details")}),_("div.easyuse-model-detail-body",[_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:Z("Type")}),_("div.easyuse-model-detail-item-value",{textContent:e.model.type})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:Z("BaseModel")}),_("div.easyuse-model-detail-item-value",{textContent:e.baseModel})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:Z("Download")}),_("div.easyuse-model-detail-item-value",{textContent:(null==(t=e.stats)?void 0:t.downloadCount)||0})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:Z("Trained Words")}),_("div.easyuse-model-detail-item-value",{textContent:(null==e?void 0:e.trainedWords.join(","))||"-"})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:Z("Source")}),_("div.easyuse-model-detail-item-value",[_("label",[_("img",{style:{width:"14px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),_("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(_("div.easyuse-preview-slide",[_("div.easyuse-preview-slide-content",[_("img",{src:e.url}),_("div.save",{textContent:"Save as preview",onclick:async()=>{if(this.isSaving)return;this.isSaving=!0,je.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,je.error(Z("Saving Failed")),je.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=>{je.success(Z("Saving Succeed")),je.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=_("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=_("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&&_("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 ut extends dt{async addInfo(){await this.addCivitaiInfo()}}class ct extends dt{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("(",""),i=n[1].replace(")","");e.push(`${s.trim()}x${i.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=>_("li.easyuse-model-tag",{dataset:{tag:e[0]},$:e=>{e.onclick=()=>{e.classList.toggle("easyuse-model-tag--selected")}}},[_("p",{textContent:e[0]}),_("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=_("p",[_("span",{textContent:"⚠️ Only showing first 500 tags "}),_("a",{href:"#",textContent:`Show all ${n}`,onclick:()=>{s.replaceChildren(...this.getTagList(this.getTagFrequency())),e.remove()}})])),s=_("ol.easyuse-model-tags-list",this.getTagList(t)),this.tags=_("div",[s])}else this.tags=_("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&&_("div",{parent:this.content,innerHTML:t.description,style:{maxHeight:"250px",overflow:"auto"}})}createButtons(){const e=super.createButtons();function t(e,t){const n=_("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(_("button",{type:"button",textContent:"Copy Selected",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag--selected")])}}),_("button",{type:"button",textContent:"Copy All",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag")])}})),e}}const pt={pipe:{category:"Easy Pipe",nodes:["easy pipeIn","easy pipeOut","easy pipeEdit","easy pipeEditPrompt","easy pipeBatchIndex"],input:{pipe:"pipe"},output:{pipe:"pipe"},widget:{optional_positive:"optional_positive",optional_negative:"optional_negative"}},loaders:{category:"Easy Loaders",nodes:["easy fullLoader","easy a1111Loader","easy comfyLoader","easy kolorsLoader","easy hunyuanDiTLoader","easy pixArtLoader","easy fluxLoader"],input:{optional_lora_stack:"optional_lora_stack",optional_controlnet_stack:"optional_controlnet_stack",positive:"positive",negative:"negative"},output:{pipe:"pipe",model:"model",vae:"vae",clip:null,positive:null,negative:null,latent:null},widget:{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:{category:"Easy PreSampling",nodes:["easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingLayerDiffusion","easy fullkSampler"],input:{pipe:"pipe",image_to_latent:"image_to_latent",latent:"latent"},output:{pipe:"pipe"},widget:{steps:"steps",cfg:"cfg",cfg_scale_min:"cfg",sampler_name:"sampler_name",scheduler:"scheduler",denoise:"denoise",seed_num:"seed_num",seed:"seed"}},samplers:{category:"Custom Sampler",nodes:["KSamplerSelect","SamplerEulerAncestral","SamplerEulerAncestralCFG++","SamplerLMS","SamplerDPMPP_3M_SDE","SamplerDPMPP_2M_SDE","SamplerDPMPP_SDE","SamplerDPMAdaptative","SamplerLCMUpscale","SamplerTCD","SamplerTCD EulerA"],output:{SAMPLER:"SAMPLER"}},sigmas:{category:"Custom Sigmas",nodes:["BasicScheduler","KarrasScheduler","ExponentialScheduler","PolyexponentialScheduler","VPScheduler","BetaSamplingScheduler","SDTurboScheduler","SplitSigmas","SplitSigmasDenoise","FlipSigmas","AlignYourStepsScheduler","GITSScheduler"],output:{SIGMAS:"SIGMAS"}},kSampler:{category:"Easy kSampler",nodes:["easy kSampler","easy kSamplerTiled","easy kSamplerCustom","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerLayerDiffusion"],input:{pipe:"pipe",model:"model"},output:{pipe:"pipe",image:"image"},widget:{image_output:"image_output",save_prefix:"save_prefix",link_id:"link_id"}},controlNet:{category:"Easy ControlNet",nodes:["easy controlnetLoader","easy controlnetLoaderADV","easy controlnetLoader++","easy instantIDApply","easy instantIDApplyADV"],input:{pipe:"pipe",image:"image",image_kps:"image_kps",control_net:"control_net",positive:"positive",negative:"negative",mask:"mask"},output:{pipe:"pipe",positive:"positive",negative:"negative"},widget:{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"]}},adapter:{category:"Easy Adapter",nodes:["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition","easy ipadapterApplyFromParams","easy pulIDApply","easy pulIDApplyADV"],input:{model:"model",image:"image",image_style:"image",attn_mask:"attn_mask",optional_ipadapter:"optional_ipadapter"},output:{model:"model",tiles:"tiles",masks:"masks",ipadapter:"ipadapter"},widget:{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"}},positive:{category:"Easy Positive",nodes:["easy positive","easy wildcards"],input:{},output:{text:"positive",positive:"text"},widget:{text:"positive",positive:"text"}},loadImage:{category:"Easy LoadImage",nodes:["easy loadImageBase64","LoadImage","LoadImageMask"],input:{pipe:"pipe",image:"image",mask:"mask"},output:{IMAGE:"IMAGE",MASK:"MASK"},widget:{image:"image",base64_data:"base64_data",channel:"channel"}},saveImage:{category:"Save/Preview Image",nodes:["SaveImage","PreviewImage"]},inPaint:{category:"Easy Inpaint",nodes:["easy applyBrushNet","easy applyPowerPaint","easy applyInpaint"],input:{},output:{pipe:"pipe"},widget:{dtype:"dtype",fitting:"fitting",function:"function",scale:"scale",start_at:"start_at",end_at:"end_at"}},showAny:{category:"Show Anything",nodes:["easy showAnything","easy showAnythingLazy"],input:{anything:"anything"},output:{output:"output"}},saveText:{category:"Save Text",nodes:["easy saveText","easy saveTextLazy"],input:{image:"image",text:"text",output_file_path:"output_file_path",file_name:"file_name",file_extension:"file_extension",overwrite:"overwrite"},output:{text:"text",image:"image"},widget:{image:"image",text:"text",output_file_path:"output_file_path",file_name:"file_name",file_extension:"file_extension",overwrite:"overwrite"}},persona:{category:"LLM Party Persona",nodes:["load_persona","classify_persona","classify_persona_plus","custom_persona","translate_persona","flux_persona"],input:{file_content:"file_content"},output:{system_prompt:"system_prompt"},widget:{is_enable:"is_enable"}},llmModelLoader:{category:"LLM Model Loader",nodes:["LLM_api_loader","genai_api_loader","LLM_local_loader"],output:{model:"model"}},llmModelChain:{category:"LLM Model Chain",nodes:["LLM","LLM_local"],input:{model:"model",image:"images",images:"image",extra_parameters:"extra_parameters",system_prompt_input:"system_prompt_input",user_prompt_input:"user_prompt_input",tools:"tools",file_content:"file_content"},output:{assistant_response:"assistant_response",history:"history",tool:"tool",image:"image"},widget:{system_prompt:"system_prompt",user_prompt:"user_prompt",temperature:"temperature",is_memory:"is_memory",is_tools_in_sys_prompt:"is_tools_in_sys_prompt",max_length:"max_length",main_brain:"main_brain",conversation_rounds:"conversation_rounds",history_record:"history_record",is_enable:"is_enable"}},maskModify:{category:"Mask Modify",nodes:["CropMask","ThresholdMask","GrowMask","FeatherMask","LayerMask: MaskGrain","LayerMask: MaskEdgeUltraDetail","LayerMask: MaskEdgeUltraDetail V2"],input:{mask:"mask"},output:{MASK:"MASK",mask:"mask",image:"image"}},maskModifyWAS:{category:"Mask Modify (WAS)",nodes:["Mask Dilate Region","Mask Gaussian Region"],input:{masks:"masks"},output:{MASKS:"MASKS"}}};function ht(e,t,n){return function(){!function(e,t,n){var s;const i=LiteGraph.createNode(t);if(i){if(v.graph.add(i),i.pos=e.pos.slice(),i.size=e.size.slice(),(null==(s=e.widgets)?void 0:s.length)>0&&e.widgets.forEach((e=>{var t,s,o;if(null==(s=null==(t=pt[n])?void 0:t.widget)?void 0:s[e.name]){const t=pt[n].widget[e.name];if(t&&i.widgets){const n=(o=t,i.widgets.find((e=>"object"==typeof o?o.includes(e.name):e.name===o)));n&&(n.value=e.value,"seed_num"==e.name&&(n.linkedWidgets[0].value=e.linkedWidgets[0].value),"converted-widget"==e.type&&_t(i,n,e))}}})),e.inputs&&e.inputs.forEach(((t,s)=>{var o,a,l;if(t&&t.link&&(null==(a=null==(o=pt[n])?void 0:o.input)?void 0:a[t.name])){const s=null==(l=pt[n])?void 0:l.input[t.name];if(null===s)return;const o=i.findInputSlot(s);if(-1!==o){const n=e.graph.links[t.link];if(n){const t=e.graph.getNodeById(n.origin_id);t&&t.connect(n.origin_slot,i,o)}}}})),e.outputs&&e.outputs.forEach(((t,s)=>{var o,a;if(t&&t.links&&(null==(a=null==(o=pt[n])?void 0:o.output)?void 0:a[t.name])){const s=pt[n].output[t.name];if(null===s)return;const o=i.findOutputSlot(s);-1!==o&&t.links.forEach((t=>{const n=e.graph.links[t];if(n){const t=e.graph.getNodeById(n.target_id);t&&i.connect(o,t,n.target_slot)}}))}})),v.graph.remove(e),"easy fullkSampler"==i.type){const e=i.outputs[0].links;if(e&&e[0]){const t=v.graph._nodes.find((t=>t.inputs&&t.inputs[0]&&t.inputs[0].link==e[0]));t&&v.graph.remove(t)}}else if(pt.preSampling.nodes.includes(i.type)){const e=i.outputs[0].links;if(!e||!e[0]){const e=LiteGraph.createNode("easy kSampler");v.graph.add(e),e.pos=i.pos.slice(),e.pos[0]=e.pos[0]+i.size[0]+20;const t=i.findInputSlot("pipe");-1!==t&&i&&i.connect(0,e,t)}}i.setSize([i.size[0],i.computeSize()[1]])}}(e,t,n)}}const mt=(e,t)=>{const n=e.prototype.getExtraMenuOptions;e.prototype.getExtraMenuOptions=function(){const e=n.apply(this,arguments);return t.apply(this,arguments),e}},ft=(e,t,n,s,i=!0)=>{mt(s,(function(s,o){o.unshift({content:e,has_submenu:i,callback:(e,s,i,o,a)=>yt(e,s,i,o,a,t,n)}),"loaders"==t&&(o.unshift({content:Z("💎 View Lora Info..."),callback:(e,t,n,s,i)=>{let o=i.widgets.find((e=>"lora_name"==e.name)).value;o&&"None"!=o&&new ct(o).show("loras",o)}}),o.unshift({content:Z("💎 View Checkpoint Info..."),callback:(e,t,n,s,i)=>{let o=i.widgets[0].value;o&&"None"!=o&&new ut(o).show("checkpoints",o)}}))}))},yt=(e,t,n,s,i,o,a)=>{const l=[];return a.map((e=>{i.type!==e&&l.push({content:`${e}`,callback:ht(i,e,o)})})),new LiteGraph.ContextMenu(l,{event:n,callback:null,parentMenu:s,node:i}),!1},gt="converted-widget",vt=Symbol();function bt(e,t,n=""){if(t.origType=t.type,t.origComputeSize=t.computeSize,t.origSerializeValue=t.serializeValue,t.computeSize=()=>[0,-4],t.type=gt+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)bt(e,s,":"+t.name)}function _t(e,t,n){bt(e,t);const{type:s}=function(e){let t=e[0];t instanceof Array&&(t="COMBO");return{type:t}}(n),i=e.size;t.options&&t.options.forceInput||e.addInput(t.name,s,{widget:{name:t.name,[vt]:()=>n}});for(const o of e.widgets)o.last_y+=LiteGraph.NODE_SLOT_HEIGHT;e.setSize([Math.max(i[0],e.size[0]),Math.max(i[1],e.size[1])])}const Lt=function(e){var t,n,s,i;const o=e.constructor.type,a=e.properties.origVals||{},l=a.title||e.title,r=a.color||e.color,A=a.bgcolor||e.bgcolor,d=e,u={size:[...e.size],color:r,bgcolor:A,pos:[...e.pos]};let c=[],p=[];if(e.inputs)for(const y of e.inputs)if(y.link){const t=y.name,n=e.findInputSlot(t),s=e.getInputNode(n),i=e.getInputLink(n);c.push([i.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];p.push([e,s,n.target_slot])}}v.graph.remove(e);let h=v.graph.add(LiteGraph.createNode(o,l,u));function m(){if(d.widgets)for(let e of d.widgets)if("converted-widget"===e.type){const t=h.widgets.find((t=>t.name===e.name));for(let n of d.inputs)n.name===e.name&&_t(h,t,n.widget)}for(let e of c){const[t,n,s]=e;n.connect(t,h.id,s)}for(let e of p){const[t,n,s]=e;h.connect(t,n,s)}}h.inputs.map(((t,n)=>{h.inputs[n].label=e.inputs[n].label})),h.outputs.map(((t,n)=>{h.outputs[n].label=e.outputs[n].label}));let f=d.widgets_values;if(!f&&(null==(t=h.widgets)?void 0:t.length)>0)return h.widgets.forEach(((e,t)=>{const n=d.widgets[t];e.name===n.name&&e.type===n.type&&(e.value=n.value)})),void m();if(f){let e=function(e,t){var n,s,i,o,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==(i=t.options)?void 0:i.min)<=e&&e<=(null==(o=t.options)?void 0:o.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 o=(null==f?void 0:f.length)<=(null==(n=h.widgets)?void 0:n.length);let a=o?0:f.length-1;const l=n=>{var s;const i=d.widgets[n];let l=h.widgets[n];if(l.name===i.name&&l.type===i.type){for(;(o?a=0)&&!t;){let{value:t,pass:n}=e(f[a],l);if(n&&null!==t){l.value=t;break}a+=o?1:-1}a++,o||(a=f.length-((null==(s=h.widgets)?void 0:s.length)-1-n))}};if(o&&(null==(s=h.widgets)?void 0:s.length)>0)for(let n=0;n0)for(let n=h.widgets.length-1;n>=0;n--)l(n)}m()};v.registerExtension({name:"Comfy.EasyUse.ExtraMenu",async beforeRegisterNodeDef(e,t,n){mt(e,(function(e,n){n.unshift({content:Z("🔃 Reload Node"),callback:(e,t,n,s,i)=>{let o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)Lt(i);else for(let a in o.selected_nodes)Lt(o.selected_nodes[a])}}),"easy ckptNames"==t.name&&n.unshift({content:Z("💎 View Checkpoint Info..."),callback:(e,t,n,s,i)=>{i.widgets[0].value}})}));for(const s in pt)pt[s].nodes.includes(t.name)&&ft(`↪️ Swap ${pt[s].category}`,s,pt[s].nodes,e)}});const wt=LiteGraph.LGraphNode,St="➡️";v.registerExtension({name:"easy setNode",registerCustomNodes(){class e extends wt{constructor(t){super("Set"),m(this,"defaultVisibility",!0),m(this,"serialize_widgets",!0),this.properties||(this.properties={previousName:""}),this.properties.showOutputText=e.defaultVisibility;const n=this;n.color=LGraphCanvas.node_colors.blue.color,this.addWidget("text","Constant","",((e,t,s,i,o)=>{n.validateName(n.graph),""!==this.widgets[0].value&&(this.title=St+this.widgets[0].value),this.properties.previousName=this.widgets[0].value,this.update()}),{}),this.addInput("*","*"),this.onConnectionsChange=function(e,t,s,i,o){if(1!=e||s||(this.inputs[t].type="*",this.inputs[t].name="*",this.title="Set"),i&&n.graph&&1==e&&s){const e=n.graph._nodes.find((e=>e.id==i.origin_id)).outputs[i.origin_slot];if(!e)return;const t=e.type,s=n.is_auto_link?this.widgets[0].value:e.name;"Set"===this.title&&(this.title=St+s,this.widgets[0].value=s),"*"===this.widgets[0].value&&(this.widgets[0].value=s),this.validateName(n.graph),this.inputs[0]&&(this.inputs[0].type=t,this.inputs[0].name=s),setTimeout((e=>{this.title=St+this.widgets[0].value,this.properties.previousName=this.widgets[0].value}),1)}this.update()},this.validateName=function(e){let t=n.widgets[0].value;if(""!=t){let s=0,i=[];do{i=e._nodes.filter((e=>e!=this&&("easy setNode"==e.type&&e.widgets[0].value===t))),i.length>0&&(t=n.widgets[0].value+s),s++}while(i.length>0);n.widgets[0].value=t,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(n.graph){this.findGetters(n.graph).forEach((e=>{e.setType(this.inputs[0].type)})),this.widgets[0].value&&this.findGetters(n.graph,!0).forEach((e=>{e.setName(this.widgets[0].value)}));n.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"}}),v.registerExtension({name:"easy getNode",registerCustomNodes(){class e extends wt{constructor(t){super("Get"),m(this,"defaultVisibility",!0),m(this,"serialize_widgets",!0),this.properties||(this.properties={}),this.properties.showOutputText=e.defaultVisibility;const n=this;n.color=LGraphCanvas.node_colors.blue.color,this.addWidget("combo","Constant","",(e=>{this.onRename()}),{values:()=>n.graph._nodes.filter((e=>"easy setNode"==e.type)).map((e=>e.widgets[0].value)).sort()}),this.addOutput("*","*"),this.onConnectionsChange=function(e,t,n,s,i){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){n.widgets[0].value=e,n.onRename(),n.serialize()},this.onRename=function(e=0){const t=this.findSetter(n.graph);if(t){const n=t.inputs[0].type,s=t.inputs[0].name;this.setType(n,s),this.outputs[e].type=n,this.outputs[e].name=s,this.title="⬅️"+t.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 t=n.graph.links[e];t&&t.type!=this.outputs[0].type&&"*"!=t.type&&n.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 Et=["easy imageSave","easy fullkSampler","easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo","easy detailerFix"];v.registerExtension({name:"Comfy.EasyUse.SaveImageExtraOutput",async beforeRegisterNodeDef(e,t,n){if(Et.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=()=>S(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"],Ct=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo"],Tt=["easy controlnetLoader","easy controlnetLoaderADV"],It=["easy instantIDApply","easy instantIDApplyADV"],Ot=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition"],Rt=["easy pipeIn","easy pipeOut","easy pipeEdit","easy pipeEditPrompt"],Dt=["easy XYPlot","easy XYPlotAdvanced"],Mt=["easy setNode"],Pt=["Reroute","RescaleCFG","LoraLoaderModelOnly","LoraLoader","FreeU","FreeU_v2",...Ot,...Mt],Gt={"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",...Rt,...Mt],MODEL:Pt},to:{STRING:["Reroute",...xt]}},"easy a1111Loader":{from:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Rt,...Mt],MODEL:Pt},to:{STRING:["Reroute",...xt]}},"easy comfyLoader":{from:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Rt,...Mt],MODEL:Pt},to:{STRING:["Reroute",...xt]}},"easy hunyuanDiTLoader":{from:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Rt,...Mt],MODEL:Pt},to:{STRING:["Reroute",...xt]}},"easy kolorsLoader":{from:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Rt,...Mt],MODEL:Pt},to:{STRING:["Reroute",...xt]}},"easy pixArtLoader":{from:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Rt,...Mt],MODEL:Pt},to:{STRING:["Reroute",...xt]}},"easy fluxLoader":{from:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Rt,...Mt],MODEL:Pt},to:{STRING:["Reroute",...xt]}},"easy svdLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Rt,...Mt],MODEL:Pt},to:{STRING:["Reroute",...xt]}},"easy zero123Loader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Rt,...Mt],MODEL:Pt},to:{STRING:["Reroute",...xt]}},"easy sv3dLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Rt,...Mt],MODEL:Pt},to:{STRING:["Reroute",...xt]}},"easy preSampling":{from:{PIPE_LINE:["Reroute",...Ct,...Rt,...Tt,...Dt,...Mt]}},"easy preSamplingAdvanced":{from:{PIPE_LINE:["Reroute",...Ct,...Rt,...Tt,...Dt,...Mt]}},"easy preSamplingDynamicCFG":{from:{PIPE_LINE:["Reroute",...Ct,...Rt,...Tt,...Dt,...Mt]}},"easy preSamplingCustom":{from:{PIPE_LINE:["Reroute",...Ct,...Rt,...Tt,...Dt,...Mt]}},"easy preSamplingLayerDiffusion":{from:{PIPE_LINE:["Reroute","easy kSamplerLayerDiffusion",...Ct,...Rt,...Tt,...Dt,...Mt]}},"easy preSamplingNoiseIn":{from:{PIPE_LINE:["Reroute",...Ct,...Rt,...Tt,...Dt,...Mt]}},"easy fullkSampler":{from:{PIPE_LINE:["Reroute",...Rt.reverse(),"easy preDetailerFix","easy preMaskDetailerFix",...Nt,...Mt]}},"easy kSampler":{from:{PIPE_LINE:["Reroute",...Rt.reverse(),"easy preDetailerFix","easy preMaskDetailerFix","easy hiresFix",...Nt,...Mt]}},"easy controlnetLoader":{from:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Rt,...Mt]}},"easy controlnetLoaderADV":{from:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Rt,...Mt]}},"easy instantIDApply":{from:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Rt,...Mt],MODEL:Pt},to:{COMBO:["Reroute","easy promptLine"]}},"easy instantIDApplyADV":{from:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Rt,...Mt],MODEL:Pt},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",...Rt,...Mt]},to:{PIPE_LINE:["Reroute","easy ultralyticsDetectorPipe","easy samLoaderPipe","easy kSampler","easy fullkSampler"]}},"easy preMaskDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Rt,...Mt]}},"easy samLoaderPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Rt,...Mt]}},"easy ultralyticsDetectorPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Rt,...Mt]}},"easy cascadeLoader":{from:{PIPE_LINE:["Reroute","easy fullCascadeKSampler","easy preSamplingCascade",...Tt,...Rt,...Mt],MODEL:Pt.filter((e=>!Ot.includes(e)))}},"easy fullCascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Rt,...Mt]}},"easy preSamplingCascade":{from:{PIPE_LINE:["Reroute","easy cascadeKSampler",...Rt,...Mt]}},"easy cascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Rt,...Mt]}},"easy pipeEdit":{from:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Mt]},to:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Rt,...Mt]}},"easy pipeEditPrompt":{from:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Mt]},to:{PIPE_LINE:["Reroute",...Nt,...Tt,...It,...Rt,...Mt]}}};v.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,i=!s&&n.nodeTo&&null!==n.slotTo;if(!s&&!i)return!1;if(!n.nodeType)return!1;var o=s?n.nodeFrom:n.nodeTo,a=s?n.slotFrom:n.slotTo,l=o.type,r=!1;switch(typeof a){case"string":r=s?o.findOutputSlot(a,!1):o.findInputSlot(a,!1),a=s?o.outputs[a]:o.inputs[a];break;case"object":r=s?o.findOutputSlot(a.name):o.findInputSlot(a.name);break;case"number":r=a,a=s?o.outputs[a]:o.inputs[a];break;default:return!1}var A=a.type==LiteGraph.EVENT?"_event_":a.type,d=s?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in;if(d&&d[A]){a.link;let e=!1;const i=s?"from":"to";if(Gt[l]&&Gt[l][i]&&(null==(t=Gt[l][i][A])?void 0:t.length)>0){for(var u in Gt[l][i][A])if(n.nodeType==Gt[l][i][A][u]||"AUTO"==n.nodeType){e=Gt[l][i][A][u];break}}else if("object"==typeof d[A]||"array"==typeof d[A]){for(var u in d[A])if(n.nodeType==d[A][u]||"AUTO"==n.nodeType){e=d[A][u];break}}else n.nodeType!=d[A]&&"AUTO"!=n.nodeType||(e=d[A]);if(e){var c=!1;"object"==typeof e&&e.node&&(c=e,e=e.node);var p=LiteGraph.createNode(e);if(p){if(c){if(c.properties)for(var h in c.properties)p.addProperty(h,c.properties[h]);if(c.inputs)for(var h in p.inputs=[],c.inputs)p.addOutput(c.inputs[h][0],c.inputs[h][1]);if(c.outputs)for(var h in p.outputs=[],c.outputs)p.addOutput(c.outputs[h][0],c.outputs[h][1]);c.title&&(p.title=c.title),c.json&&p.configure(c.json)}return this.graph.add(p),p.pos=[n.position[0]+n.posAdd[0]+(n.posSizeFix[0]?n.posSizeFix[0]*p.size[0]:0),n.position[1]+n.posAdd[1]+(n.posSizeFix[1]?n.posSizeFix[1]*p.size[1]:0)],s?n.nodeFrom.connectByType(r,p,A):n.nodeTo.connectByTypeOutput(r,p,A),!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,allow_searchbox:this.allow_searchbox,showSearchBox:this.showSearchBox},e),s=this,i=n.nodeFrom&&n.slotFrom,o=!i&&n.nodeTo&&n.slotTo;if(!i&&!o)return!1;var a=i?n.nodeFrom:n.nodeTo,l=i?n.slotFrom:n.slotTo,r=!1;switch(typeof l){case"string":r=i?a.findOutputSlot(l,!1):a.findInputSlot(l,!1),l=i?a.outputs[l]:a.inputs[l];break;case"object":r=i?a.findOutputSlot(l.name):a.findInputSlot(l.name);break;case"number":r=l,l=i?a.outputs[l]:a.inputs[l];break;default:return!1}var A=["Add Node",null];n.allow_searchbox&&(A.push("Search"),A.push(null));var d=l.type==LiteGraph.EVENT?"_event_":l.type,u=i?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in,c=a.type;if(u&&u[d]){const e=i?"from":"to";if(Gt[c]&&Gt[c][e]&&(null==(t=Gt[c][e][d])?void 0:t.length)>0)for(var p in Gt[c][e][d])A.push(Gt[c][e][d][p]);else if("object"==typeof u[d]||"array"==typeof u[d])for(var p in u[d])A.push(u[d][p]);else A.push(u[d])}var h=new LiteGraph.ContextMenu(A,{event:n.e,title:(l&&""!=l.name?l.name+(d?" | ":""):"")+(l&&d?d:""),callback:function(e,t,o){switch(e){case"Add Node":LGraphCanvas.onMenuAdd(null,null,o,h,(function(e){i?n.nodeFrom.connectByType(r,e,d):n.nodeTo.connectByTypeOutput(r,e,d)}));break;case"Search":i?n.showSearchBox(o,{node_from:n.nodeFrom,slot_from:l,type_filter_in:d}):n.showSearchBox(o,{node_to:n.nodeTo,slot_from:l,type_filter_out:d});break;default:s.createDefaultNodeForSlot(Object.assign(n,{position:[n.e.canvasX,n.e.canvasY],nodeType:e}))}}});return!1}}}),v.registerExtension({name:"Comfy.EasyUse.TimeTaken",setup(){let e=new Map,t=0;b.addEventListener("execution_start",(e=>{graph&&graph._nodes.forEach((e=>{e.executionDuration&&delete e.executionDuration}))})),b.addEventListener("executing",(n=>{if(!x("EasyUse.Nodes.Runtime",null))return;const s=(null==n?void 0:n.node)||(null==n?void 0:n.detail)||null,i=e.get(t);if(e.delete(t),t&&i){const e=Date.now()-i,n=ve(t);n&&(n.executionDuration||(n.executionDuration=0),n.executionDuration=n.executionDuration+e/1e3)}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;t=parseFloat(t).toFixed(3)+Z("s"),e.save(),e.fillStyle=LiteGraph.NODE_DEFAULT_BGCOLOR,function(e,t,n,s,i,o){e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+s-o,n),e.arcTo(t+s,n,t+s,n+o,o),e.lineTo(t+s,n+i-o),e.arcTo(t+s,n+i,t+s-o,n+i,o),e.lineTo(t+o,n+i),e.arcTo(t,n+i,t,n+i-o,o),e.lineTo(t,n+o),e.arcTo(t,n,t+o,n,o),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,i="#000",o=12,a="Inter"){e.font=`${o}px ${a}`,e.fillStyle=i,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 zt=null;v.registerExtension({name:"Comfy.EasyUse.HotKeys",setup(){if(void 0!==y){y("up,down,left,right",(function(e,t){var n,s,i,o,a,l,r,A,d,u,c,p,h,m,f;e.preventDefault();if(!x("EasyUse.Hotkeys.JumpNearestNodes",null))return;const y=be();if(0===y.length)return;const g=y[0];switch(t.key){case"up":case"left":let e=null;if(Ee(g)){const e=null==(n=g.widgets_values)?void 0:n[0],t=null==(s=g.graph)?void 0:s._nodes,i=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}));i&&Le(i)}else if((null==(i=g.inputs)?void 0:i.length)>0){for(let t=0;t{var n;if(Ee(t)){if((null==(n=t.widgets_values)?void 0:n[0])===e)return t}return null}));n&&Le(n)}else if((null==(u=g.outputs)?void 0:u.length)>0){for(let e=0;e0&&g.outputs[e].links[0]){t=g.outputs[e].links[0];break}if(t){const e=null==(p=g.graph)?void 0:p.links;if(e[t]){const n=null==(h=e[t])?void 0:h.target_id,s=null==(f=null==(m=g.graph)?void 0:m._nodes_by_id)?void 0:f[n];s&&Le(s)}}}}})),y("shift+up,shift+down,shift+left,shift+right,shift+alt+⌘+left,shift+alt+⌘+right,shift+alt+ctrl+left,shift+alt+ctrl+right",(function(e,t){e.preventDefault();if(!x("EasyUse.Hotkeys.AlignSelectedNodes",null))return;const n=be();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]);break;case"shift+alt+ctrl+left":case"shift+alt+⌘+left":ze(s,"horizontal");break;case"shift+alt+ctrl+right":case"shift+alt+⌘+right":ze(s,"vertical")}zt||(zt=B()),zt&&zt.update()})),y("shift+⌘+left,shift+⌘+right,shift+ctrl+left,shift+ctrl+right",(function(e,t){e.preventDefault();if(!x("EasyUse.Hotkeys.NormalizeSelectedNodes",null))return;const n=be();if(n.length<=1)return;const s=n;switch(t.key){case"shift+ctrl+left":case"shift+⌘+left":Ge(s,"width");break;case"shift+ctrl+right":case"shift+⌘+right":Ge(s,"height")}zt||(zt=B()),zt&&zt.update()})),y("shift+g",(function(e,t){e.preventDefault();x("EasyUse.Hotkeys.AddGroup",null)&&(Vt(),zt||(zt=B()),zt&&zt.update())})),y("shift+r",(function(e,t){e.preventDefault();x("EasyUse.Hotkeys.cleanVRAMused",null)&&et()})),y("shift+m",(function(e,t){var n,s,i;if(!x("EasyUse.Hotkeys.toggleNodesMap",null))return;let o=(null==(n=v.extensionManager)?void 0:n.sidebarTab)||v.extensionManager,a=(null==(s=v.extensionManager.sidebarTab)?void 0:s.activeSidebarTabId)||(null==(i=v.extensionManager)?void 0:i.activeSidebarTab);o.activeSidebarTabId=a==G?null:G}));const e=[];Array.from(Array(10).keys()).forEach((t=>e.push(`alt+${t}`))),y(e.join(","),(async function(e,t){e.preventDefault();if(!x("EasyUse.Hotkeys.NodesTemplate",null))return;const n=t.key;let s=parseInt(n.split("+")[1]);const i=await b.getUserData("comfy.templates.json");let o=null;if(200==i.status)try{o=await i.json()}catch(l){je.error(Z("Get Node Templates File Failed"))}else localStorage["Comfy.NodeTemplates"]?o=JSON.parse(localStorage["Comfy.NodeTemplates"]):je.warn(Z("No Node Templates Found"));if(!o)return void je.warn(Z("No Node Templates Found"));s=0===s?9:s-1;const a=o[s];if(a)try{const e=(null==a?void 0:a.name)||"Group",t=(null==a?void 0:a.data)?JSON.parse(a.data):[];jt((async()=>{await k.registerFromWorkflow(t.groupNodes,{}),localStorage.litegrapheditor_clipboard=a.data,v.canvas.pasteFromClipboard(),t.groupNodes||Vt(e)}))}catch(l){je.error(l)}else je.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===be().length)return;zt||(zt=B()),zt&&zt.update()}};window.addEventListener("keydown",t,!0)}}});const jt=async e=>{const t=localStorage.litegrapheditor_clipboard;await e(),localStorage.litegrapheditor_clipboard=t},Vt=e=>{const t=be();if(0===t.length)return;const n=t;let s=new LiteGraph.LGraphGroup;s.title=e||"Group",((e,t=[],n=20)=>{var s,i,o,a,l,r,A,d,u,c;for(var p of(i=o=a=l=-1,r=A=d=u=-1,[e._nodes,t]))for(var h in p)r=(c=p[h]).pos[0],A=c.pos[1],d=c.pos[0]+c.size[0],u=c.pos[1]+c.size[1],"Reroute"!=c.type&&(A-=LiteGraph.NODE_TITLE_HEIGHT),(null==(s=c.flags)?void 0:s.collapsed)&&(u=A+LiteGraph.NODE_TITLE_HEIGHT,(null==c?void 0:c._collapsed_width)&&(d=r+Math.round(c._collapsed_width))),(-1==i||ra)&&(a=d),(-1==l||u>l)&&(l=u);o-=Math.round(1.4*e.font_size),e.pos=[i-n,o-n],e.size=[a-i+2*n,l-o+2*n]})(s,n),v.canvas.graph.add(s)};function Ut(e,t,n,s){const i=[];return e.workflow.links.forEach((e=>{n&&e[1]===t&&!i.includes(e[3])&&i.push(e[3]),s&&e[3]===t&&!i.includes(e[1])&&i.push(e[1])})),i}async function Wt(e,t=!1){const n=structuredClone(await v.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(;!v.graph._nodes_by_id[e].isChooser;)e=Ut(n,e,!0,!1)[0];const i=function(e,t){const n=[],s=[t];for(;s.length>0;){const t=s.pop();n.push(t),s.push(...Ut(e,t,!0,!1).filter((e=>!(n.includes(e)||s.includes(e)))))}s.push(...n.filter((e=>e!=t)));const i=[t];for(;s.length>0;){const t=s.pop();i.push(t),s.push(...Ut(e,t,!1,!0).filter((e=>!(i.includes(e)||s.includes(e)))))}const o=[];return o.push(...n),o.push(...i.filter((e=>!o.includes(e)))),o}(n,e);n.workflow.nodes=n.workflow.nodes.filter((t=>(t.id===e&&t.inputs.forEach((e=>{e.link=null})),i.includes(t.id)))),n.workflow.links=n.workflow.links.filter((e=>i.includes(e[1])&&i.includes(e[3])));const o={};for(const[r,A]of Object.entries(n.output))i.includes(parseInt(r))&&(o[r]=A);const a={};for(const[r,A]of Object.entries(o[e.toString()].inputs))Array.isArray(A)||(a[r]=A);o[e.toString()].inputs=a,n.output=o;const l=v.graphToPrompt;v.graphToPrompt=()=>(v.graphToPrompt=l,n),v.queuePrompt(0)}const Ft=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 v.runningNodeId!=this.current_node_id&&(this.current_node_id=v.runningNodeId,this.current_node_id?(this.class_of_current_node=null==(t=null==(e=v.graph)?void 0:e._nodes_by_id[v.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)}},Xt=class e{constructor(){}static idle(){return!v.runningNodeId}static paused(){return!0}static paused_here(t){return e.here(t)}static running(){return!e.idle()}static here(e){return v.runningNodeId==e}static state(){return"Paused"}};m(Xt,"cancelling",!1);let Zt=Xt;function qt(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 Ht(){qt(-1,"__cancel__"),Zt.cancelling=!0,b.interrupt(),Zt.cancelling=!1}var Kt=0;function Yt(){Kt+=1}const Jt=["easy kSampler","easy kSamplerTiled","easy fullkSampler"];function Bt(e){const t=v.graph._nodes_by_id[e.detail.id];if(t){t.selected_images=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=()=>{v.graph.setDirtyCanvas(!0)},n.src=`/view?filename=${encodeURIComponent(t.filename)}&type=temp&subfolder=${v.getPreviewFormatParam()}`})),null==(n=e.setSizeForImage)||n.call(e),e.imgs}(t,e.detail.urls);return{node:t,image:n,isKSampler:Jt.includes(t.type)}}}function Qt(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 $t extends L{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=_("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_images.has(n)?t.selected_images.delete(n):t.selected_images.add(n)}});return s}));super.show(_("div.comfyui-easyuse-chooser-dialog",[_("h5.comfyui-easyuse-chooser-dialog-title",Z("Choose images to continue")),_("div.comfyui-easyuse-chooser-dialog-images",n)]))}createButtons(){const e=super.createButtons();return e[0].onclick=e=>{Zt.running()&&Ht(),super.close()},e.unshift(_("button",{type:"button",textContent:Z("Choose Selected Images"),onclick:e=>{qt(this.node.id,[...this.node.selected_images,-1,...this.node.anti_selected]),Zt.idle()&&(Yt(),Wt(this.node.id).then((()=>{qt(this.node.id,[...this.node.selected_images,-1,...this.node.anti_selected])}))),super.close()}})),e}}function en(){const e=v.graph._nodes_by_id[this.node_id];if(e){const t=[...e.selected_images];(null==t?void 0:t.length)>0&&e.setProperty("values",t),qt(e.id,[...e.selected_images,-1,...e.anti_selected]),Zt.idle()&&(Yt(),Wt(e.id).then((()=>{qt(e.id,[...e.selected_images,-1,...e.anti_selected])})))}}function tn(){Zt.running()&&Ht()}function nn(e){Object.defineProperty(e,"clicked",{get:function(){return this._clicked},set:function(e){this._clicked=e&&""!=this.name}})}function sn(e){e.options||(e.options={}),e.options.serialize=!1}v.registerExtension({name:"Comfy.EasyUse.imageChooser",init(){window.addEventListener("beforeunload",Ht,!0)},setup(e){const t=LGraphCanvas.prototype.draw;LGraphCanvas.prototype.draw=function(){Ft.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}=Bt(e);if(s){(new $t).show(n,t)}}));const n=b.interrupt;b.interrupt=function(){Zt.cancelling||Ht(),n.apply(this,arguments)},b.addEventListener("execution_start",(function(){(Kt>0?(Kt-=1,0):(qt(-1,"__start__"),1))&&e.graph._nodes.forEach((e=>{(e.selected_images||e.anti_selected)&&(e.selected_images.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,i){if(n.isPrimary){const t=function(e,t){var n,s;if((null==(n=e.imgs)?void 0:n.length)>1)for(var i=0;i0&&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","","",en),e.cancel_button_widget=e.addWidget("button","","",tn),nn(e.cancel_button_widget),nn(e.send_button_widget),sn(e.cancel_button_widget),sn(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;if(e.imgs){if(e.imageRects)for(let n=0;n{Qt(e,n,t)})),t.strokeStyle="#F88",null==(n=null==e?void 0:e.anti_selected)||n.forEach((n=>{Qt(e,n,t)}))}}(this,e)},e.prototype.imageClicked=function(t){"easy imageChooser"===(null==e?void 0:e.comfyClass)&&(this.selected_images.has(t)?this.selected_images.delete(t):this.selected_images.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_images?this.selected_images.size:0)+(this.anti_selected?this.anti_selected.size:0),n=(null==(e=this.imgs)?void 0:e.length)||0;Zt.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=Zt.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,i=0,o=0,a="string"==typeof e?e:e.toString(),l="string"==typeof t?t:t.toString();try{i=a.toString().split(".")[1].length}catch(r){}try{o=l.toString().split(".")[1].length}catch(r){}return n=Number(a.toString().replace(".","")),s=Number(l.toString().replace(".","")),n/s*Math.pow(10,o-i)}(this,e)};let on=[],an=0;const ln={sd3:6.5,"sd3-turbo":4};class rn extends L{constructor(){super(),this.lists=[],this.dialog_div=null,this.user_div=null}addItem(e,t){return _("div.easyuse-account-dialog-item",[_("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);on[t].name=e.target.value},value:on[e].name}),_("input.key",{type:"text",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);on[t].key=e.target.value},placeholder:"Enter APIKEY",value:on[e].key}),_("button.choose",{textContent:Z("Choose"),onclick:async e=>{var n,s,i;const o=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);let a=on[o].name,l=on[o].key;if(!a)return void je.error(Z("Please enter the account name"));if(!l)return void je.error(Z("Please enter the APIKEY"));let r=!0;for(let t=0;t{(new rn).show(t)}},[_("div.user",[_("div.avatar",o?[_("img",{src:o})]:"😀"),_("div.info",[_("h5.name",a),_("h6.remark","Credits: "+l)])]),_("div.edit",{textContent:Z("Edit")})])),je.success(Z("Save Succeed"))}else je.success(Z("Save Succeed"));this.close()}else je.error(Z("Save Failed"))}}),_("button.delete",{textContent:Z("Delete"),onclick:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);on.length<=1?je.error(Z("At least one account is required")):(on.splice(t,1),this.dialog_div.removeChild(e.target.parentNode))}})])}show(e){on.forEach(((t,n)=>{this.lists.push(this.addItem(n,e))})),this.dialog_div=_("div.easyuse-account-dialog",this.lists),super.show(_("div.easyuse-account-dialog-main",[_("div",[_("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(_("button",{type:"button",textContent:Z("Save Account Info"),onclick:e=>{let t=!0;for(let n=0;n{200==e.status?je.success(Z("Save Succeed")):je.error(Z("Save Failed"))}))}else je.error(Z("APIKEY is not Empty"))}})),e.unshift(_("button",{type:"button",textContent:Z("Add Account"),onclick:e=>{const t="Account "+on.length.toString();on.push({name:t,key:""});const n=this.addItem(on.length-1);this.lists.push(n),this.dialog_div.appendChild(n)}})),e}}v.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 i=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),o=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="-"+ln[e]};const l=this.addWidget("text","cost_credit","0",(e=>{}),{serialize:!1});l.disabled=!0,setTimeout((e=>{"control_before_generate"==o.name&&0===i.value&&(i.value=Math.floor(4294967294*Math.random())),l.value="-"+ln[a.value]}),100);let r=_("div.easyuse-account-user",[Z("Loading UserInfo...")]);this.addDOMWidget("account","btn",_("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)?ln[e.model]:0;if(t){let e=function(e,t){let n,s,i,o,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 i=Math.pow(10,Math.max(n,s)),o=n>=s?n:s,((e*i-t*i)/i).toFixed(o)}(parseFloat(n[0].innerText.replace(/Credits: /g,"")),t);e>0&&(n[0].innerText="Credits: "+e.toString())}}await H(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 A=await b.fetchApi("/easyuse/stability/api_keys");if(200==A.status){let t=await A.json();if(on=t.keys,an=t.current,on.length>0&&void 0!==an){const t=on[an].key,i=on[an].name;if(t){const t=await b.fetchApi("/easyuse/stability/user_info");if(200==t.status){const i=await t.json();if((null==i?void 0:i.account)&&(null==i?void 0:i.balance)){const t=(null==(e=i.account)?void 0:e.profile_picture)||null,o=(null==(n=i.account)?void 0:n.email)||null,a=(null==(s=i.balance)?void 0:s.credits)||0;r.replaceChildren(_("div.easyuse-account-user-info",{onclick:e=>{(new rn).show(r)}},[_("div.user",[_("div.avatar",t?[_("img",{src:t})]:"😀"),_("div.info",[_("h5.name",o),_("h6.remark","Credits: "+a)])]),_("div.edit",{textContent:Z("Edit")})]))}}}else r.replaceChildren(_("div.easyuse-account-user-info",{onclick:e=>{(new rn).show(r)}},[_("div.user",[_("div.avatar","😀"),_("div.info",[_("h5.name",i),_("h6.remark",Z("Click to set the APIKEY first"))])]),_("div.edit",{textContent:Z("Edit")})]))}}}}}});let An=null;function dn(){An&&(An.removeEventListeners(),An.dropdown.remove(),An=null)}function un(e,t,n,s=!1){dn(),new cn(e,t,n,s)}class cn{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),An=this}buildNestedDropdown(e,t){let n=0;Object.keys(e).forEach((s=>{const i=e[s];if("object"==typeof i&&null!==i){const e=document.createElement("ul");e.setAttribute("role","listbox"),e.classList.add("easy-nested-dropdown");const o=document.createElement("li");o.classList.add("folder"),o.textContent=s,o.appendChild(e),o.addEventListener("mouseover",this.onMouseOver.bind(this,n,t)),t.appendChild(o),this.buildNestedDropdown(i,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(An)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 pn(e){const t=e.min||0,n=e.max||0,s=e.step||1;if(0===s)return[];const i=[];let o=t;for(;o<=n;){if(Number.isInteger(s))i.push(Math.round(o)+"; ");else{let e=o.toFixed(3);-0==e&&(e="0.000"),/\.\d{3}$/.test(e)||(e+="0"),i.push(e+"; ")}o+=s}return n>=0&&t>=0?i:i.reverse()}let hn={},mn={};function fn(e,t){String(e.id);const n=t.name,s=t.value.replace(/^(loader|preSampling):\s/,"");mn[n]?mn[n]!=hn[s]&&(mn[n]=hn[s]):mn={...mn,[n]:hn[s]}}v.registerExtension({name:"Comfy.EasyUse.XYPlot",async beforeRegisterNodeDef(e,t,n){if("easy XYPlot"===t.name){hn=t.input.hidden.plot_dict[0];for(const e in hn){const t=hn[e];if(Array.isArray(t)){let n=[];for(const e of t)n.push(e+"; ");hn[e]=n}else hn[e]="object"==typeof t?"seed"==e?t+"; ":pn(t):t+"; "}hn.None=[],hn["---------------------"]=[]}},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,fn(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,i){return e&&(t[s]=e),t.map((e=>n(e,i))).filter((e=>""!==e)).join("")},n=function(e,t){if(e=s(e),i(e,t))return e+"; ";let n=o(e,t);return 1===n.length||2===n.length?n[0]:i(a(e),t)?a(e)+"; ":""},s=function(e){return e.replace(/(\n|;| )/g,"")},i=function(e,t){return t.includes(e+"; ")},o=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==mn?void 0:mn[n])||[];if(0===s.length)return;const i=e.inputEl.value,o=e.inputEl.selectionStart;let a=i.split("; ");const l=i.substring(0,o).split("; ").length-1,r=a[l].replace(/\n/g,"").toLowerCase(),A=s.filter((e=>e.toLowerCase().includes(r))).map((e=>e.replace(/; /g,"")));if(A.length>0)un(e.inputEl,A,(n=>{const i=t(n,a,l,s);e.inputEl.value=i}));else{dn();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 $,P as N,b as a,v as b,fe as c,x as d,et as e,G as f,me as g,N as h,we as j,X as l,H as s,je as t,B as u}; diff --git a/web_version/v2/easyuse.js b/web_version/v2/easyuse.js index 8be8ecc..0c47aab 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}#crystools-root-easyuse{flex-direction:row;justify-content:center;flex-shrink:1;width:min-content;min-width:max-content;height:100%;margin:0 auto}#crystools-root-easyuse .crystools-monitor-container{width:100%;cursor:crosshair;display:flex;flex-wrap:wrap;flex-direction:row;justify-content:flex-end;gap:5px;height:100%}#crystools-root-easyuse .crystools-monitor-container .crystools-monitor{background-color:var(--comfy-input-bg);position:relative;align-items:center;flex-direction:row;width:40px;height:100%}#crystools-root-easyuse .crystools-monitor-container .crystools-monitor .crystools-text{font-size:10px;text-align:right;margin-left:3px;position:absolute;font-weight:100;bottom:2px;z-index:10}#crystools-root-easyuse .crystools-monitor-container .crystools-content{position:relative;height:100%}#crystools-root-easyuse .crystools-monitor-container .crystools-slider{position:absolute;height:100%;width:0;box-shadow:inset 2px 2px 10px #0003}#crystools-root-easyuse .crystools-monitor-container .crystools-label{position:relative;width:100%;color:var(--input-text);font-weight:500;font-size:11px;left:2px;top:4px;text-align:right}: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:var(--input-text);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{background:var(--comfy-menu-bg);border-bottom:1px solid var(--bg-color)}.comfyui-easyuse .side-tool-bar-container{background:var(--comfy-menu-bg);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}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}(); -var e;import{$ as s,l as t,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-B1YS9G41.js";import{r as y,w as h,e as f,b as A,c as w,I as S,d as x,G as E,C as M,J as b,K as _,L as k,M as C,z as B,F as I,o as H,N,D as Q,O as z,E as j,P as R,x as D,Q as L,R as Z,S as Y}from"./assets/vue-Wm3LYzLs.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-DS46y2Fr.js";import{c as T}from"./assets/lodash-CZi7izHi.js";import{P as X}from"./assets/primevue-BfXuwIdd.js";import"./assets/primeuix-6j2DF8mJ.js";const J=O("graphStore",{state:e=>({selectors:[],selectors_styles:{},seg_selectors:[],slider_controls:[]}),actions:{setSelectors(e){this.selectors=T(e)},setStyles(e,s){this.selectors_styles[e]||(this.selectors_styles[e]=s)},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"],se=["onMouseenter","onMouseleave"],te=["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 t=await l.fetchApi(`/easyuse/prompt/styles?name=${e}`);if(200===t.status){let e=(await t.json()).map(((e,s)=>(e.index=s,e)));return await i.setStyles(n.type,e),!0}return a.error(s("Get styles list Failed")),!1})(e)&&c()}),{immediate:!0});const d=o,c=e=>{const s=n.selectedStyles,t=T(r.value[n.type]);u.value=t.sort(((e,s)=>e.index-s.index)).sort(((e,t)=>s.includes(t.name)-s.includes(e.name)))},p=y(""),v=e=>e.toLowerCase(),m=f({}),g=e=>{m.src="",m.name="",m.positive="",m.negative=""},H=async e=>{const s=await l.fetchApi(`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`);if(200===s.status){const t=await s.text();if(t.startsWith("http"))return t;return`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`}},N=e=>{e.target.src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QNLaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG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eAHkN+Ichj3p2rBvZq9vUnY2tcNQPqpZYZpJ44GxXqzHdVlzZZpib73mLHViI85c1BZ6OpsIe/6/XSuntevdsz6+8+pI0/yM1dtWVr2Z644P8rmyuj6S53jxkh9aQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBB/9k="};return(l,a)=>(A(),w("div",{class:E(ue+` ${ue}-styles`),"data-id":e.id,onMouseleave:g},[u.value.length>0&&e.show?(A(),w(S,{key:0},[x("div",{class:E(ue+"__header")},[x("div",{class:E(ue+"__header_button"),onClick:a[0]||(a[0]=e=>(d("chooseStyle",[]),void(p.value="")))},K,2),x("div",{class:E(ue+"__header_search")},[$,M(x("textarea",{class:"search","onUpdate:modelValue":a[1]||(a[1]=e=>p.value=e),dir:"ltr",rows:1,placeholder:_(s)("Type here to search styles ...")},null,8,ee),[[b,p.value]])],2)],2),x("div",{class:E(ue+"__content"),onMouseleave:c},[(A(!0),w(S,null,k(u.value,((s,l)=>(A(),w("div",{class:E(ue+"-item"),key:l,onMouseenter:e=>(async e=>{if(!e.imageSrc){if(e.imageLoading)return;e.imageLoading=!0;const s=await H(e.imgName).finally((()=>e.imageLoading=!1));e.imageSrc=s}m.name="zh"==t&&e.name_cn?e.name_cn:e.name,m.positive=e.prompt,m.negative=e.negative_prompt,m.src=e.imageSrc})(s),onMouseleave:C((e=>g()),["stop"])},[x("span",{class:E([ue+"-item__tag",{hide:!(e.selectedStyles.includes(s.name)||-1!=v(s.name).indexOf(v(p.value))||s.name_cn&&-1!=v(s.name_cn).indexOf(v(p.value)))}]),onClick:e=>(e=>{let s=n.selectedStyles;s.includes(e.name)?s=s.filter((s=>s!==e.name)):s.push(e.name),d("chooseStyle",s)})(s)},[x("input",{type:"checkbox",name:s.name,checked:e.selectedStyles.includes(s.name)},null,8,le),x("span",null,B(["zh","zh_CN"].includes(_(t))&&s.name_cn?s.name_cn:s.name),1)],10,te)],42,se)))),128))],34),(null==m?void 0:m.src)||(null==m?void 0:m.positive)||(null==m?void 0:m.negative)?(A(),w("div",{key:0,class:E(ue+"-preview")},[m.src?(A(),w("img",{key:0,src:m.src,ref:"image",alt:"preview",onError:N},null,40,ae)):I("",!0),x("div",{class:E(ue+"-preview__text")},[x("b",null,B(m.name),1),x("div",{class:E(ue+"-preview__prompt")},[m.positive?(A(),w("h6",oe,[ne,x("span",null,B(m.positive),1)])):I("",!0),m.negative?(A(),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:t}){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"];break;case"human_parts (deeplabv3p)":a.value=["Background","Face","Hair","Glasses","Top-clothes","Bottom-clothes","Torso-skin","Left-arm","Right-arm","Left-leg","Right-leg","Left-foot","Right-foot"]}}),{immediate:!0});const o=t;return(t,n)=>{var i;return A(),w("div",{class:E(me+` ${me}-seg`),"data-id":e.id},[(null==(i=a.value)?void 0:i.length)>0&&e.show?(A(!0),w(S,{key:0},k(a.value,((t,a)=>(A(),w("div",{class:E(me+"-item"),key:a},[x("span",{class:E(me+"-item__tag"),onClick:e=>(e=>{let s=T(l.selected);s.includes(e)?s=s.filter((s=>s!==e)):s.push(e),o("select",s)})(a)},[x("input",{type:"checkbox",name:t,checked:e.selected.includes(a)},null,8,ve),x("span",null,B(_(s)(t)),1)],10,pe)],2)))),128)):I("",!0)],10,ce)}}},ye=["data-id"],he=["onMousedown","onDblclick"],fe="comfyui-easyuse-slider",Ae="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:s}){const t=e,l=s,a=(e,s,t)=>(e-s)/(t-s)*100,o=(e,s,l=void 0)=>{if(t.mode===Ae){let t={3:2.5,6:1}[s]||0;return{default:12==e?t:0,min:-1,max:3,step:.05,value:void 0!==l?l:12==e?t:0,top:void 0!==l?100-a(l,-1,3)+"%":null,height:void 0!==l?a(l,-1,3)+"%":null}}};h((e=>t.mode),(async(e,s)=>{var a;if(e!==s&&e===Ae)if(!s&&(null==(a=t.values)?void 0:a.length)>0){const e=t.values.map((e=>{const s=e.split(":");return o(t.values.length,s[0],parseFloat(s[1]))}));await l("changeValues",e)}else{let e="sd1"==t.type?16:12,s=Array.from({length:e},((s,t)=>o(e,t)));await l("changeValues",s)}l("showSlider")}),{immediate:!0}),h((e=>t.type),((e,s)=>{if(e!=s&&t.mode==Ae){let e="sd1"==t.type?16:12,s=Array.from({length:e},((s,t)=>o(e,t)));l("changeValues",s)}}));const n=y(null),i=y(null);return H((()=>{document.onmouseup=e=>document.onmousemove=null})),(s,o)=>{var r;return A(),w("div",{class:E(fe),"data-id":e.id},[(null==(r=e.values)?void 0:r.length)>0&&e.show?(A(!0),w(S,{key:0},k(e.values,((s,o)=>(A(),w("div",{class:E([fe+"-item",{positive:3==o&&"sdxl"==e.type&&e.mode==Ae},{negative:6==o&&"sdxl"==e.type&&e.mode==Ae}]),key:o},[x("div",{class:E(fe+"-item-input")},B(s.value),3),x("div",{class:E(fe+"-item-scroll"),ref_for:!0,ref_key:"scroll",ref:n},[x("div",{class:E(fe+"-item-bar"),ref_for:!0,ref_key:"bar",ref:i,style:N({top:s.top||100-a(s.default,s.min,s.max)+"%"}),onMousedown:e=>((e,s,a)=>{let o=e||window.event,r=n.value[a],u=i.value[a],d=T(t.values),c=o.clientY-u.offsetTop;document.onmousemove=e=>{let t=(e||window.event).clientY-c;t<0?t=0:t>r.offsetHeight-u.offsetHeight&&(t=r.offsetHeight-u.offsetHeight);let o=(s.max-s.min)/s.step,n=(r.offsetHeight-u.offsetHeight)/o;t=Math.round(t/n)*n;const i=Math.floor(t/(r.offsetHeight-u.offsetHeight)*100)+"%",p=Math.floor((r.offsetHeight-u.offsetHeight-t)/(r.offsetHeight-u.offsetHeight)*100)+"%",v=parseFloat(parseFloat(s.max-(s.max-s.min)*(t/(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,s,o),onDblclick:e=>((e,s,a)=>{let o=T(t.values);o[a]={...o[a],top:null,height:null,value:s.default},l("changeValues",o)})(0,s,o)},null,46,he),x("div",{class:E(fe+"-item-area"),style:N({height:s.height||a(s.default,s.min,s.max)+"%"})},null,6)],2),x("div",{class:E(fe+"-item-label")},[x("span",null,B(s.label),1)],2)],2)))),128)):I("",!0)],8,ye)}}},Se={__name:"index",setup(e){const s=J(),{selectors:t,seg_selectors:l,slider_controls:a}=V(s),u=y({}),d=async e=>{var l,a,o,r,d,c,p;await n(1);const v=i(e,"styles"),m=(null==(l=e.properties.values)?void 0:l.length)>0?e.properties.values:[];let g=T(t.value);g.push({id:e.id,type:v.value,value:m,show:!1});const y=g.length-1;await s.setSelectors(g),(null==(a=e.flags)?void 0:a.collapsed)&&e.collapse();let h=null==(d=null==(r=null==(o=u.value[e.id])?void 0:o._)?void 0:r.vnode)?void 0:d.el;if(!h)return;let f=e.addDOMWidget("select_styles","btn",h);e.properties.values||e.setProperty("values",[]),g[y].show=!0,await s.setSelectors(g);let A=v.value;Object.defineProperty(v,"value",{set:t=>{A=t,g[y].type=t,e.properties.values=[],g[y].value=[],s.setSelectors(g)},get:e=>A}),Object.defineProperty(f,"value",{set:e=>{setTimeout((t=>{g[y].value=e.split(","),s.setSelectors(g)}),150)},get:s=>{var l,a;return e.properties.values=(null==(a=null==(l=t.value)?void 0:l[y])?void 0:a.value)||[],e.properties.values.join(",")}}),((null==(c=e.size)?void 0:c[0])<150||(null==(p=e.size)?void 0:p[1])<150)&&e.setSize([425,500]);const w=e.onRemoved;e.onRemoved=function(){if(w&&(null==w||w.apply(this,arguments)),void 0!==t.value.findIndex((s=>s.id==e.id))){let e=T(t.value);e.splice(y,1),s.setSelectors(e)}return w}},c=y({}),p=async e=>{var t,a,o,u,d;await n(1);const p=i(e,"method"),v=(null==(t=e.properties.values)?void 0:t.length)>0?e.properties.values:[];let m=T(l.value);m.push({id:e.id,type:p.value,value:v,show:!1});const g=m.length-1;await s.setSegSelectors(m),(null==(a=e.flags)?void 0:a.collapsed)&&e.collapse();let y=null==(d=null==(u=null==(o=c.value[e.id])?void 0:o._)?void 0:u.vnode)?void 0:d.el;if(!y)return;let h=e.addDOMWidget("mask_components","btn",y);e.properties.values||e.setProperty("values",[]),m[g].show=!0,await s.setSegSelectors(m);let f=p.value;Object.defineProperty(p,"value",{set:t=>{f=t,m[g].type=t,e.properties.values=[],m[g].value=[],r(e,i(e,"confidence"),"selfie_multiclass_256x256"===f),e.setSize([300,"selfie_multiclass_256x256"===f?260:400]),s.setSegSelectors(m)},get:e=>f}),Object.defineProperty(h,"value",{set:e=>{setTimeout((t=>{m[g].value=e.split(","),s.setSegSelectors(m)}),150)},get:s=>{var t;return e.properties.values=(null==(t=l.value)?void 0:t[g].value)||[],e.properties.values.join(",")}}),r(e,i(e,"confidence"),"selfie_multiclass_256x256"===f),e.setSize([300,"selfie_multiclass_256x256"===f?260:500]);const A=e.onRemoved;e.onRemoved=function(){if(A&&(null==A||A.apply(this,arguments)),void 0!==l.value.findIndex((s=>s.id==e.id))){let e=T(l.value);e.splice(g,1),s.setSegSelectors(e)}return A}},v=y({}),m=async e=>{var t,l,o,r,u;await n(1);const d=i(e,"mode"),c=i(e,"model_type"),p=(null==(t=e.properties.values)?void 0:t.length)>0?e.properties.values:[];(null==(l=e.flags)?void 0:l.collapsed)&&e.collapse();let m=T(a.value);m.push({id:e.id,type:c.value,mode:d.value,value:p,show:!1});const g=m.length-1;await s.setSliderControls(m);let y=null==(u=null==(r=null==(o=v.value[e.id])?void 0:o._)?void 0:r.vnode)?void 0:u.el;if(!y)return;let h=e.addDOMWidget("values","btn",y);e.properties.values||e.setProperty("values",[]),Object.defineProperty(h,"value",{set:function(){},get:s=>{var t;const l=(null==(t=a.value)?void 0:t[g].value)||[];return e.properties.values=l.map(((e,s)=>`${s}:${e.value}`)),e.properties.values.join(",")}}),e.setSize("sdxl"==c.value?[375,320]:[455,320]),c.callback=t=>{m=T(a.value),m[g].type!=t&&(e.setSize("sdxl"==t?[375,320]:[455,320]),m[g].value=[],m[g].type=t,s.setSliderControls(m))};const f=e.onRemoved;e.onRemoved=function(){if(f&&(null==f||f.apply(this,arguments)),void 0!==a.value.findIndex((s=>s.id==e.id))){let e=T(a.value);e.splice(g,1),s.setSliderControls(e)}return f}};return H((e=>{o.registerExtension({name:"Comfy.EasyUse.Components",async beforeRegisterNodeDef(e,s){const t=e.prototype.onNodeCreated;"easy stylesSelector"==s.name&&(e.prototype.onNodeCreated=async function(){return t&&(null==t||t.apply(this,arguments)),await d(this),t}),"easy humanSegmentation"==s.name&&(e.prototype.onNodeCreated=async function(){return t&&(null==t||t.apply(this,arguments)),await p(this),t}),"easy sliderControl"==s.name&&(e.prototype.onNodeCreated=async function(){return t&&(null==t||t.apply(this,arguments)),await m(this),t}),"easy poseEditor"==s.name&&(e.prototype.onNodeCreated=async function(){t&&(null==t||t.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),t})}})})),(e,o)=>(A(),w(S,null,[(A(!0),w(S,null,k(_(t),((e,l)=>(A(),Q(de,{ref_for:!0,ref:s=>{s&&(u.value[e.id]=s)},type:e.type,key:l,id:e.id,show:e.show,selectedStyles:e.value,onChooseStyle:e=>((e,l)=>{let a=T(t.value);a[l].value=e,s.setSelectors(a)})(e,l)},null,8,["type","id","show","selectedStyles","onChooseStyle"])))),128)),(A(!0),w(S,null,k(_(l),((e,t)=>(A(),Q(ge,{ref_for:!0,ref:s=>{s&&(c.value[e.id]=s)},type:e.type,key:t,id:e.id,show:e.show,selected:e.value,onSelect:e=>((e,t)=>{let a=T(l.value);a[t].value=e,s.setSegSelectors(a)})(e,t)},null,8,["type","id","show","selected","onSelect"])))),128)),(A(!0),w(S,null,k(_(a),((e,t)=>(A(),Q(we,{ref_for:!0,ref:s=>{s&&(v.value[e.id]=s)},type:e.type,key:t,id:e.id,show:e.show,mode:e.mode,values:e.value,onChangeValues:e=>((e,t)=>{let l=T(a.value);l[t].value=e,s.setSliderControls(l)})(e,t),onShowSlider:e=>(e=>{let t=T(a.value);t[e].show=!0,s.setSliderControls(t)})(t)},null,8,["type","id","show","mode","values","onChangeValues","onShowSlider"])))),128))],64))}},xe={class:"no-result-placeholder"},Ee={class:"no-result-placeholder-content"},Me={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=>(s,t)=>(A(),w("div",xe,[z(_(G),null,{content:j((()=>[x("div",Ee,[x("i",{class:E(e.icon),style:N({"font-size":e.iconSize,"margin-bottom":".5rem"})},null,6),x("h3",null,B(e.title),1),e.message?(A(),w("p",Me,B(e.message),1)):I("",!0),e.buttonLabel?(A(),Q(_(P),{key:1,label:e.buttonLabel,onClick:t[0]||(t[0]=e=>s.$emit("action")),class:"p-button-text"},null,8,["label"])):I("",!0)])])),_:1})]))},_e={class:"left flex-1"},ke={key:1,class:"edit"},Ce={key:2,class:"label"},Be={class:"right toolbar"},Ie={key:0,class:"nodes"},He={__name:"group",props:{item:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup(e){const s=e,t=u(),l=y(!1),a=y(null),n=y(""),i=e=>{var l,a;let n=s.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,t.setGroups(o.canvas.graph._groups))}},r=async()=>{let e=s.item,a=o.canvas.graph._groups.find((s=>s.pos[0]==e.info.pos[0]&&s.pos[1]==e.info.pos[1]));a?(a.is_edit=!1,a.title=n.value,await t.setGroups(o.canvas.graph._groups),l.value=!1):l.value=!1};return(u,c)=>{var p,v,m;return A(),w(S,null,[x("div",{class:E("comfyui-easyuse-map-nodes-group"),onClick:i},[x("div",_e,[e.item.children?(A(),w("i",{key:0,class:E(["icon",e.item.info.show_nodes?"pi pi-folder-open":"pi pi-folder"]),style:N({color:e.item.info.color})},null,6)):I("",!0),(null==(p=e.item.info)?void 0:p.is_edit)?(A(),w("div",ke,[z(_(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:[R(r,["enter"]),R(r,["esc"])],style:{width:"100%"}},null,8,["modelValue"])])):(A(),w("div",Ce,[x("span",{onDblclick:c[1]||(c[1]=C((i=>(async()=>{var e,i;if(l.value)return;let r=s.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 t.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?(A(),Q(_(P),{key:0,size:"small",icon:e.item.children.find((e=>e.mode==_(d).ALWAYS))?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:c[2]||(c[2]=C((e=>u.$emit("changeMode")),["stop"])),onMousedown:c[3]||(c[3]=C((e=>u.$emit("mousedown")),["stop"])),onMouseup:c[4]||(c[4]=C((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?(A(),w("div",Ie,[D(u.$slots,"default")])):I("",!0)],64)}}},Ne={key:1,class:"label error"},Qe={class:"right toolbar"},ze={__name:"node",props:{node:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup:e=>(s,t)=>(A(),w("div",{draggable:!1,class:E(["comfyui-easyuse-map-nodes-node",{never:void 0!==e.node.mode&&e.node.mode==_(d).NEVER},{bypass:void 0!==e.node.mode&&e.node.mode==_(d).BYPASS}])},[void 0!==e.node.title?(A(),w("span",{key:0,class:"label",onDblclick:t[0]||(t[0]=C((s=>_(c)(e.node.id)),["stop"]))},B(e.node.title),33)):(A(),w("span",Ne,B(e.node.type),1)),x("div",Qe,[z(_(P),{size:"small",icon:e.node.mode==_(d).ALWAYS?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:t[1]||(t[1]=C((e=>s.$emit("changeMode")),["stop"])),onMousedown:t[2]||(t[2]=C((e=>s.$emit("mousedown")),["stop"])),onMouseup:t[3]||(t[3]=C((e=>s.$emit("mouseup")),["stop"]))},null,8,["icon"])])],2))},je={class:"title"},Re={class:"toolbar"},De={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 t=u(),{groups_nodes:l,groups:n}=V(t),i=y(!1),r=e=>{i.value=!i.value,o.canvas.graph._groups.forEach((e=>{e.show_nodes=i.value})),t.setGroups(o.canvas.graph._groups)};let c,v=0,m=0,g=!1;const h=(e,s=!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?s?d.NEVER:d.BYPASS:d.ALWAYS,e.graph.change())})),t.setNodes(o.canvas.graph._nodes)},f=(e,s=!1)=>{if(g)return void(g=!1);const l=e.mode==d.ALWAYS,a=o.canvas.graph._nodes.find((s=>s.id==e.id));a&&(a.mode=l?s?d.NEVER:d.BYPASS:d.ALWAYS,a.graph.change(),t.setNodes(o.canvas.graph._nodes))},b=(e,s="group")=>{v=(new Date).getTime(),clearTimeout(c),c=setTimeout((t=>{"group"==s?h(e,!0):f(e,!0)}),500)},H=e=>{m=(new Date).getTime(),m-v>500&&(g=!0),clearTimeout(c)};let N=y(null),R=y(null);y(!1);return(e,u)=>{var d,c;return A(),w("div",{class:E(Ye)},[x("div",{class:E(Ye+"__header"),onMousedown:u[0]||(u[0]=s=>e.$emit("handleHeader",s))},[x("div",je,B(_(s)("Nodes Map",!0)),1),x("div",Re,[(null==(d=_(n))?void 0:d.length)>0?M((A(),Q(_(P),{key:0,icon:i.value?"pi pi-angle-double-down":"pi pi-angle-double-up",text:"",rounded:"",severity:"secondary",onClick:C(r,["stop"]),size:"small"},null,8,["icon"])),[[_(U),i.value?_(s)("Collapse All"):_(s)("Expand All"),void 0,{top:!0}]]):I("",!0),D(e.$slots,"icon")])],34),x("div",{class:E(Ye+"__content")},[(null==(c=_(l))?void 0:c.length)>0?(A(),w("ol",De,[(A(!0),w(S,null,k(_(l),((e,l)=>(A(),w("li",{key:l,onDragstart:e=>((e,s)=>{N.value=s,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(s("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[N.value],i=l[R.value];o.canvas.graph._groups[N.value]=i,o.canvas.graph._groups[R.value]=n,t.setGroups(o.canvas.graph._groups)})(e),onDragover:e=>((e,s)=>{e.preventDefault(),e.currentIndex!=N.value&&(R.value=s)})(e,l),draggable:!0},[void 0!==e.children?(A(),Q(He,{key:0,item:e,onChangeMode:s=>h(e),onMousedown:s=>b(e,"group"),onMouseup:H},{default:j((()=>[(A(!0),w(S,null,k(e.children,((e,s)=>(A(),Q(ze,{key:s,node:e,onChangeMode:s=>f(e),onMousedown:s=>b(e,"node"),onMouseup:H},null,8,["node","onChangeMode","onMousedown"])))),128))])),_:2},1032,["item","onChangeMode","onMousedown"])):(A(),Q(ze,{key:1,node:e.info,onChangeMode:s=>f(e.info),onMousedown:s=>b(e.info,"node"),onMouseup:H},null,8,["node","onChangeMode","onMousedown"]))],40,Le)))),128))])):(A(),w("div",Ze,[z(be,{icon:"pi pi-sitemap",title:_(s)("No Nodes",!0),message:_(s)("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 t=u(),l=y(!1);h((e=>l.value),(e=>{e?t.watchGraph(!0):t.unwatchGraph()}));const a=y(null),o=e=>{const s=a.value;var t=e.clientX||0,l=e.clientY||0,o=s.offsetLeft,n=s.offsetTop;function i(e){var a=e.clientX,i=e.clientY,r=a-t,u=i-l;s.style.left=o+r+"px",s.style.top=n+u+"px"}document.addEventListener("mousemove",i),document.addEventListener("mouseup",(function e(){document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",e)}))};return(e,t)=>(A(),w(S,null,[x("div",{class:E(["flex-c",Ge])},[x("div",{class:E(["group flex-c",Ge+"-icon"]),onClick:t[0]||(t[0]=e=>l.value=!l.value)},Ve,2),x("div",{class:E(["rocket flex-c",Ge+"-icon"]),onClick:t[1]||(t[1]=(...e)=>_(v)&&_(v)(...e))},Pe,2)]),l.value?(A(),w("div",{key:0,ref_key:"nodesMapRef",ref:a,class:E(Ge+"-nodes-map")},[z(Oe,{onHandleHeader:o},{icon:j((()=>[M(z(_(P),{icon:"pi pi-times",text:"",rounded:"",severity:"secondary",onClick:t[2]||(t[2]=e=>l.value=!1),size:"small"},null,512),[[_(U),_(s)("Close"),void 0,{top:!0}]])])),_:1})],2)):I("",!0)],64))}},Ue={__name:"index",setup(e){const s=u();return H((e=>{s.watchGraph()})),(e,s)=>(A(),w("div",{class:E("comfyui-easyuse-map")},[z(Oe)]))}},Fe="Comfy.UseNewMenu",Te={__name:"App",setup(e){const t=y(null);return H((e=>{try{p("EasyUse.NodesMap.Enable",null)&&o.extensionManager.registerSidebarTab({id:m,icon:"pi pi-sitemap",title:s("Nodes Map",!0),tooltip:s("Nodes Map",!0),type:"custom",render:e=>{e.style.height="100%",L(Z(Ue,{}),e)}}),t.value=p(Fe),g(Fe,(e=>{t.value=e}))}catch(l){}})),(e,s)=>(A(),w(S,null,[z(Se),"Disabled"==t.value?(A(),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); +!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}#crystools-root-easyuse{flex-direction:row;justify-content:center;flex-shrink:1;width:min-content;min-width:max-content;height:100%;margin:0 auto}#crystools-root-easyuse .crystools-monitor-container{width:100%;cursor:crosshair;display:flex;flex-wrap:wrap;flex-direction:row;justify-content:flex-end;gap:5px;height:100%}#crystools-root-easyuse .crystools-monitor-container .crystools-monitor{background-color:var(--comfy-input-bg);position:relative;align-items:center;flex-direction:row;width:40px;height:100%}#crystools-root-easyuse .crystools-monitor-container .crystools-monitor .crystools-text{font-size:10px;text-align:right;margin-left:3px;position:absolute;font-weight:100;bottom:2px;z-index:10}#crystools-root-easyuse .crystools-monitor-container .crystools-content{position:relative;height:100%}#crystools-root-easyuse .crystools-monitor-container .crystools-slider{position:absolute;height:100%;width:0;box-shadow:inset 2px 2px 10px #0003}#crystools-root-easyuse .crystools-monitor-container .crystools-label{position:relative;width:100%;color:var(--input-text);font-weight:500;font-size:11px;left:2px;top:4px;text-align:right}: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}#easyuse-model-thumbnail{display:none;position:fixed;z-index:9999;width:150px;height:auto;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:var(--input-text);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{background:var(--comfy-menu-bg);border-bottom:1px solid var(--bg-color)}.comfyui-easyuse .side-tool-bar-container{background:var(--comfy-menu-bg);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}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}(); +var e;import{$ as s,l as t,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-DCfwleBT.js";import{r as y,w as h,e as f,b as A,c as w,I as S,d as x,G as E,C as M,J as b,K as _,L as k,M as C,z as B,F as I,o as H,N,D as Q,O as z,E as j,P as R,x as D,Q as L,R as Z,S as Y}from"./assets/vue-Wm3LYzLs.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-DS46y2Fr.js";import{c as T}from"./assets/lodash-CZi7izHi.js";import{P as X}from"./assets/primevue-BfXuwIdd.js";import"./assets/primeuix-6j2DF8mJ.js";const J=O("graphStore",{state:e=>({selectors:[],selectors_styles:{},seg_selectors:[],slider_controls:[]}),actions:{setSelectors(e){this.selectors=T(e)},setStyles(e,s){this.selectors_styles[e]||(this.selectors_styles[e]=s)},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"],se=["onMouseenter","onMouseleave"],te=["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 t=await l.fetchApi(`/easyuse/prompt/styles?name=${e}`);if(200===t.status){let e=(await t.json()).map(((e,s)=>(e.index=s,e)));return await i.setStyles(n.type,e),!0}return a.error(s("Get styles list Failed")),!1})(e)&&c()}),{immediate:!0});const d=o,c=e=>{const s=n.selectedStyles,t=T(r.value[n.type]);u.value=t.sort(((e,s)=>e.index-s.index)).sort(((e,t)=>s.includes(t.name)-s.includes(e.name)))},p=y(""),v=e=>e.toLowerCase(),m=f({}),g=e=>{m.src="",m.name="",m.positive="",m.negative=""},H=async e=>{const s=await l.fetchApi(`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`);if(200===s.status){const t=await s.text();if(t.startsWith("http"))return t;return`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`}},N=e=>{e.target.src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QNLaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3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BA749Wr2gtCKlrIpGs17NjK29LLWmPmMsyiFkbIZsPEdKQu6y0eAQWdD1E2L93W1tzRyCDY3paev2NaxVlhIjidMfMb5vmse1kbi9pZ7MeKDt0BAQEBAQfEPU+lFY2++q2K1uSSezTnrReVsTTmiZVYHOd9LVuQyubIwANkbxz4FA7FsQ0NrrLNXX7N0eo1+3darGDYPjb5j6prxVRajjDetsRAjj4yM4CDre2uxO7q2hqtm7nua6w9rp5tfXgoSxwyTOMr42PlrPe4Nc8jJJQRDb3Oz1fYFrcV7As0mu3u7nbWkBZ9LSfG5nlxs/yySWRiNozwcBBx9EXadGTXz62+LG41+jZS6adhzS6vfnlkEjgzEZax7T8ePFBu3nbPdUXqJZsw6S5cqbCW1YdIY2lxhhfEGMjfHtoG9HxucwPEZy4/A7kMC87aq2Kmv7mdvxuqGmklFjUU4G2Yp21rdyW00t+kJkFl88pY9vDgwNDvEoK9np73FBcHdkrt2+rZd5FjQx7O0b8WvbzDKZhN1SSse573QdeAHkN+Ichj3p2rBvZq9vUnY2tcNQPqpZYZpJ44GxXqzHdVlzZZpib73mLHViI85c1BZ6OpsIe/6/XSuntevdsz6+8+pI0/yM1dtWVr2Z644P8rmyuj6S53jxkh9aQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBB/9k="};return(l,a)=>(A(),w("div",{class:E(ue+` ${ue}-styles`),"data-id":e.id,onMouseleave:g},[u.value.length>0&&e.show?(A(),w(S,{key:0},[x("div",{class:E(ue+"__header")},[x("div",{class:E(ue+"__header_button"),onClick:a[0]||(a[0]=e=>(d("chooseStyle",[]),void(p.value="")))},K,2),x("div",{class:E(ue+"__header_search")},[$,M(x("textarea",{class:"search","onUpdate:modelValue":a[1]||(a[1]=e=>p.value=e),dir:"ltr",rows:1,placeholder:_(s)("Type here to search styles ...")},null,8,ee),[[b,p.value]])],2)],2),x("div",{class:E(ue+"__content"),onMouseleave:c},[(A(!0),w(S,null,k(u.value,((s,l)=>(A(),w("div",{class:E(ue+"-item"),key:l,onMouseenter:e=>(async e=>{if(!e.imageSrc){if(e.imageLoading)return;e.imageLoading=!0;const s=await H(e.imgName).finally((()=>e.imageLoading=!1));e.imageSrc=s}m.name="zh"==t&&e.name_cn?e.name_cn:e.name,m.positive=e.prompt,m.negative=e.negative_prompt,m.src=e.imageSrc})(s),onMouseleave:C((e=>g()),["stop"])},[x("span",{class:E([ue+"-item__tag",{hide:!(e.selectedStyles.includes(s.name)||-1!=v(s.name).indexOf(v(p.value))||s.name_cn&&-1!=v(s.name_cn).indexOf(v(p.value)))}]),onClick:e=>(e=>{let s=n.selectedStyles;s.includes(e.name)?s=s.filter((s=>s!==e.name)):s.push(e.name),d("chooseStyle",s)})(s)},[x("input",{type:"checkbox",name:s.name,checked:e.selectedStyles.includes(s.name)},null,8,le),x("span",null,B(["zh","zh_CN"].includes(_(t))&&s.name_cn?s.name_cn:s.name),1)],10,te)],42,se)))),128))],34),(null==m?void 0:m.src)||(null==m?void 0:m.positive)||(null==m?void 0:m.negative)?(A(),w("div",{key:0,class:E(ue+"-preview")},[m.src?(A(),w("img",{key:0,src:m.src,ref:"image",alt:"preview",onError:N},null,40,ae)):I("",!0),x("div",{class:E(ue+"-preview__text")},[x("b",null,B(m.name),1),x("div",{class:E(ue+"-preview__prompt")},[m.positive?(A(),w("h6",oe,[ne,x("span",null,B(m.positive),1)])):I("",!0),m.negative?(A(),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:t}){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"];break;case"human_parts (deeplabv3p)":a.value=["Background","Face","Hair","Glasses","Top-clothes","Bottom-clothes","Torso-skin","Left-arm","Right-arm","Left-leg","Right-leg","Left-foot","Right-foot"]}}),{immediate:!0});const o=t;return(t,n)=>{var i;return A(),w("div",{class:E(me+` ${me}-seg`),"data-id":e.id},[(null==(i=a.value)?void 0:i.length)>0&&e.show?(A(!0),w(S,{key:0},k(a.value,((t,a)=>(A(),w("div",{class:E(me+"-item"),key:a},[x("span",{class:E(me+"-item__tag"),onClick:e=>(e=>{let s=T(l.selected);s.includes(e)?s=s.filter((s=>s!==e)):s.push(e),o("select",s)})(a)},[x("input",{type:"checkbox",name:t,checked:e.selected.includes(a)},null,8,ve),x("span",null,B(_(s)(t)),1)],10,pe)],2)))),128)):I("",!0)],10,ce)}}},ye=["data-id"],he=["onMousedown","onDblclick"],fe="comfyui-easyuse-slider",Ae="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:s}){const t=e,l=s,a=(e,s,t)=>(e-s)/(t-s)*100,o=(e,s,l=void 0)=>{if(t.mode===Ae){let t={3:2.5,6:1}[s]||0;return{default:12==e?t:0,min:-1,max:3,step:.05,value:void 0!==l?l:12==e?t:0,top:void 0!==l?100-a(l,-1,3)+"%":null,height:void 0!==l?a(l,-1,3)+"%":null}}};h((e=>t.mode),(async(e,s)=>{var a;if(e!==s&&e===Ae)if(!s&&(null==(a=t.values)?void 0:a.length)>0){const e=t.values.map((e=>{const s=e.split(":");return o(t.values.length,s[0],parseFloat(s[1]))}));await l("changeValues",e)}else{let e="sd1"==t.type?16:12,s=Array.from({length:e},((s,t)=>o(e,t)));await l("changeValues",s)}l("showSlider")}),{immediate:!0}),h((e=>t.type),((e,s)=>{if(e!=s&&t.mode==Ae){let e="sd1"==t.type?16:12,s=Array.from({length:e},((s,t)=>o(e,t)));l("changeValues",s)}}));const n=y(null),i=y(null);return H((()=>{document.onmouseup=e=>document.onmousemove=null})),(s,o)=>{var r;return A(),w("div",{class:E(fe),"data-id":e.id},[(null==(r=e.values)?void 0:r.length)>0&&e.show?(A(!0),w(S,{key:0},k(e.values,((s,o)=>(A(),w("div",{class:E([fe+"-item",{positive:3==o&&"sdxl"==e.type&&e.mode==Ae},{negative:6==o&&"sdxl"==e.type&&e.mode==Ae}]),key:o},[x("div",{class:E(fe+"-item-input")},B(s.value),3),x("div",{class:E(fe+"-item-scroll"),ref_for:!0,ref_key:"scroll",ref:n},[x("div",{class:E(fe+"-item-bar"),ref_for:!0,ref_key:"bar",ref:i,style:N({top:s.top||100-a(s.default,s.min,s.max)+"%"}),onMousedown:e=>((e,s,a)=>{let o=e||window.event,r=n.value[a],u=i.value[a],d=T(t.values),c=o.clientY-u.offsetTop;document.onmousemove=e=>{let t=(e||window.event).clientY-c;t<0?t=0:t>r.offsetHeight-u.offsetHeight&&(t=r.offsetHeight-u.offsetHeight);let o=(s.max-s.min)/s.step,n=(r.offsetHeight-u.offsetHeight)/o;t=Math.round(t/n)*n;const i=Math.floor(t/(r.offsetHeight-u.offsetHeight)*100)+"%",p=Math.floor((r.offsetHeight-u.offsetHeight-t)/(r.offsetHeight-u.offsetHeight)*100)+"%",v=parseFloat(parseFloat(s.max-(s.max-s.min)*(t/(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,s,o),onDblclick:e=>((e,s,a)=>{let o=T(t.values);o[a]={...o[a],top:null,height:null,value:s.default},l("changeValues",o)})(0,s,o)},null,46,he),x("div",{class:E(fe+"-item-area"),style:N({height:s.height||a(s.default,s.min,s.max)+"%"})},null,6)],2),x("div",{class:E(fe+"-item-label")},[x("span",null,B(s.label),1)],2)],2)))),128)):I("",!0)],8,ye)}}},Se={__name:"index",setup(e){const s=J(),{selectors:t,seg_selectors:l,slider_controls:a}=V(s),u=y({}),d=async e=>{var l,a,o,r,d,c,p;await n(1);const v=i(e,"styles"),m=(null==(l=e.properties.values)?void 0:l.length)>0?e.properties.values:[];let g=T(t.value);g.push({id:e.id,type:v.value,value:m,show:!1});const y=g.length-1;await s.setSelectors(g),(null==(a=e.flags)?void 0:a.collapsed)&&e.collapse();let h=null==(d=null==(r=null==(o=u.value[e.id])?void 0:o._)?void 0:r.vnode)?void 0:d.el;if(!h)return;let f=e.addDOMWidget("select_styles","btn",h);e.properties.values||e.setProperty("values",[]),g[y].show=!0,await s.setSelectors(g);let A=v.value;Object.defineProperty(v,"value",{set:t=>{A=t,g[y].type=t,e.properties.values=[],g[y].value=[],s.setSelectors(g)},get:e=>A}),Object.defineProperty(f,"value",{set:e=>{setTimeout((t=>{g[y].value=e.split(","),s.setSelectors(g)}),150)},get:s=>{var l,a;return e.properties.values=(null==(a=null==(l=t.value)?void 0:l[y])?void 0:a.value)||[],e.properties.values.join(",")}}),((null==(c=e.size)?void 0:c[0])<150||(null==(p=e.size)?void 0:p[1])<150)&&e.setSize([425,500]);const w=e.onRemoved;e.onRemoved=function(){if(w&&(null==w||w.apply(this,arguments)),void 0!==t.value.findIndex((s=>s.id==e.id))){let e=T(t.value);e.splice(y,1),s.setSelectors(e)}return w}},c=y({}),p=async e=>{var t,a,o,u,d;await n(1);const p=i(e,"method"),v=(null==(t=e.properties.values)?void 0:t.length)>0?e.properties.values:[];let m=T(l.value);m.push({id:e.id,type:p.value,value:v,show:!1});const g=m.length-1;await s.setSegSelectors(m),(null==(a=e.flags)?void 0:a.collapsed)&&e.collapse();let y=null==(d=null==(u=null==(o=c.value[e.id])?void 0:o._)?void 0:u.vnode)?void 0:d.el;if(!y)return;let h=e.addDOMWidget("mask_components","btn",y);e.properties.values||e.setProperty("values",[]),m[g].show=!0,await s.setSegSelectors(m);let f=p.value;Object.defineProperty(p,"value",{set:t=>{f=t,m[g].type=t,e.properties.values=[],m[g].value=[],r(e,i(e,"confidence"),"selfie_multiclass_256x256"===f),e.setSize([300,"selfie_multiclass_256x256"===f?260:400]),s.setSegSelectors(m)},get:e=>f}),Object.defineProperty(h,"value",{set:e=>{setTimeout((t=>{m[g].value=e.split(","),s.setSegSelectors(m)}),150)},get:s=>{var t;return e.properties.values=(null==(t=l.value)?void 0:t[g].value)||[],e.properties.values.join(",")}}),r(e,i(e,"confidence"),"selfie_multiclass_256x256"===f),e.setSize([300,"selfie_multiclass_256x256"===f?260:500]);const A=e.onRemoved;e.onRemoved=function(){if(A&&(null==A||A.apply(this,arguments)),void 0!==l.value.findIndex((s=>s.id==e.id))){let e=T(l.value);e.splice(g,1),s.setSegSelectors(e)}return A}},v=y({}),m=async e=>{var t,l,o,r,u;await n(1);const d=i(e,"mode"),c=i(e,"model_type"),p=(null==(t=e.properties.values)?void 0:t.length)>0?e.properties.values:[];(null==(l=e.flags)?void 0:l.collapsed)&&e.collapse();let m=T(a.value);m.push({id:e.id,type:c.value,mode:d.value,value:p,show:!1});const g=m.length-1;await s.setSliderControls(m);let y=null==(u=null==(r=null==(o=v.value[e.id])?void 0:o._)?void 0:r.vnode)?void 0:u.el;if(!y)return;let h=e.addDOMWidget("values","btn",y);e.properties.values||e.setProperty("values",[]),Object.defineProperty(h,"value",{set:function(){},get:s=>{var t;const l=(null==(t=a.value)?void 0:t[g].value)||[];return e.properties.values=l.map(((e,s)=>`${s}:${e.value}`)),e.properties.values.join(",")}}),e.setSize("sdxl"==c.value?[375,320]:[455,320]),c.callback=t=>{m=T(a.value),m[g].type!=t&&(e.setSize("sdxl"==t?[375,320]:[455,320]),m[g].value=[],m[g].type=t,s.setSliderControls(m))};const f=e.onRemoved;e.onRemoved=function(){if(f&&(null==f||f.apply(this,arguments)),void 0!==a.value.findIndex((s=>s.id==e.id))){let e=T(a.value);e.splice(g,1),s.setSliderControls(e)}return f}};return H((e=>{o.registerExtension({name:"Comfy.EasyUse.Components",async beforeRegisterNodeDef(e,s){const t=e.prototype.onNodeCreated;"easy stylesSelector"==s.name&&(e.prototype.onNodeCreated=async function(){return t&&(null==t||t.apply(this,arguments)),await d(this),t}),"easy humanSegmentation"==s.name&&(e.prototype.onNodeCreated=async function(){return t&&(null==t||t.apply(this,arguments)),await p(this),t}),"easy sliderControl"==s.name&&(e.prototype.onNodeCreated=async function(){return t&&(null==t||t.apply(this,arguments)),await m(this),t}),"easy poseEditor"==s.name&&(e.prototype.onNodeCreated=async function(){t&&(null==t||t.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),t})}})})),(e,o)=>(A(),w(S,null,[(A(!0),w(S,null,k(_(t),((e,l)=>(A(),Q(de,{ref_for:!0,ref:s=>{s&&(u.value[e.id]=s)},type:e.type,key:l,id:e.id,show:e.show,selectedStyles:e.value,onChooseStyle:e=>((e,l)=>{let a=T(t.value);a[l].value=e,s.setSelectors(a)})(e,l)},null,8,["type","id","show","selectedStyles","onChooseStyle"])))),128)),(A(!0),w(S,null,k(_(l),((e,t)=>(A(),Q(ge,{ref_for:!0,ref:s=>{s&&(c.value[e.id]=s)},type:e.type,key:t,id:e.id,show:e.show,selected:e.value,onSelect:e=>((e,t)=>{let a=T(l.value);a[t].value=e,s.setSegSelectors(a)})(e,t)},null,8,["type","id","show","selected","onSelect"])))),128)),(A(!0),w(S,null,k(_(a),((e,t)=>(A(),Q(we,{ref_for:!0,ref:s=>{s&&(v.value[e.id]=s)},type:e.type,key:t,id:e.id,show:e.show,mode:e.mode,values:e.value,onChangeValues:e=>((e,t)=>{let l=T(a.value);l[t].value=e,s.setSliderControls(l)})(e,t),onShowSlider:e=>(e=>{let t=T(a.value);t[e].show=!0,s.setSliderControls(t)})(t)},null,8,["type","id","show","mode","values","onChangeValues","onShowSlider"])))),128))],64))}},xe={class:"no-result-placeholder"},Ee={class:"no-result-placeholder-content"},Me={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=>(s,t)=>(A(),w("div",xe,[z(_(G),null,{content:j((()=>[x("div",Ee,[x("i",{class:E(e.icon),style:N({"font-size":e.iconSize,"margin-bottom":".5rem"})},null,6),x("h3",null,B(e.title),1),e.message?(A(),w("p",Me,B(e.message),1)):I("",!0),e.buttonLabel?(A(),Q(_(P),{key:1,label:e.buttonLabel,onClick:t[0]||(t[0]=e=>s.$emit("action")),class:"p-button-text"},null,8,["label"])):I("",!0)])])),_:1})]))},_e={class:"left flex-1"},ke={key:1,class:"edit"},Ce={key:2,class:"label"},Be={class:"right toolbar"},Ie={key:0,class:"nodes"},He={__name:"group",props:{item:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup(e){const s=e,t=u(),l=y(!1),a=y(null),n=y(""),i=e=>{var l,a;let n=s.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,t.setGroups(o.canvas.graph._groups))}},r=async()=>{let e=s.item,a=o.canvas.graph._groups.find((s=>s.pos[0]==e.info.pos[0]&&s.pos[1]==e.info.pos[1]));a?(a.is_edit=!1,a.title=n.value,await t.setGroups(o.canvas.graph._groups),l.value=!1):l.value=!1};return(u,c)=>{var p,v,m;return A(),w(S,null,[x("div",{class:E("comfyui-easyuse-map-nodes-group"),onClick:i},[x("div",_e,[e.item.children?(A(),w("i",{key:0,class:E(["icon",e.item.info.show_nodes?"pi pi-folder-open":"pi pi-folder"]),style:N({color:e.item.info.color})},null,6)):I("",!0),(null==(p=e.item.info)?void 0:p.is_edit)?(A(),w("div",ke,[z(_(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:[R(r,["enter"]),R(r,["esc"])],style:{width:"100%"}},null,8,["modelValue"])])):(A(),w("div",Ce,[x("span",{onDblclick:c[1]||(c[1]=C((i=>(async()=>{var e,i;if(l.value)return;let r=s.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 t.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?(A(),Q(_(P),{key:0,size:"small",icon:e.item.children.find((e=>e.mode==_(d).ALWAYS))?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:c[2]||(c[2]=C((e=>u.$emit("changeMode")),["stop"])),onMousedown:c[3]||(c[3]=C((e=>u.$emit("mousedown")),["stop"])),onMouseup:c[4]||(c[4]=C((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?(A(),w("div",Ie,[D(u.$slots,"default")])):I("",!0)],64)}}},Ne={key:1,class:"label error"},Qe={class:"right toolbar"},ze={__name:"node",props:{node:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup:e=>(s,t)=>(A(),w("div",{draggable:!1,class:E(["comfyui-easyuse-map-nodes-node",{never:void 0!==e.node.mode&&e.node.mode==_(d).NEVER},{bypass:void 0!==e.node.mode&&e.node.mode==_(d).BYPASS}])},[void 0!==e.node.title?(A(),w("span",{key:0,class:"label",onDblclick:t[0]||(t[0]=C((s=>_(c)(e.node.id)),["stop"]))},B(e.node.title),33)):(A(),w("span",Ne,B(e.node.type),1)),x("div",Qe,[z(_(P),{size:"small",icon:e.node.mode==_(d).ALWAYS?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:t[1]||(t[1]=C((e=>s.$emit("changeMode")),["stop"])),onMousedown:t[2]||(t[2]=C((e=>s.$emit("mousedown")),["stop"])),onMouseup:t[3]||(t[3]=C((e=>s.$emit("mouseup")),["stop"]))},null,8,["icon"])])],2))},je={class:"title"},Re={class:"toolbar"},De={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 t=u(),{groups_nodes:l,groups:n}=V(t),i=y(!1),r=e=>{i.value=!i.value,o.canvas.graph._groups.forEach((e=>{e.show_nodes=i.value})),t.setGroups(o.canvas.graph._groups)};let c,v=0,m=0,g=!1;const h=(e,s=!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?s?d.NEVER:d.BYPASS:d.ALWAYS,e.graph.change())})),t.setNodes(o.canvas.graph._nodes)},f=(e,s=!1)=>{if(g)return void(g=!1);const l=e.mode==d.ALWAYS,a=o.canvas.graph._nodes.find((s=>s.id==e.id));a&&(a.mode=l?s?d.NEVER:d.BYPASS:d.ALWAYS,a.graph.change(),t.setNodes(o.canvas.graph._nodes))},b=(e,s="group")=>{v=(new Date).getTime(),clearTimeout(c),c=setTimeout((t=>{"group"==s?h(e,!0):f(e,!0)}),500)},H=e=>{m=(new Date).getTime(),m-v>500&&(g=!0),clearTimeout(c)};let N=y(null),R=y(null);y(!1);return(e,u)=>{var d,c;return A(),w("div",{class:E(Ye)},[x("div",{class:E(Ye+"__header"),onMousedown:u[0]||(u[0]=s=>e.$emit("handleHeader",s))},[x("div",je,B(_(s)("Nodes Map",!0)),1),x("div",Re,[(null==(d=_(n))?void 0:d.length)>0?M((A(),Q(_(P),{key:0,icon:i.value?"pi pi-angle-double-down":"pi pi-angle-double-up",text:"",rounded:"",severity:"secondary",onClick:C(r,["stop"]),size:"small"},null,8,["icon"])),[[_(U),i.value?_(s)("Collapse All"):_(s)("Expand All"),void 0,{top:!0}]]):I("",!0),D(e.$slots,"icon")])],34),x("div",{class:E(Ye+"__content")},[(null==(c=_(l))?void 0:c.length)>0?(A(),w("ol",De,[(A(!0),w(S,null,k(_(l),((e,l)=>(A(),w("li",{key:l,onDragstart:e=>((e,s)=>{N.value=s,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(s("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[N.value],i=l[R.value];o.canvas.graph._groups[N.value]=i,o.canvas.graph._groups[R.value]=n,t.setGroups(o.canvas.graph._groups)})(e),onDragover:e=>((e,s)=>{e.preventDefault(),e.currentIndex!=N.value&&(R.value=s)})(e,l),draggable:!0},[void 0!==e.children?(A(),Q(He,{key:0,item:e,onChangeMode:s=>h(e),onMousedown:s=>b(e,"group"),onMouseup:H},{default:j((()=>[(A(!0),w(S,null,k(e.children,((e,s)=>(A(),Q(ze,{key:s,node:e,onChangeMode:s=>f(e),onMousedown:s=>b(e,"node"),onMouseup:H},null,8,["node","onChangeMode","onMousedown"])))),128))])),_:2},1032,["item","onChangeMode","onMousedown"])):(A(),Q(ze,{key:1,node:e.info,onChangeMode:s=>f(e.info),onMousedown:s=>b(e.info,"node"),onMouseup:H},null,8,["node","onChangeMode","onMousedown"]))],40,Le)))),128))])):(A(),w("div",Ze,[z(be,{icon:"pi pi-sitemap",title:_(s)("No Nodes",!0),message:_(s)("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 t=u(),l=y(!1);h((e=>l.value),(e=>{e?t.watchGraph(!0):t.unwatchGraph()}));const a=y(null),o=e=>{const s=a.value;var t=e.clientX||0,l=e.clientY||0,o=s.offsetLeft,n=s.offsetTop;function i(e){var a=e.clientX,i=e.clientY,r=a-t,u=i-l;s.style.left=o+r+"px",s.style.top=n+u+"px"}document.addEventListener("mousemove",i),document.addEventListener("mouseup",(function e(){document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",e)}))};return(e,t)=>(A(),w(S,null,[x("div",{class:E(["flex-c",Ge])},[x("div",{class:E(["group flex-c",Ge+"-icon"]),onClick:t[0]||(t[0]=e=>l.value=!l.value)},Ve,2),x("div",{class:E(["rocket flex-c",Ge+"-icon"]),onClick:t[1]||(t[1]=(...e)=>_(v)&&_(v)(...e))},Pe,2)]),l.value?(A(),w("div",{key:0,ref_key:"nodesMapRef",ref:a,class:E(Ge+"-nodes-map")},[z(Oe,{onHandleHeader:o},{icon:j((()=>[M(z(_(P),{icon:"pi pi-times",text:"",rounded:"",severity:"secondary",onClick:t[2]||(t[2]=e=>l.value=!1),size:"small"},null,512),[[_(U),_(s)("Close"),void 0,{top:!0}]])])),_:1})],2)):I("",!0)],64))}},Ue={__name:"index",setup(e){const s=u();return H((e=>{s.watchGraph()})),(e,s)=>(A(),w("div",{class:E("comfyui-easyuse-map")},[z(Oe)]))}},Fe=x("img",{id:"easyuse-model-thumbnail"},null,-1),Te="Comfy.UseNewMenu",Xe={__name:"App",setup(e){const t=y(null);return H((e=>{try{p("EasyUse.NodesMap.Enable",null)&&o.extensionManager.registerSidebarTab({id:m,icon:"pi pi-sitemap",title:s("Nodes Map",!0),tooltip:s("Nodes Map",!0),type:"custom",render:e=>{e.style.height="100%",L(Z(Ue,{}),e)}}),t.value=p(Te),g(Te,(e=>{t.value=e}))}catch(l){}})),(e,s)=>(A(),w(S,null,[z(Se),Fe,"Disabled"==t.value?(A(),Q(We,{key:0})):I("",!0)],64))}},Je=null==(e=document.getElementsByClassName("graph-canvas-container"))?void 0:e[0],qe=document.createElement("div");qe.id="comfyui-easyuse-components",Je?Je.append(qe):document.body.append(qe);const Ke=Y(Xe);Ke.use(X),Ke.use(F()),Ke.mount("#"+qe.id);