Files
jaidaken f09734b0ee
Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Python Linting / Run Pylint (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Has been cancelled
Execution Tests / test (macos-latest) (push) Has been cancelled
Execution Tests / test (ubuntu-latest) (push) Has been cancelled
Execution Tests / test (windows-latest) (push) Has been cancelled
Test server launches without errors / test (push) Has been cancelled
Unit Tests / test (macos-latest) (push) Has been cancelled
Unit Tests / test (ubuntu-latest) (push) Has been cancelled
Unit Tests / test (windows-2022) (push) Has been cancelled
Add custom nodes, Civitai loras (LFS), and vast.ai setup script
Includes 30 custom nodes committed directly, 7 Civitai-exclusive
loras stored via Git LFS, and a setup script that installs all
dependencies and downloads HuggingFace-hosted models on vast.ai.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 00:56:42 +00:00

2 lines
226 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var e,t,i,s,a,n,o,l,r,d,u,A,c,p,h,m,f=Object.defineProperty,g=e=>{throw TypeError(e)},v=(e,t,i)=>((e,t,i)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i),y=(e,t,i)=>t.has(e)||g("Cannot "+i),b=(e,t,i)=>(y(e,t,"read from private field"),i?i.call(e):t.get(e)),w=(e,t,i)=>t.has(e)?g("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),_=(e,t,i,s)=>(y(e,t,"write to private field"),s?s.call(e,i):t.set(e,i),i);import{d as S,h as L,s as x,a as k,T as E,b as N,c as C,e as I,f as T,g as O,i as M,j as D}from"./vendor-D0iX-Vke.js";import{c as R}from"./lodash-DkvwM0Z9.js";import{r as P,m as G,w as z,o as V,a as j,c as U,b as W,d as F,u as X,e as Z,f as H,g as q,h as Y,F as K,i as J,n as B,j as Q,v as $,t as ee,k as te,l as ie,p as se,q as ae,s as ne,x as oe}from"./vue-Cu3MA6TM.js";import{u as le,a as re,b as de,c as ue}from"./vueuse-Chow9bSK.js";import{P as Ae}from"./primevue-CWKvsPkZ.js";let ce=(null==(t=null==(e=window.comfyAPI)?void 0:e.app)?void 0:t.app)||null,pe=(null==(s=null==(i=window.comfyAPI)?void 0:i.api)?void 0:s.api)||null,he=(null==(n=null==(a=window.comfyAPI)?void 0:a.ui)?void 0:n.$el)||null,me=(null==(l=null==(o=window.comfyAPI)?void 0:o.dialog)?void 0:l.ComfyDialog)||null,fe=(null==(d=null==(r=window.comfyAPI)?void 0:r.widgets)?void 0:d.ComfyWidgets)||null,ge=(null==(A=null==(u=window.comfyAPI)?void 0:u.utils)?void 0:A.applyTextReplacements)||null,ve=(null==(p=null==(c=window.comfyAPI)?void 0:c.groupNode)?void 0:p.GroupNodeConfig)||null;const ye=e=>{var t,i;return e?null==(i=null==(t=null==ce?void 0:ce.ui)?void 0:t.settings)?void 0:i.getSettingValue(e):null};function be(e,t=null){try{let i=e?ye(e):null;return null==i&&(i=t?localStorage[t]:localStorage[e]||null),i}catch(i){return null}}function we(e,t=e=>{}){var i;const s=null==(i=ce.ui.settings.settingsLookup)?void 0:i[e];s&&(s.onChange=e=>t(e))}async function _e(e,t,i=null){var s,a;if(!e)throw new Error("Invalid arguments");try{(null==(a=null==(s=null==ce?void 0:ce.ui)?void 0:s.settings)?void 0:a.setSettingValue)?ce.ui.settings.setSettingValue(e,t):await pe.storeSetting(e,t),i&&(localStorage[i]="object"==typeof t?JSON.stringify(t):t)}catch(n){}}const Se={"Workflow created by":"工作流创建者","Watch more video content":"观看更多视频内容","Workflow Guide":"工作流指南","💎 View Checkpoint Info...":"💎 查看 Checkpoint 信息...","💎 View Lora Info...":"💎 查看 Lora 信息...","🔃 Reload Node":"🔃 刷新节点","Updated At:":"最近更新:","Created At:":"首次发布:","✏️ Edit":"✏️ 编辑","💾 Save":"💾 保存","No notes":"当前还没有备注内容","Saving Notes...":"正在保存备注...","Type your notes here":"在这里输入备注内容",ModelName:"模型名称","Models Required":"所需模型","Download Model":"下载模型","Source Url":"模型源地址",Notes:"备注",Type:"类型","Trained Words":"训练词",BaseModel:"基础算法",Details:"详情",Description:"描述",Download:"下载量",Source:"来源","Saving Preview...":"正在保存预览图...","Saving Succeed":"保存成功","Clean SuccessFully":"清理成功","Clean Failed":"清理失败","Saving Failed":"保存失败","No COMBO link":"沒有找到COMBO连接","Reboot ComfyUI":"重启ComfyUI","Are you sure you'd like to reboot the server?":"是否要重启ComfyUI","NODES MAP":"管理节点与组",NodesMap:"节点与组","Nodes map sorting mode":"管理节点组排序模式","Search by Node ID/Name...":"通过节点ID/名称搜索...","No Nodes":"未找到节点","No nodes found in the map":"在工作流程中没有找到节点","No nodes found in the search":"未找到与搜索匹配的节点","Jump to this node":"跳转到该节点","Rename node":"重命名节点","Delete node":"删除节点","Rename group":"重命名组","Delete group":"删除组","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代替","Styles Selector Display Type":"样式选择器显示类型","Styles Selector Display Type, if set to 'Grid', it will display as a Grid, if set to 'List', it will display as a list":"样式选择器显示类型,如果设置为“网格”,则显示为网格,如果设置为“列表”,则显示为列表","Use three shortcut buttons in the right-click menu":"在右键菜单中使用三个快捷按钮","Enable Nodes Map":"启用节点组管理","Display Groups Only":"仅显示组","Display Node ID":"显示节点ID","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",Canceling:"正在取消","Cancel current run":"取消当前运行","Waiting for selection...":"等待选择中...","Using last selection":"使用上次选择","Pass Through":"跳过选择","Unknown Mode":"未知模式","Choose Selected Images":"选择选中的图片","Choose images to continue":"选择图片以继续","Please run first":"请先运行队列","Progress selected":"处理选中的图片","Progress selected image":"处理选中的图片","Please select images to continue":"请选择图片以继续",Background:"背景",Hat:"帽子",Hair:"头发",Body:"身体",Face:"脸部",Clothes:"衣服",Others:"其他",Glove:"手套",Glasses:"眼镜",Sunglasses:"太阳镜","Upper-clothes":"上衣","Top-clothes":"上衣","Bottom-clothes":"下身装","Torso-skin":"皮肤",Dress:"连衣裙",Belt:"腰带",Coat:"外套",Socks:"袜子",Pants:"裤子",Jumpsuits:"连体衣",Bag:"包",Scarf:"围巾",Skirt:"裙子","Left-arm":"左臂","Right-arm":"右臂","Left-leg":"左腿","Right-leg":"右腿","Left-foot":"左脚","Right-foot":"右脚","Left-shoe":"左鞋","Right-shoe":"右鞋","select mask components":"选择分割部位","select items":"选择项",Unlabelled:"未标记","shirt, blouse":"衬衫,女式衬衫","top, t-shirt, sweatshirt":"上衣T恤运动衫",sweater:"毛衣",cardigan:"开襟毛衣",jacket:"夹克",vest:"背心",pants:"长裤",shorts:"短裤",skirt:"裙子",coat:"外套",dress:"连衣裙",jumpsuit:"连体衣",cape:"斗篷",glasses:"眼镜",hat:"帽子","headband, head covering, hair accessory":"头带,头饰,发饰",tie:"领带",glove:"手套",watch:"手表",belt:"腰带","leg warmer":"护腿","tights, stockings":"紧身袜,丝袜",sock:"袜子",shoe:"鞋子","bag, wallet":"包,钱包",scarf:"围巾",umbrella:"雨伞",hood:"帽兜",collar:"领子",lapel:"翻领",epaulette:"肩章",sleeve:"袖子",pocket:"口袋",neckline:"领口",buckle:"扣环",zipper:"拉链",applique:"贴花",bead:"珠子",bow:"蝴蝶结",flower:"花朵装饰",fringe:"流苏",ribbon:"丝带",rivet:"铆钉",ruffle:"褶边",sequin:"亮片",tassel:"流苏穗",background:"背景",skin:"皮肤",nose:"鼻子",eyeglasses:"眼镜",left_eye:"左眼",right_eye:"右眼",left_eyebrow:"左眉毛",right_eyebrow:"右眉毛",left_ear:"左耳",right_ear:"右耳",mouth:"嘴巴",upper_lip:"上唇",lower_lip:"下唇",hair:"头发",earring:"耳环",necklace:"项链",neck:"脖子",clothing:"服装",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","The maximum number of inputs is 20":"输入数量最大20个","The maximum number of outputs is 20":"输出数量最大20个","Stop recording":"停止录音","Voice input":"语音输入",Continue:"继续",Stop:"停止",now:"当前",prev:"上一步","Add New Tab":"添加新标签","Add Angle Prompt":"添加角度提示词","Invert Rotate Mode":"反转旋转",Hollow:"镂空展示",Reset:"重置","Angle Prompt":"角度词",Image:"图像",F:"前",B:"后",U:"顶",D:"底",L:"左",R:"右",Rotate:"旋转",Vertical:"垂直",Zoom:"缩放"},Le=(e,t=!1)=>{switch(be("Comfy.Locale")){case"zh-CN":case"zh":return Se[e]||e;default:return e}};const xe="comfyui-easyuse-",ke="dark-theme",Ee={PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd",FLOW_CONTROL:"#373780"},Ne=0x4000000000000,Ce=["loaders","latent","image","mask","sampling","_for_testing","advanced","utils","api","api node","加载器","Latent","图像","遮罩","采样","_用于测试","高级","工具","API","api 节点","chargeurs","latent","image","masque","échantillonnage","_pour_test","avancé","outils","nœud api","загрузчики","латентный","изображение","маска","выборка","_для_тестирования","расширенный","инструменты","api","api узел","로더","잠재","이미지","마스크","샘플링","_테스트용","고급","도구","api","api 노드","ローダー","潜在","画像","マスク","サンプリング","_テスト用","高度な","ツール","api","apiード","cargadores","latente","imagen","máscara","muestreo","_para_pruebas","avanzado","herramientas","api","nodo api"],Ie={selfie_multiclass_256x256:["Background","Hair","Body","Face","Clothes","Others"],human_parsing_lip:["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"],"human_parts (deeplabv3p)":["Background","Face","Hair","Glasses","Top-clothes","Bottom-clothes","Torso-skin","Left-arm","Right-arm","Left-leg","Right-leg","Left-foot","Right-foot"],segformer_b3_clothes:{Background:0,Hat:1,Hair:2,Sunglasses:3,"Upper-clothes":4,Skirt:5,Pants:6,Dress:7,Belt:8,"Left-shoe":9,"Right-shoe":10,Face:11,"Left-leg":12,"Right-leg":13,"Left-arm":14,"Right-arm":15,Bag:16,Scarf:17},segformer_b3_fashion:{Unlabelled:0,"shirt, blouse":1,"top, t-shirt, sweatshirt":2,sweater:3,cardigan:4,jacket:5,vest:6,pants:7,shorts:8,skirt:9,coat:10,dress:11,jumpsuit:12,cape:13,glasses:14,hat:15,"headband, head covering, hair accessory":16,tie:17,glove:18,watch:19,belt:20,"leg warmer":21,"tights, stockings":22,sock:23,shoe:24,"bag, wallet":25,scarf:26,umbrella:27,hood:28,collar:29,lapel:30,epaulette:31,sleeve:32,pocket:33,neckline:34,buckle:35,zipper:36,applique:37,bead:38,bow:39,flower:40,fringe:41,ribbon:42,rivet:43,ruffle:44,sequin:45,tassel:46},face_parsing:["background","skin","nose","eyeglasses","left_eye","right_eye","left_eyebrow","right_eyebrow","left_ear","right_ear","mouth","upper_lip","lower_lip","hair","hat","earring","necklace","neck","clothing"]},Te={ALWAYS:0,NEVER:2,BYPASS:4},Oe="easyuse_nodes_map",Me="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAABkAAD/4QMyaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZ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E:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd",FAST_MODEL_LOADER:"#ffd399",SAMPLING:"#60a5fa"},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:"#60a5fa",NODE_BYPASS_BGCOLOR:"#FF00FF",NODE_ERROR_COLOUR:"#E00",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:De,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:De,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:De,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:De,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:De,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:De,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:De,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:De,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:De,groupcolor:"#444"}}};let Pe=JSON.parse(JSON.stringify(Re));delete Pe.NODE_COLORS,Pe.ColorPalette.id="obsidian_dark",Pe.ColorPalette.name="Obsidian Dark",Pe.ColorPalette.colors.litegraph_base.BACKGROUND_IMAGE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGlmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDEgNzkuMTQ2Mjg5OSwgMjAyMy8wNi8yNS0yMDow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XyBoY4VVBgsWLFiwYFmOlTv+9jfDOjHmr8u6eVkGCxYsWLBgmc5S8ApewXvgYRksWLBgKXidpeBdloL3wMOCBctgwVLwCl7BuyyDBQsWLFiwTGcpeAWv4D3wsAwWLFiwFLzOUvAuS8F74GHBgmWwYCl4Ba/gXZbBggULFixYprMUvIJX8B54WAYLFixYCl5nKXiXpeA98LBgwTJYsGC9tg1o8f4TTtqzNQAAAABJRU5ErkJggg==",Pe.ColorPalette.colors.litegraph_base.CLEAR_BACKGROUND_COLOR="#09090b";const Ge="#FFFFFF",ze={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",FAST_MODEL_LOADER:"#ffd399",SAMPLING:"#60a5fa"},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:Ge,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:Ge,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:Ge,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:Ge,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:Ge,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:Ge,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:Ge,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:Ge,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:Ge,groupcolor:"#444"}}},Ve={addGroup:{id:"EasyUse.Hotkeys.AddGroup",name:"Enable Shift+g to add selected nodes to a group",tooltip:"After v1.2.39, Ctrl+g can be used instead of it",type:"boolean",defaultValue:!0},cleanVRAMUsed:{id:"EasyUse.Hotkeys.cleanVRAMUsed",name:"Enable Shift+r to unload models and node cache",type:"boolean",defaultValue:!0},toggleSiteMap:{id:"EasyUse.Hotkeys.toggleNodesMap",name:"Enable Shift+m to toggle nodes map",type:"boolean",defaultValue:!0},alignSelectedNodes:{id:"EasyUse.Hotkeys.AlignSelectedNodes",name:"Enable Shift+Up/Down/Left/Right key and Shift+Ctrl+Alt+Left/Right to align selected nodes",tooltip:"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:"Enable Shift+Ctrl+Left/Right key to normalize selected nodes",tooltip:"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:"Enable Alt+1~9 to paste nodes from nodes template",type:"boolean",defaultValue:!0},jumpNearestNodes:{id:"EasyUse.Hotkeys.JumpNearestNodes",name:"Enable Up/Down/Left/Right key to jump nearest nodes",type:"boolean",defaultValue:!0},subDirectories:{id:"EasyUse.ContextMenu.SubDirectories",name:"Enable contextMenu auto nest subdirectories",type:"boolean",defaultValue:!1},modelsThumbnails:{id:"EasyUse.ContextMenu.ModelsThumbnails",name:"Enable model thumbnails display",type:"boolean",defaultValue:!1},rightMenuNodesSort:{id:"EasyUse.ContextMenu.NodesSort",name:"Enable right-click menu to add node A~Z sorting",type:"boolean",defaultValue:!0},quickOptions:{id:"EasyUse.ContextMenu.QuickOptions",name:"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:"Enable nodes runtime display",type:"boolean",defaultValue:!0},chainGetSet:{id:"EasyUse.Nodes.ChainGetSet",name:"Enable chain get node and set node with parent nodes",type:"boolean",defaultValue:!0},nodesMap:{id:"EasyUse.NodesMap.Sorting",name:"Nodes map sorting mode",tooltip:"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"},displayNodesID:{id:"EasyUse.NodesMap.DisplayNodeID",name:"Display Node ID",type:"boolean",defaultValue:!0},onlyDisplayGroup:{id:"EasyUse.NodesMap.DisplayGroupOnly",name:"Display Groups Only",type:"boolean",defaultValue:!1},enableNodesMap:{id:"EasyUse.NodesMap.Enable",name:"Enable Nodes Map",tooltip:"You need to refresh the page to update successfully",type:"boolean",defaultValue:!0},stylesSelectorDisplay:{id:"EasyUse.StylesSelector.DisplayType",name:"Styles Selector Display Type",tooltip:"Styles Selector Display Type, if set to 'Grid', it will display as a Grid, if set to 'List', it will display as a list",type:"combo",options:["Grid","List"],defaultValue:"Grid"},enableAddAnglePrompt:{id:"EasyUse.MultiAngle.AddAnglePrompt",name:"Add angle prompt in easy multiAngle",type:"boolean",defaultValue:!1},enableHollowMode:{id:"EasyUse.MultiAngle.HollowMode",name:"Enable hollow display mode in easy multiAngle",type:"boolean",defaultValue:!1},enableInvertRotate:{id:"EasyUse.MultiAngle.InvertRotate",name:"Invert rotate mode in easy multiAngle",tooltip:"Enable invert rotate mode in easy multiAngle to match the rotation direction of most 3D software",type:"boolean",defaultValue:!1}};function je(e=100,t){return new Promise((i=>{setTimeout((()=>{i(t)}),e)}))}function Ue(e,t){if(e="number"==typeof e?e:e instanceof Date?e.getTime():parseInt(e),isNaN(e))return null;let i=new Date(e);(e=i.toString().split(/[\s\:]/g).slice(0,-2))[1]=["01","02","03","04","05","06","07","08","09","10","11","12"][i.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 We=/Mac|iPod|iPhone|iPad/.test(navigator.platform),Fe=e=>We?e.replace(/Ctrl/g,"⌘").replace(/Alt/g,"⌥").replace(/Shift/g,"⇧"):e;const Xe=new class{constructor(){v(this,"element",he(`div.${xe}toast`)),v(this,"children",HTMLElement),v(this,"container",document.body),v(this,"info_icon",`mdi mdi-information ${xe}theme`),v(this,"success_icon",`mdi mdi-check-circle ${xe}success`),v(this,"error_icon",`mdi mdi-close-circle ${xe}error`),v(this,"warn_icon",`mdi mdi-alert-circle ${xe}warning`),v(this,"loading_icon","mdi mdi-rotate-right loading"),this.container.appendChild(this.element)}async show(e){let t=he(`div.${xe}toast-container`,[he("div",[he("span",[...e.icon?[he("i",{className:e.icon})]:[],he("span",e.content)])])]);t.setAttribute("toast-id",e.id),this.element.replaceChildren(t),this.container.appendChild(this.element),await je(64),t.style.marginTop=`-${t.offsetHeight}px`,await je(64),t.classList.add("show"),e.duration&&(await je(e.duration),this.hide(e.id))}async hide(e){const t=document.querySelector(`.${xe}toast > [toast-id="${e}"]`);(null==t?void 0:t.classList.contains("show"))&&(t.classList.remove("show"),await je(750)),t&&t.remove()}async clearAllMessages(){let e=document.querySelector(`.${xe}container`);e&&(e.innerHTML="")}async info(e,t=3e3,i=[]){this.show({id:"toast-info",icon:this.info_icon,content:e,duration:t})}async success(e,t=3e3){this.show({id:"toast-success",icon:this.success_icon,content:e,duration:t})}async error(e,t=3e3){this.show({id:"toast-error",icon:this.error_icon,content:e,duration:t})}async warn(e,t=3e3){this.show({id:"toast-warn",icon:this.warn_icon,content:e,duration:t})}async showLoading(e,t=0){this.show({id:"toast-loading",icon:this.loading_icon,content:e,duration:t})}async hideLoading(){this.hide("toast-loading")}},Ze=S("groups",{state:e=>({groups:[],nodes:[],isWatching:!1}),getters:{groups_nodes(){var e;let t=[],i=[];const s=e=>{var t;return{info:e,children:(null==(t=e.sub_groups)?void 0:t.length)>0?e.sub_groups.map(s):[],bounds:{x1:e.pos[0],y1:e.pos[1],x2:e.pos[0]+e.size[0],y2:e.pos[1]+e.size[1]}}};if(t=this.groups.map(s),(null==(e=this.nodes)?void 0:e.length)>0){const e=(e,t)=>e[0]>=t.x1&&e[0]<=t.x2&&e[1]>=t.y1&&e[1]<=t.y2,s=(t,i)=>{let s=null,a=-1;const n=(i,o)=>{i.bounds&&e(t.pos,i.bounds)&&(o>a&&(a=o,s=i),i.children.forEach((e=>n(e,o+1))))};return i.forEach((e=>n(e,0))),s};this.nodes.forEach((e=>{const a=s(e,t);a?(a.children||(a.children=[]),a.children.push(e)):i.push({info:e})}))}return[...t,...i]}},actions:{setGroups(e){let t=R(e);t.forEach((e=>{e.sub_groups=[],t.forEach((t=>{t!==e&&t.pos[0]>e.pos[0]&&t.pos[0]<e.pos[0]+e.size[0]&&t.pos[1]>e.pos[1]&&t.pos[1]<e.pos[1]+e.size[1]&&e.sub_groups.push(t)})),e.sub_groups.forEach((e=>{t=t.filter((t=>t!==e))}))})),this.groups="Manual drag&drop sorting"==be("EasyUse.NodesMap.Sorting")?R(t):R(t.sort(((e,t)=>e.pos[0]-t.pos[0])).sort(((e,t)=>e.pos[1]-t.pos[1])))},setNodes(e){this.nodes=R(e)},update(){var e,t,i;(((null==(e=ce.extensionManager)?void 0:e.activeSidebarTab)||(null==(i=null==(t=ce.extensionManager.sidebarTab)?void 0:t.activeSidebarTab)?void 0:i.id))===Oe||this.isWatching)&&setTimeout((e=>{this.setGroups(ce.canvas.graph._groups),this.setNodes(ce.canvas.graph._nodes)}),1)},watchGraph(e=!1){e&&(this.isWatching=!0);let t=this;this.update();const i=ce.graph.onNodeAdded;ce.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==i?void 0:i.apply(this,arguments)},ce.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 a=LGraphCanvas.onGroupAdd;LGraphCanvas.onGroupAdd=function(){return t.update(),null==a?void 0:a.apply(this,arguments)};const n=LGraphCanvas.onGroupAlign;LGraphCanvas.onGroupAlign=function(e){return t.update(),null==n?void 0:n.apply(this,arguments)};const o=LGraphCanvas.onMenuNodeRemove;LGraphCanvas.onMenuNodeRemove=function(e){return t.update(),null==o?void 0:o.apply(this,arguments)}},unwatchGraph(){this.isWatching=!1}}});const He={BOX:1,ROUND:2,CIRCLE:3,CARD:4,ARROW:5,GRID:6,HollowCircle:7};function qe(e,t,i={}){const{shape:s=He.BOX,round_radius:a=LiteGraph.ROUND_RADIUS,title_height:n=LiteGraph.NODE_TITLE_HEIGHT,title_mode:o=LiteGraph.NORMAL_TITLE,color:l=LiteGraph.NODE_BOX_OUTLINE_COLOR,padding:r=6,collapsed:d=!1,thickness:u=1}=i;o===LiteGraph.TRANSPARENT_TITLE&&(t[1]-=n,t[3]+=n);const{lineWidth:A,strokeStyle:c}=e;e.lineWidth=u,e.globalAlpha=.8,e.strokeStyle=l,e.beginPath();const[p,h,m,f]=t;switch(s){case He.BOX:e.rect(p-r,h-r,m+2*r,f+2*r);break;case He.ROUND:case He.CARD:{const t=a+r,i=s===He.CARD&&d||s===He.ROUND?[t]:[t,2,t,2];e.roundRect(p-r,h-r,m+2*r,f+2*r,i);break}case He.CIRCLE:{const t=p+m/2,i=h+f/2,s=Math.max(m,f)/2+r;e.arc(t,i,s,0,2*Math.PI);break}}e.stroke(),e.lineWidth=A,e.strokeStyle=c,e.globalAlpha=1}function Ye(e,t,i){var s,a;let n=0,o=null==(s=e[0])?void 0:s.naturalWidth,l=null==(a=e[0])?void 0:a.naturalHeight;const r=e.length;let d,u,A,c,p;for(let h=1;h<=r;h++){const e=Math.ceil(r/h),s=t/h,a=s/o,m=i/e/l,f=Math.min(a,m,1),g=o*f,v=l*f,y=g*v*r;y>n&&(n=y,d=g,u=v,A=h,c=e,p=h*((s-g)/2))}return{cellWidth:d,cellHeight:u,cols:A,rows:c,shiftX:p}}class Ke{constructor(e,t){this.type="custom",this.name=e,this.options=t,this.value=""}draw(e,t,i,s,a){((e,t,i)=>{const s=ce.canvas,a=s.graph_mouse;!s.pointer_is_down&&t.pointerDown&&(a[0]===t.pointerDown.pos[0]&&a[1]===t.pointerDown.pos[1]&&(t.imageIndex=t.pointerDown.index),t.pointerDown=null);const n=t.imgs??[];let{imageIndex:o}=t;const l=n.length;1!==l||o||(t.imageIndex=o=0);const r=t.size[0],d=t.size[1]-i-15;if(null==o){let o,u,A,c,p;const h=(e=>{if(!e.length||1===e.length)return!0;const t=e[0].naturalWidth/e[0].naturalHeight;for(let i=1;i<e.length;i++)if(t!=e[i].naturalWidth/e[i].naturalHeight)return!1;return!0})(n);if(h)c=0,({cellWidth:o,cellHeight:u,cols:p,shiftX:A}=Ye(n,r,d));else{c=2;const e=n.reduce(((e,t)=>Math.max(e,t.naturalWidth,t.naturalHeight)),0),t=[];t.length=n.length,t[0]={naturalWidth:e,naturalHeight:e},({cellWidth:o,cellHeight:u,cols:p,shiftX:A}=Ye(t,r,d))}let m=!1;t.imageRects=[];for(let r=0;r<l;r++){const l=n[r],d=Math.floor(r/p),f=r%p,g=f*o+A,v=d*u+i;if(!m&&(m=LiteGraph.isInsideRectangle(a[0],a[1],g+t.pos[0],v+t.pos[1],o,u),m)){t.overIndex=r;let i=110;s.pointer_is_down&&(t.pointerDown&&t.pointerDown.index===r||(t.pointerDown={index:r,pos:[...a]}),i=125),e.filter=`contrast(${i}%) brightness(${i}%)`,s.canvas.style.cursor="pointer"}t.imageRects.push([g,v,o,u]);const y=o/l.width,b=u/l.height,w=Math.min(y,b),_=w*l.height,S=d*u+i+(u-_)/2,L=w*l.width,x=f*o+A+(o-L)/2;e.drawImage(l,x+c,S+c,L-2*c,_-2*c),h||(e.strokeStyle="#8F8F8F",e.lineWidth=1,e.strokeRect(g+c,v+c,o-2*c,u-2*c)),e.filter="none"}return void(m||(t.pointerDown=null,t.overIndex=null))}const u=n[o];if(!u)return;let A=null==u?void 0:u.naturalWidth,c=null==u?void 0:u.naturalHeight;const p=r/A,h=d/c,m=Math.min(p,h,1);A*=m,c*=m;const f=(r-A)/2,g=(d-c)/2+i;e.drawImage(u,f,g,A,c),e.fillStyle=LiteGraph.NODE_TEXT_COLOR,e.textAlign="center",e.font="10px sans-serif";const v=`${Math.round(u.naturalWidth)} × ${Math.round(u.naturalHeight)}`,y=g+c+10;e.fillText(v,f+A/2,y);const b=(i,n,o,l)=>{let r="#333",d="#fff",u=!1;return LiteGraph.isInsideRectangle(a[0],a[1],i+t.pos[0],n+t.pos[1],o,o)&&(s.canvas.style.cursor="pointer",s.pointer_is_down?(r="#1e90ff",u=!0):(r="#eee",d="#000")),e.fillStyle=r,e.beginPath(),e.roundRect(i,n,o,o,[4]),e.fill(),e.fillStyle=d,e.font="12px Arial",e.textAlign="center",e.fillText(l,i+15,n+20),u};if(!(l>1))return;const w=(t.imageIndex??0)+1;if(b(r-40,d+i-40,30,`${w}/${l}`)){const e=w>=l?0:w;t.pointerDown&&t.pointerDown.index===e||(t.pointerDown={index:e,pos:[...a]})}b(r-40,i+10,30,"x")&&(t.pointerDown&&null===t.pointerDown.index||(t.pointerDown={index:null,pos:[...a]}))})(e,t,s)}computeLayoutSize(e,t){return{minHeight:220,minWidth:1}}}const Je=()=>(e,t)=>e.addCustomWidget(new Ke(t.name,{serialize:!1}));function Be(e,t,i,s,a,n){return e>=i&&e<i+a&&t>=s&&t<s+n}class Qe extends Float64Array{constructor(e=0,t=0,i=0,s=0){super(4),w(this,h),w(this,m),this[0]=e,this[1]=t,this[2]=i,this[3]=s}subarray(e=0,t){const i=e<<3,s=void 0===t?t:t-e;return new Float64Array(this.buffer,i,s)}get pos(){return b(this,h)??_(this,h,this.subarray(0,2)),b(this,h)}set pos(e){this[0]=e[0],this[1]=e[1]}get size(){return b(this,m)??_(this,m,this.subarray(2,4)),b(this,m)}set size(e){this[2]=e[0],this[3]=e[1]}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get width(){return this[2]}set width(e){this[2]=e}get height(){return this[3]}set height(e){this[3]=e}get left(){return this[0]}set left(e){this[0]=e}get top(){return this[1]}set top(e){this[1]=e}get right(){return this[0]+this[2]}set right(e){this[0]=e-this[2]}get bottom(){return this[1]+this[3]}set bottom(e){this[1]=e-this[3]}get centreX(){return this[0]+.5*this[2]}get centreY(){return this[1]+.5*this[3]}updateTo(e){this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3]}containsXy(e,t){const{x:i,y:s,width:a,height:n}=this;return e>=i&&e<i+a&&t>=s&&t<s+n}containsPoint(e){return this.x<=e[0]&&this.y<=e[1]&&this.x+this.width>=e[0]&&this.y+this.height>=e[1]}containsRect(e){return this.x<=e[0]&&this.y<=e[1]&&this.x+this.width>=e[0]+e[2]&&this.y+this.height>=e[1]+e[3]}overlaps(e){return this.x<e[0]+e[2]&&this.y<e[1]+e[3]&&this.x+this.width>e[0]&&this.y+this.height>e[1]}findContainingCorner(e,t,i){return this.isInTopLeftCorner(e,t,i)?"NW":this.isInTopRightCorner(e,t,i)?"NE":this.isInBottomLeftCorner(e,t,i)?"SW":this.isInBottomRightCorner(e,t,i)?"SE":void 0}isInTopLeftCorner(e,t,i){return Be(e,t,this.x,this.y,i,i)}isInTopRightCorner(e,t,i){return Be(e,t,this.right-i,this.y,i,i)}isInBottomLeftCorner(e,t,i){return Be(e,t,this.x,this.bottom-i,i,i)}isInBottomRightCorner(e,t,i){return Be(e,t,this.right-i,this.bottom-i,i,i)}isInTopEdge(e,t,i){return Be(e,t,this.x,this.y,this.width,i)}isInBottomEdge(e,t,i){return Be(e,t,this.x,this.bottom-i,this.width,i)}isInLeftEdge(e,t,i){return Be(e,t,this.x,this.y,i,this.height)}isInRightEdge(e,t,i){return Be(e,t,this.right-i,this.y,i,this.height)}getCentre(){return[this.centreX,this.centreY]}getArea(){return this.width*this.height}getPerimeter(){return 2*(this.width+this.height)}getTopLeft(){return[this[0],this[1]]}getBottomRight(){return[this.right,this.bottom]}getSize(){return[this[2],this[3]]}getOffsetTo([e,t]){return[e-this[0],t-this[1]]}getOffsetFrom([e,t]){return[this[0]-e,this[1]-t]}resizeTopLeft(e,t){this[2]+=this[0]-e,this[3]+=this[1]-t,this[0]=e,this[1]=t}resizeBottomLeft(e,t){this[2]+=this[0]-e,this[3]=t-this[1],this[0]=e}resizeTopRight(e,t){this[2]=e-this[0],this[3]+=this[1]-t,this[1]=t}resizeBottomRight(e,t){this[2]=e-this[0],this[3]=t-this[1]}setWidthRightAnchored(e){const t=this[2];this[2]=e,this[0]+=t-e}setHeightBottomAnchored(e){const t=this[3];this[3]=e,this[1]+=t-e}toArray(){return this.export()}export(){return[this[0],this[1],this[2],this[3]]}_drawDebug(e,t="red"){const{strokeStyle:i,lineWidth:s}=e;try{e.strokeStyle=t,e.lineWidth=.5,e.beginPath(),e.strokeRect(this[0],this[1],this[2],this[3])}finally{e.strokeStyle=i,e.lineWidth=s}}}h=new WeakMap,m=new WeakMap;const $e=(e,...t)=>function(...i){try{t.forEach((e=>null==e?void 0:e.call(this,...i)))}catch(s){null==e||e.call(this,...i,s)}};let et=null;const tt=new Image;tt.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='white' stroke-linecap='round' stroke-width='1.3' d='M9.18613 3.09999H6.81377M9.18613 12.9H7.55288c-3.08678 0-5.35171-2.99581-4.60305-6.08843l.3054-1.26158M14.7486 2.1721l-.5931 2.45c-.132.54533-.6065.92789-1.1508.92789h-2.2993c-.77173 0-1.33797-.74895-1.1508-1.5221l.5931-2.45c.132-.54533.6065-.9279 1.1508-.9279h2.2993c.7717 0 1.3379.74896 1.1508 1.52211Zm-8.3033 0-.59309 2.45c-.13201.54533-.60646.92789-1.15076.92789H2.4021c-.7717 0-1.33793-.74895-1.15077-1.5221l.59309-2.45c.13201-.54533.60647-.9279 1.15077-.9279h2.29935c.77169 0 1.33792.74896 1.15076 1.52211Zm8.3033 9.8-.5931 2.45c-.132.5453-.6065.9279-1.1508.9279h-2.2993c-.77173 0-1.33797-.749-1.1508-1.5221l.5931-2.45c.132-.5453.6065-.9279 1.1508-.9279h2.2993c.7717 0 1.3379.7489 1.1508 1.5221Z'/%3E%3C/svg%3E %3C/svg%3E";const it=["custom_obsidian","custom_obsidian_dark","custom_milk_white","obsidian_dark","obsidian","milk_white"],st={"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 whileLoopStart":"blue","easy whileLoopEnd":"blue","easy loadImagesForLoop":"blue"};let at=LGraphCanvas.node_colors,nt=null,ot=null,lt=null,rt=new Qe;for(let qa in Ve)dt=Ve[qa],ce.ui.settings.settingsLookup[dt.id]||ce.ui.settings.addSetting(dt);var dt;function ut(e,t,i,s,a,n){var o,l,r;t.strokeStyle=s,t.fillStyle=a;const d=LiteGraph.NODE_TITLE_HEIGHT,{low_quality:u}=this,{collapsed:A}=e.flags,c=e.renderingShape,{title_mode:p}=e.constructor,h=p!=LiteGraph.TRANSPARENT_TITLE&&p!=LiteGraph.NO_TITLE,m=rt;m.set(e.boundingRect),m[0]-=e.pos[0],m[1]-=e.pos[1];let f=t.globalAlpha;if(t.lineWidth=1,t.beginPath(),c==LiteGraph.BOX_SHAPE||u?t.fillRect(m[0],m[1],m[2],m[3]):c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CARD_SHAPE?t.roundRect(m[0],m[1],m[2],m[3],c==LiteGraph.CARD_SHAPE?[this.round_radius,this.round_radius,0,0]:[this.round_radius]):c==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*i[0],.5*i[1],.5*i[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&&qe(t,m,{shape:c,title_mode:p,title_height:d,padding:12,color:LiteGraph.NODE_ERROR_COLOUR,collapsed:A,thickness:10}),!A&&h&&(t.shadowColor="transparent",t.fillStyle="rgba(0,0,0,0.2)",t.fillRect(0,-1,m[2],2)),t.shadowColor="transparent",e.onDrawBackground&&e.onDrawBackground(t,this,this.canvas,this.graph_mouse),h||p==LiteGraph.TRANSPARENT_TITLE){const s="dark"==function(e){let t=e.replace("#","");return i=parseInt(t.substring(0,2),16),s=parseInt(t.substring(2,4),16),a=parseInt(t.substring(4,6),16),.299*i+.587*s+.114*a>127.5?"light":"dark";var i,s,a}((null==e?void 0:e.color)||"#ffffff");e.drawTitleBarBackground(t,{scale:this.ds.scale,low_quality:u});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 l=10;if(e.onDrawTitleBox)e.onDrawTitleBox(t,d,i,this.ds.scale);else if([LiteGraph.ROUND_SHAPE,LiteGraph.CIRCLE_SHAPE,LiteGraph.CARD_SHAPE].includes(c))if(u&&(t.fillStyle="black",t.beginPath(),t.arc(.5*d,-.5*d,.5*l+1,0,2*Math.PI),t.fill()),e.subgraph&&!e.skip_subgraph_button)t.save(),t.fillStyle="#3b82f6",t.beginPath(),t.roundRect(6,-24.5,22,20,5),t.fill(),u||(t.translate(25,23),t.scale(-1.5,1.5),t.drawImage(tt,0,-d,l,l)),t.restore();else{const i=s?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR,o=s?"#eeeeee":e.boxcolor||a||LiteGraph.NODE_DEFAULT_BOXCOLOR;t.fillStyle=n?i:o,t.beginPath(),t.fillRect(10,0-1.05*l-1,1.1*l,.125*l),t.fillRect(10,0-1.45*l-1,1.1*l,.125*l),t.fillRect(10,0-1.85*l-1,1.1*l,.125*l)}else u&&(t.fillStyle="black",t.fillRect(.5*(d-l)-1,-.5*(d+l)-1,l+2,l+2)),t.fillStyle=e.renderingBoxColor,t.fillRect(.5*(d-l),-.5*(d+l),l,l);if(t.globalAlpha=f,e.onDrawTitleText&&e.onDrawTitleText(t,d,i,this.ds.scale,this.title_text_font,n),!u){t.font=this.title_text_font;const i=e.getTitle()??`${e.type}`,a=String(i)+(e.pinned?"📌":"");a&&(t.fillStyle=n?s?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR:s?"#ffffff":e.constructor.title_text_color||this.node_title_color,e.flags.collapsed?(t.textAlign="left",t.measureText(a),t.fillText(a.substr(0,20),d,LiteGraph.NODE_TITLE_TEXT_Y-d),t.textAlign="left"):(t.textAlign="left",t.fillText(a,d,LiteGraph.NODE_TITLE_TEXT_Y-d)))}null==(o=e.onDrawTitle)||o.call(e,t)}if(null==e?void 0:e.strokeStyles){for(const i of Object.values(e.strokeStyles)){const s=i.call(e);s&&qe(t,m,{shape:c,title_height:d,title_mode:p,collapsed:A,...s})}null==e||e.drawProgressBar(t)}else if(n){null==(l=e.onBounding)||l.call(e,m),p==LiteGraph.TRANSPARENT_TITLE&&(m[1]-=d,m[3]+=d),t.lineWidth=2,t.globalAlpha=.8,t.beginPath();let a=0,n=0,o=1;c==LiteGraph.BOX_SHAPE?t.rect(a+m[0],a+m[1],n+m[2],n+m[3]):c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CARD_SHAPE&&e.flags.collapsed?t.roundRect(a+m[0],a+m[1],n+m[2],n+m[3],[this.round_radius*o]):c==LiteGraph.CARD_SHAPE?t.roundRect(a+m[0],a+m[1],n+m[2],n+m[3],[this.round_radius*o,o,this.round_radius*o,o]):c==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*i[0],.5*i[1],.5*i[0]+6,0,2*Math.PI),t.strokeStyle=LiteGraph.NODE_BOX_OUTLINE_COLOR,t.stroke(),t.strokeStyle=s,t.globalAlpha=1}null==(r=e.drawProgressBar)||r.call(e,t),e.execute_triggered>0&&e.execute_triggered--,e.action_triggered>0&&e.action_triggered--}function At(e,t,i,s,a){return new LiteGraph.ContextMenu(LiteGraph.NODE_MODES,{event:i,callback:function(e){if(!a)return;var t=Object.values(LiteGraph.NODE_MODES).indexOf(e),i=function(e){t>=0&&LiteGraph.NODE_MODES[t]?e.changeMode(t):e.changeMode(LiteGraph.ALWAYS),et||(et=Ze()),et.update()},s=LGraphCanvas.active_canvas;if(!s.selected_nodes||Object.keys(s.selected_nodes).length<=1)i(a);else for(var n in s.selected_nodes)i(s.selected_nodes[n])},parentMenu:s,node:a}),!1}function ct(e,t,i,s,a){if(!a)throw"no node for color";var n=[];for(var o in n.push({value:null,content:"<span style='display: block; padding-left: 4px;'>No color</span>"}),LGraphCanvas.node_colors){var l=LGraphCanvas.node_colors[o];e={value:o,content:"<span style='display: block; color: #999; padding-left: 4px; border-left: 8px solid "+l.color+"; background-color:"+l.bgcolor+"'>"+o+"</span>"};n.push(e)}return new LiteGraph.ContextMenu(n,{event:i,callback:function(e){if(!a)return;var t=e.value?LGraphCanvas.node_colors[e.value]:null,i=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),et||(et=Ze()),et.update()},s=LGraphCanvas.active_canvas;if(!s.selected_nodes||Object.keys(s.selected_nodes).length<=1)i(a);else for(var n in s.selected_nodes)i(s.selected_nodes[n]);a.setDirtyCanvas(!0,!0)},parentMenu:s,node:a}),!1}function pt(e,t,i,s,a){var n=e.property||"title",o=a[n],l=document.createElement("div");l.is_modified=!1,l.className="graphdialog",l.innerHTML="<span class='name'></span><input autofocus type='text' class='value'/><button>OK</button>",l.close=function(){l.parentNode&&l.parentNode.removeChild(l)},l.querySelector(".name").innerText=n;var r=l.querySelector(".value");r&&(r.value=o,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 d=LGraphCanvas.active_canvas.canvas,u=d.getBoundingClientRect(),A=-20,c=-20;u&&(A-=u.left,c-=u.top),event?(l.style.left=event.clientX+A+"px",l.style.top=event.clientY+c+"px"):(l.style.left=.5*d.width+A+"px",l.style.top=.5*d.height+c+"px"),l.querySelector("button").addEventListener("click",h),d.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));a[n]=t,l.parentNode&&l.parentNode.removeChild(l);a.setDirtyCanvas(!0,!0),et||(et=Ze());et.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)}))}(e=>{try{ce.registerExtension(e)}catch(t){}})({name:"Comfy.EasyUse.UI",init(){var e,t;const i="Comfy.CustomColorPalettes",s="Comfy.Settings.Comfy.CustomColorPalettes";if(nt||(nt=be(i,s)),ot||(ot=be("Comfy.ColorPalette","Comfy.Settings.Comfy.ColorPalette")||"dark"),(!(null==(e=null==nt?void 0:nt.obsidian)?void 0:e.version)||nt.obsidian.version<Re.ColorPalette.version)&&(nt.obsidian=Re.ColorPalette,nt.obsidian_dark=Pe.ColorPalette,_e(i,nt,s)),(!nt||!(null==(t=null==nt?void 0:nt.milk_white)?void 0:t.version)||nt.milk_white.version<ze.ColorPalette.version)&&(nt.milk_white=ze.ColorPalette,_e(i,nt,s)),it.includes(ot)){switch(document.body.classList+=" comfyui-easyuse",function(e,t=!1){const i=document.createElement("link");i.rel="preconnect",i.href=e,t&&(i.crossorigin=""),document.head.appendChild(i)}("https://fonts.googleapis.com",!0),function(e,t=!0,i="ComfyUI-Easy-Use"){const s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.href=t?`extensions/${i}/${e}`:e,document.head.appendChild(s)}("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700&amp;family=JetBrains+Mono&amp;display=swap",!1),ot){case"obsidian":case"obsidian_dark":case"custom_obsidian":case"custom_obsidian_dark":case"dark":LGraphCanvas.node_colors=Re.NODE_COLORS;break;case"custom_milk_white":case"milk_white":case"light":LGraphCanvas.node_colors=ze.NODE_COLORS}at=LGraphCanvas.node_colors,LiteGraph.NODE_TEXT_SIZE=13,LGraphCanvas.prototype.drawNodeShape=$e(LGraphCanvas.prototype.drawNodeShape,ut)}else document.body.classList.remove("comfyui-easyuse");LGraphCanvas.onMenuNodeMode=$e(LGraphCanvas.onMenuNodeMode,At),LGraphCanvas.onMenuNodeColors=$e(LGraphCanvas.onMenuNodeColors,ct),LGraphCanvas.onShowPropertyEditor=$e(LGraphCanvas.onShowPropertyEditor,pt)},async setup(){var e;Object.assign(ce.canvas.default_connection_color_byType,Ee),Object.assign(LGraphCanvas.link_type_colors,Ee),"custom_milk_white"==ot&&document.body.classList.remove(ke),ce.ui.settings.addEventListener("Comfy.ColorPalette.change",(async({detail:e})=>{(null==e?void 0:e.value)&&(null==e?void 0:e.oldValue)&&(await je(1),Object.assign(ce.canvas.default_connection_color_byType,Ee),Object.assign(LGraphCanvas.link_type_colors,Ee)),"custom_milk_white"==e.value&&document.body.classList.remove(ke)})),setTimeout((e=>ht(be("Comfy.UseNewMenu")||"Disabled")),1);const t=null==(e=ce.ui.settings.settingsLookup)?void 0:e["Comfy.UseNewMenu"];t&&(t.onChange=e=>ht(e)),pe.addEventListener("easyuse-toast",(e=>{const t=e.detail.content,i=e.detail.type,s=e.detail.duration;i?Xe.show({id:`toast-${i}`,icon:Xe[i+"_icon"],content:`${t}`,duration:s||3e3}):Xe.info(t,s)}))},async nodeCreated(e){if(st.hasOwnProperty(e.comfyClass)){const t=st[e.comfyClass],i=at[t];if(!i)return;!e.bgcolor&&i.bgcolor&&(e.bgcolor=i.bgcolor),!e.color&&i.color&&(e.color=i.color)}}});const ht=e=>{var t;const i=(null==(t=document.getElementById("crystools-root"))?void 0:t.children)||null,s=be("Comfy.Workflow.WorkflowTabsPosition",null);if((null==i?void 0:i.length)>0&&s)if(lt||(lt=document.getElementById("MonitorUI")),"Disabled"==e){document.getElementById("crystools-root").appendChild(lt)}else{let e=document.getElementById("crystools-root-easyuse");if(e)e.appendChild(lt);else{const e=document.getElementsByClassName("comfyui-menu-right");e.length>0&&e[0].before(he("div",{id:"crystools-root-easyuse"},lt))}}};let mt={};const ft=(e,t)=>e.widgets.find((e=>e.name===t)),gt=(e,t,i=!1,s="")=>{var a;if(!t||((e,t,i)=>!!e.inputs&&e.inputs.some((e=>e.name===t&&e.link&&!i)))(e,t.name,i))return;mt[t.name]||(mt[t.name]={origType:t.type,origComputeSize:t.computeSize});const n=e.size;t.hidden=!i,t.type=i?mt[t.name].origType:"easyHidden"+s,t.computeSize=i?mt[t.name].origComputeSize:()=>[0,-4],null==(a=t.linkedWidgets)||a.forEach((s=>gt(e,s,":"+t.name,i)));const o=i?Math.max(e.computeSize()[1],n[1]):e.size[1];e.setSize([e.size[0],o])},vt=(e,t=0)=>{var i,s;if(e)return(null==(i=e.widgets)?void 0:i[t])?e.widgets[t].value:e.widgets_values?null==(s=e.widgets_values)?void 0:s[t]:void 0},yt=e=>e.setSize([e.size[0],e.computeSize()[1]]),bt=(e,t)=>graph.getNodeById(e),wt=e=>{var t;try{return Object.values(null==(t=null==graph?void 0:graph.list_of_graphcanvas[0])?void 0:t.selected_nodes)}catch(i){return[]}};function _t(e,t,i){return e+(s=i,(.5-.5*Math.cos(Math.PI*s))*(t-e));var s}const St=(e,t=!0)=>{var i,s;const a=(null==(s=null==(i=e.graph)?void 0:i.list_of_graphcanvas)?void 0:s[0])||null;if(!a)return;const[n,o]=e.pos,[l,r]=e.size;(([e,t],i)=>{const s=i.ds,a=document.body.clientWidth,n=document.body.clientHeight,o=s.scale,l=.5*a/o-e,r=.5*n/o-t,d=Date.now()+250,u=s.offset[0],A=s.offset[1],c=()=>{const e=d-Date.now();if(!(Date.now()<d))return s.offset[0]=l,s.offset[1]=r,void i.setDirty(!0,!0);requestAnimationFrame(c);const t=1-e/250;s.offset[0]=_t(u,l,t),s.offset[1]=_t(A,r,t),i.setDirty(!0,!0)};requestAnimationFrame(c)})([n+l/2,o+r/2],a),t&&a.selectNode(e)},Lt=e=>{const t=bt(e);t&&St(t)},xt=(e,t=(()=>graph.links??[])())=>t[e],kt=e=>e.toLowerCase().replace(/_./g,(e=>e.replace("_","").toUpperCase())),Et=e=>"easy getNode"===e.type,Nt=e=>"easy setNode"===e.type,Ct=e=>Et(e)||Nt(e),It=(e=(()=>graph._nodes??[])())=>e.filter((e=>Ct(e)));let Tt={},Ot={};const Mt=(e,t,i=0)=>{e.widgets_values||(e.widgets_values=[]),e.widgets_values[i]=t,e.widgets[i].value=t},Dt=e=>graph.add(e),Rt=e=>graph.remove(e),Pt=(e,t=0)=>{var i,s;if("Reroute"!==e.type)return[e,t];const a=e,n=null==(s=null==(i=a.inputs)?void 0:i[0])?void 0:s.link;if(!n)return[a,t];const o=xt(n);if(!o)return[a,t];const l=bt(o.origin_id);return l?(setTimeout((()=>{Rt(a)})),Pt(l,o.origin_slot)):[a,t]},Gt=e=>{var t,i,s;if("Reroute"!==e.type)return e;const a=e,n=null==(i=null==(t=a.outputs)?void 0:t[0])?void 0:i.links;if(!n)return a;const o=n[0];if(!o)return a;const l=xt(o);if(!l)return a;const r=bt(l.target_id);return r?(1===(null==(s=a.outputs[0].links)?void 0:s.length)&&setTimeout((()=>{Rt(a)})),Gt(r)):a},zt=(e,t="width")=>{var i;const s=e[0],a="width"==t?0:1,n=null==(i=s.size)?void 0:i[a];n&&(e.forEach((e=>{e.size[a]=n})),LGraphCanvas.active_canvas.setDirty(!0,!0))},Vt=(e,t="horizontal")=>{if(e.length<3)return;const i="horizontal"===t?0:1;e.sort(((e,t)=>e.pos[i]-t.pos[i]));const s=Math.min(...e.map((e=>e.pos[i]))),a=(Math.max(...e.map((e=>e.pos[i]+e.size[i])))-s-e.reduce(((e,t)=>e+t.size[i]),0))/(e.length-1);let n=s;e.forEach((e=>{e.pos[i]=n,n+=e.size[i]+a})),LGraphCanvas.active_canvas.setDirty(!0,!0)},jt="$$canvas-image-preview";const Ut="$$comfy_animation_preview";const Wt="video_upload",Ft=(e,t)=>{if(!e)return!1;const i=(e=>{var t;return null==(t=e.constructor)?void 0:t.nodeData})(e);if(!(null==i?void 0:i.input))return!1;return(e=>{if(!e)return[];const{required:t,optional:i}=e,s=[];if(t)for(const a of Object.values(t))s.push(a);if(i)for(const a of Object.values(i))s.push(a);return s})(i.input).some((e=>{var i;return null==(i=null==e?void 0:e[1])?void 0:i[t]}))};const Xt=e=>null==e?void 0:e.id.toString(),Zt=e=>ce.nodeOutputs[Xt(e)],Ht=e=>ce.nodePreviewImages[Xt(e)];function qt(e){var t;const i=Ht(e),s=Zt(e);if((null==i?void 0:i.length)&&!e.isOutputFinal)return i;if(!(null==(t=null==s?void 0:s.images)?void 0:t.length))return(null==i?void 0:i.length)?i:void 0;const a=ce.getRandParam(),n=(e=>e.animatedImages?"":ce.getPreviewFormatParam())(e);return s.images.map((e=>{const t=new URLSearchParams(e);return pe.apiURL(`/view?${t}${n}${a}`)}))}const Yt="video-preview",Kt={playsInline:!0,controls:!0,loop:!0},Jt=(e,t)=>{const{loadElement:i,onLoaded:s,onFailedLoading:a}=t,n=async(e,t=0)=>{const s=await Promise.race([i(e),(a=8192,new Promise((e=>setTimeout((()=>e(null)),a))))]);var a;return null===s&&t<1?n(e,t+1):s};return{showPreview:function(){var i;if(e.isLoading)return;const o=(null==(i=e.videos)?void 0:i.length)>0?e.videos.map((e=>{return t=e,pe.apiURL(`/view?filename=${encodeURIComponent(t.filename)}&type=${t.type}&subfolder=${t.subfolder}&rand=${Math.random()}`);var t})):qt(e);(null==o?void 0:o.length)&&((null==t?void 0:t.block)&&(e.isLoading=!0),(async e=>Promise.all(e.map((e=>n(e)))))(o).then((e=>{const t=e.filter((e=>null!==e));t.length&&(null==s||s(t))})).catch((()=>{null==a||a()})).finally((()=>{e.isLoading=!1})))}}},Bt=e=>{e.previewMediaType="image";return Jt(e,{loadElement:e=>new Promise((t=>{const i=new Image;i.onload=()=>t(i),i.onerror=()=>t(null),i.src=e})),onLoaded:t=>{e.imageIndex=null,e.imgs=t},onFailedLoading:()=>{e.imgs=void 0}})},Qt=e=>{e.previewMediaType="video";return Jt(e,{loadElement:e=>new Promise((t=>{const i=document.createElement("video");Object.assign(i,Kt),i.onloadeddata=()=>t(i),i.onerror=()=>t(null),i.src=e})),onLoaded:t=>{const i=t[0];var s,a;i&&(e.videoContainer||(e.imgs&&(e.imgs=void 0),e.videoContainer=(()=>{const e=document.createElement("div");return e.classList.add("comfy-img-preview"),e})(),e.videoContainer.style.pointerEvents="auto",s=e.videoContainer,(null==(a=e.widgets)?void 0:a.some((e=>e.name===Yt)))||e.addDOMWidget(Yt,"video",s,{hideOnZoom:!1,serialize:!1})),e.videoContainer.replaceChildren(i),e.imageOffset=64)},onFailedLoading:()=>{e.videoContainer=void 0}})};function $t(e,t){var i;if(e.flags.collapsed)return;const{showCanvasImagePreview:s,removeCanvasImagePreview:a}=function(){const e=Je();return{showCanvasImagePreview:function(t){var i;(null==(i=t.imgs)?void 0:i.length)&&t.widgets&&(t.widgets.find((e=>e.name===jt))||e(t,{type:"IMAGE_PREVIEW",name:jt}))},removeCanvasImagePreview:function(e){var t,i;if(!e.widgets)return;const s=e.widgets.findIndex((e=>e.name===jt));s>-1&&(null==(i=(t=e.widgets[s]).onRemove)||i.call(t),e.widgets.splice(s,1))}}}(),{showVideoPreview:n,removeVideoPreview:o}={showVideoPreview:function(e){var t;(null==(t=e.video)?void 0:t.length)&&e.widgets&&e.widgets.findIndex((e=>e.name===Ut))},removeVideoPreview:function(e){var t,i;if(!e.widgets)return;const s=e.widgets.findIndex((e=>"video-preview"===e.name));s>-1&&(null==(i=(t=e.widgets[s]).onRemove)||i.call(t),e.widgets.splice(s,1))}},l=Zt(e),r=Ht(e),d=l&&(e.images!==l.images||e.videos!==l.videos),u=r&&e.preview!==r;if(u&&(e.isOutputFinal=!1,e.isTwiceRendered&&(e.isTwiceRendered=!1),e.preview=r),d&&(e.isOutputFinal=!0,l.images&&(e.images=l.images),l.videos&&(e.videos=l.videos)),d||u){e.animatedImages=null==l?void 0:l.animated;const t=e.animatedImages&&l.images.some((e=>{var t;return null==(t=e.filename)?void 0:t.includes("webp")})),i=e.animatedImages&&!t||!!(A=this)&&(!!A.videoContainer||!!A.widgets&&Ft(A,Wt));d&&(null==l?void 0:l.videos)||i?Qt(e).showPreview():Bt(e).showPreview()}var A;e.id!=ce.runningNodeId&&!e.isTwiceRendered&&e.isOutputFinal&&(e.videos?Qt(e.videos):Bt(e).showPreview(),e.isTwiceRendered=!0),(null==(i=e.imgs)?void 0:i.length)&&(e.animatedImages||d&&(null==l?void 0:l.videos)?(a(e),n(e)):(o(e),s(e)))}const ei=["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","method"],ti=["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"],ii=["FACEID","FACEID PLUS - SD1.5 only","FACEID PLUS V2","FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"],si=["easy seed","easy latentNoisy","easy wildcards","easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingSdTurbo","easy preSamplingCascade","easy preSamplingDynamicCFG","easy preSamplingLayerDiffusion","easy fullkSampler","easy fullCascadeKSampler"],ai=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy hyditLoader","easy pixArtLoader"],ni=["easy fullkSampler","easy kSampler","easy kSamplerCustom","easy kSamplerTiled","easy kSamplerLayerDiffusion","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo","easy fullCascadeKSampler","easy cascadeKSampler"],oi=["easy imageSize","easy imageSizeBySide","easy imageSizeByLongerSide","easy imageSizeShow","easy imageRatio","easy imagePixelPerfect"],li=["easy forLoopStart","easy forLoopEnd","easy whileLoopStart","easy whileLoopEnd"],ri=["easy anythingIndexSwitch","easy imageIndexSwitch","easy textIndexSwitch","easy conditioningIndexSwitch"],di=["easy anythingInversedSwitch"],ui=["easy loadImagesForLoop",...li,...ri,...di],Ai={"easy anythingInversedSwitch":"out","easy anythingIndexSwitch":"value","easy imageIndexSwitch":"image","easy textIndexSwitch":"text","easy conditioningIndexSwitch":"cond"};function ci(e,t){var i;const s=e.comfyClass;let a=t.value;switch(t.name){case"range_mode":gt(e,ft(e,"step"),"step"==a),gt(e,ft(e,"num_steps"),"num_steps"==a),yt(e);break;case"text_combine_mode":gt(e,ft(e,"replace_text"),"replace"==a);break;case"lora_name":["lora_model_strength","lora_clip_strength"].map((t=>gt(e,ft(e,t),"None"!==a)));break;case"resolution":"自定义 x 自定义"===a&&(t.value="width x height (custom)"),["empty_latent_width","empty_latent_height","width","height"].map((t=>gt(e,ft(e,t),"width x height (custom)"===a)));break;case"ratio":["empty_latent_width","empty_latent_height"].map((t=>gt(e,ft(e,t),"custom"===a)));break;case"num_loras":var n=a+1,o=null==(i=ft(e,"mode"))?void 0:i.value;requestAnimationFrame((t=>{for(let i=0;i<n;i++)gt(e,ft(e,"lora_"+i+"_name"),!0),gt(e,ft(e,"lora_"+i+"_strength"),"simple"===o),["lora_"+i+"_model_strength","lora_"+i+"_clip_strength"].map((t=>gt(e,ft(e,t),"simple"!==o)));for(let i=n;i<99;i++)["lora_"+i+"_name","lora_"+i+"_strength","lora_"+i+"_model_strength","lora_"+i+"_clip_strength"].map((t=>gt(e,ft(e,t),!1)));yt(e)}));break;case"num_controlnet":n=a+1,o=ft(e,"mode").value;for(let t=0;t<n;t++)["controlnet_"+t,"controlnet_"+t+"_strength","scale_soft_weight_"+t].map((t=>gt(e,ft(e,t),!0))),["start_percent_"+t,"end_percent_"+t].map((t=>gt(e,ft(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=>gt(e,ft(e,t),!1)));yt(e);break;case"mode":switch(null==e?void 0:e.comfyClass){case"easy loraStack":n=ft(e,"num_loras").value+1,o=a;for(let t=0;t<n;t++)gt(e,ft(e,"lora_"+t+"_strength"),"simple"===o),["lora_"+t+"_model_strength","lora_"+t+"_clip_strength"].map((t=>gt(e,ft(e,t),"simple"!==o)));yt(e);break;case"easy controlnetStack":n=ft(e,"num_controlnet").value+1,o=a;for(let t=0;t<n;t++)["start_percent_"+t,"end_percent_"+t].map((t=>gt(e,ft(e,t),"simple"!==o)));yt(e);break;case"easy icLightApply":o=a;["lighting","remove_bg"].map((t=>gt(e,ft(e,t),"Foreground"===o))),gt(e,ft(e,"source"),"Foreground"!==o),yt(e)}break;case"toggle":t.type="toggle",t.options={on:"Enabled",off:"Disabled"};break;case"t5_type":["clip_name","padding"].map((t=>gt(e,ft(e,t),"sd3"==a))),["t5_name","device","dtype"].map((t=>gt(e,ft(e,t),"t5v11"==a))),yt(e);break;case"preset":if("FLUX.1-dev"==a&&(t.value="REGULAR - FLUX and SD3.5 only (high strength)"),ti.includes(a)){let t=ft(e,"use_tiled");gt(e,ft(e,"lora_strength")),gt(e,ft(e,"provider"),!!["REGULAR - FLUX and SD3.5 only (high strength)"].includes(a)),gt(e,ft(e,"weight_faceidv2")),gt(e,ft(e,"weight_kolors")),gt(e,ft(e,"use_tiled"),!0),gt(e,ft(e,"sharpening"),t&&t.value)}else ii.includes(a)&&(gt(e,ft(e,"weight_faceidv2"),!!["FACEID PLUS V2","FACEID PLUS KOLORS"].includes(a)),gt(e,ft(e,"weight_kolors"),!!["FACEID PLUS KOLORS"].includes(t.value)),["FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"].includes(a)?gt(e,ft(e,"lora_strength"),!1):gt(e,ft(e,"lora_strength"),!0),gt(e,ft(e,"provider"),!0),gt(e,ft(e,"use_tiled")),gt(e,ft(e,"sharpening")));yt(e);break;case"use_tiled":gt(e,ft(e,"sharpening"),!!a),yt(e);break;case"num_embeds":n=a+1;for(let t=0;t<n;t++)gt(e,ft(e,"weight"+t),!0);for(let t=n;t<6;t++)gt(e,ft(e,"weight"+t));yt(e);break;case"inpaint_mode":switch(a){case"normal":case"fooocus_inpaint":["dtype","fitting","function","scale","start_at","end_at"].map((t=>gt(e,ft(e,t),!1)));break;case"brushnet_random":case"brushnet_segmentation":["dtype","scale","start_at","end_at"].map((t=>gt(e,ft(e,t),!0))),["fitting","function"].map((t=>gt(e,ft(e,t),!1)));break;case"powerpaint":["dtype","fitting","function","scale","start_at","end_at"].map((t=>gt(e,ft(e,t),!0)))}yt(e);break;case"encode":gt(e,ft(e,"noise_mask"),!!["inpaint_model_conditioning","different_diffusion"].includes(a)),yt(e);break;case"image_output":gt(e,ft(e,"link_id"),!!["Sender","Sender&Save"].includes(a)),gt(e,ft(e,"decode_vae_name"),!!["Hide","Hide&Save"].includes(a)),["save_prefix","output_path","embed_workflow","number_padding","overwrite_existing"].map((t=>gt(e,ft(e,t),!!["Save","Hide&Save","Sender&Save"].includes(a))));break;case"add_noise":var l=ft(e,"control_before_generate"),r=ft(e,"control_after_generate")||l;"disable"===a?(gt(e,ft(e,"seed")),r&&(r.last_value=r.value,r.value="fixed",gt(e,r))):("enable"===a&&(t.value="enable (CPU)"),gt(e,ft(e,"seed"),!0),r&&((null==r?void 0:r.last_value)&&(r.value=r.last_value),gt(e,r,!0))),yt(e);break;case"guider":switch(a){case"Basic":case"IP2P+Basic":["cfg_negative"].map((t=>gt(e,ft(e,t))));break;case"CFG":case"IP2P+CFG":gt(e,ft(e,"cfg"),!0),gt(e,ft(e,"cfg_negative"));break;case"DualCFG":case"IP2P+DualCFG":["cfg","cfg_negative"].map((t=>gt(e,ft(e,t),!0)))}yt(e);break;case"scheduler":"easy preSamplingCustom"==s&&(["karrasADV","exponentialADV","polyExponential"].includes(a)?(["sigma_max","sigma_min"].map((t=>gt(e,ft(e,t),!0))),["denoise","beta_d","beta_min","eps_s","coeff"].map((t=>gt(e,ft(e,t))),!1),gt(e,ft(e,"rho"),"exponentialADV"!=a)):"vp"==a?(["sigma_max","sigma_min","denoise","rho","coeff"].map((t=>gt(e,ft(e,t)))),["beta_d","beta_min","eps_s"].map((t=>gt(e,ft(e,t),!0)))):(["sigma_max","sigma_min","beta_d","beta_min","eps_s","rho"].map((t=>gt(e,ft(e,t)))),gt(e,ft(e,"coeff"),"gits"==a),gt(e,ft(e,"denoise"),!0)),yt(e));break;case"conditioning_mode":["replace","concat","combine"].includes(a)?["average_strength","old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>gt(e,ft(e,t)))):"average"==a?(gt(e,ft(e,"average_strength"),!0),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>gt(e,ft(e,t),!1)))):"timestep"==a&&(["average_strength"].map((t=>gt(e,ft(e,t),!1))),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>gt(e,ft(e,t),!0))));break;case"rescale":ft(e,"rescale_after_model").value,gt(e,ft(e,"width"),"to Width/Height"===a),gt(e,ft(e,"height"),"to Width/Height"===a),gt(e,ft(e,"percent"),"by percentage"===a),gt(e,ft(e,"longer_side"),"to longer side - maintain aspect"===a),yt(e);break;case"upscale_method":["factor","crop"].map((t=>gt(e,ft(e,t),"None"!==a)));break;case"target_parameter":switch(s){case"easy XYInputs: Steps":["first_step","last_step"].map((t=>gt(e,ft(e,t),"steps"==a))),["first_start_step","last_start_step"].map((t=>gt(e,ft(e,t),"start_at_step"==a))),["first_end_step","last_end_step"].map((t=>gt(e,ft(e,t),"end_at_step"==a)));break;case"easy XYInputs: Sampler/Scheduler":let t=ft(e,"input_count").value+1;for(let i=0;i<t;i++)gt(e,ft(e,"sampler_"+i),"scheduler"!==a),gt(e,ft(e,"scheduler_"+i),"sampler"!==a);yt(e);break;case"easy XYInputs: ControlNet":["first_strength","last_strength"].map((t=>gt(e,ft(e,t),"strength"==a))),["first_start_percent","last_start_percent"].map((t=>gt(e,ft(e,t),"start_percent"==a))),["first_end_percent","last_end_percent"].map((t=>gt(e,ft(e,t),"end_percent"==a))),["strength","start_percent","end_percent"].map((t=>gt(e,ft(e,t),a!=t))),yt(e)}case"replace_count":n=a+1;for(let t=0;t<n;t++)gt(e,ft(e,"replace_"+t),!0);for(let t=n;t<31;t++)gt(e,ft(e,"replace_"+t));yt(e);break;case"lora_count":n=a+1;var d=-1==ft(e,"input_mode").value.indexOf("Weights");for(let t=0;t<n;t++)gt(e,ft(e,"lora_name_"+t),!0),["model_str_"+t,"clip_str_"+t].map((t=>gt(e,ft(e,t),!d)));for(let t=n;t<11;t++)["lora_name_"+t,"model_str_"+t,"clip_str_"+t].map((t=>gt(e,ft(e,t),!1)));yt(e);break;case"ckpt_count":n=a+1;var u=-1!=ft(e,"input_mode").value.indexOf("ClipSkip"),A=-1!=ft(e,"input_mode").value.indexOf("VAE");for(let t=0;t<n;t++)gt(e,ft(e,"ckpt_name_"+t),!0),gt(e,ft(e,"clip_skip_"+t),!!u),gt(e,ft(e,"vae_name_"+t),!!A);for(let t=n;t<11;t++)["ckpt_name_"+t,"clip_skip_"+t,"vae_name_"+t].map((t=>gt(e,ft(e,t),!1)));yt(e);break;case"input_count":n=a+1;var c=ft(e,"target_parameter").value;for(let t=0;t<n;t++)gt(e,ft(e,"sampler_"+t),"scheduler"!==c),gt(e,ft(e,"scheduler_"+t),"sampler"!==c);for(let t=n;t<31;t++)gt(e,ft(e,"sampler_"+t)),gt(e,ft(e,"scheduler_"+t));yt(e);break;case"input_mode":switch(s){case"easy XYInputs: Lora":n=ft(e,"lora_count").value+1;const t=-1!=a.indexOf("Weights");for(let i=0;i<n;i++)gt(e,ft(e,"lora_name_"+i),!0),["model_str_"+i,"clip_str_"+i].map((i=>gt(e,ft(e,i),!!t)));["model_strength","clip_strength"].map((i=>gt(e,ft(e,i),!t)));break;case"easy XYInputs: Checkpoint":n=ft(e,"ckpt_count").value+1,u=-1!=ft(e,"input_mode").value.indexOf("ClipSkip"),A=-1!=ft(e,"input_mode").value.indexOf("VAE");for(let i=0;i<n;i++)gt(e,ft(e,"ckpt_name_"+i),!0),gt(e,ft(e,"clip_skip_"+i),!!u),gt(e,ft(e,"vae_name_"+i),!!A)}yt(e);break;case"rem_mode":gt(e,ft(e,"torchscript_jit"),"Inspyrenet"===a),gt(e,ft(e,"refine_foreground"),"BEN2"===a),yt(e)}}ce.registerExtension({name:"Comfy.EasyUse.Widget",async beforeRegisterNodeDef(e,t,i){var s;const a=t.name,n=e.prototype.onAdded,o=e.prototype.onNodeCreated,l=e.prototype.onConfigure,r=e.prototype.onExecuted,d=e.prototype.onConnectionsChange;if(["easy showAnything","easy showAnythingLazy","easy showTensorShape","easy showSpentTime","easy imageInterrogator","easy showLoaderSettingsNames"].includes(a)){let s=function(e,t="text"){var s,a;if(this.widgets){const e=this.widgets.findIndex((e=>e.name===t));if(-1!==e){for(let t=e;t<this.widgets.length;t++)null==(a=(s=this.widgets[t]).onRemove)||a.call(s);this.widgets.length=e}}for(const n of e){const e=fe.STRING(this,"text",["STRING",{multiline:!0}],i).widget;e.inputEl.readOnly=!0,e.inputEl.style.opacity=.6,e.value=n}requestAnimationFrame((()=>{var e;const t=this.computeSize();t[0]<this.size[0]&&(t[0]=this.size[0]),t[1]<this.size[1]&&(t[1]=this.size[1]),null==(e=this.onResize)||e.call(this,t),i.graph.setDirtyCanvas(!0,!1)}))};e.prototype.onExecuted=function(e){null==r||r.apply(this,arguments),s.call(this,e.text,"text")},["easy imageInterrogator"].includes(t.name)||(e.prototype.onConfigure=function(){var e;null==l||l.apply(this,arguments);let t="text";switch(a){case"easy showLoaderSettingsNames":t="names";break;case"easy showSpentTime":t="spent_time";break;default:t="text"}(null==(e=this.widgets_values)?void 0:e.length)&&s.call(this,this.widgets_values,t)})}if(oi.includes(a)){let t=function(e){var t="";for(let i=0;i<e.length;i++)t+=e[i];if(this.widgets){const e=this.widgets.findIndex((e=>"info"===e.name));if(-1!==e&&this.widgets[e]){this.widgets[e].value=t}}requestAnimationFrame((()=>{var e;const t=this.computeSize();t[0]<this.size[0]&&(t[0]=this.size[0]),t[1]<this.size[1]&&(t[1]=this.size[1]),null==(e=this.onResize)||e.call(this,t),i.graph.setDirtyCanvas(!0,!1)}))};e.prototype.onExecuted=function(e){null==r||r.apply(this,arguments),t.call(this,e.text)}}if("easy promptLine"==a&&(e.prototype.onAdded=async function(){n&&n.apply(this,[]);let e=this.widgets.find((e=>"prompt"==e.name));this.addWidget("button","get values from COMBO link","",(()=>{var t,s;const a=(null==(s=null==(t=this.outputs[1])?void 0:t.links)?void 0:s.length)>0?this.outputs[1].links[0]:null,n=i.graph._nodes.find((e=>{var t;return null==(t=e.inputs)?void 0:t.find((e=>e.link==a))}));if(a&&n){const t=n.inputs.find((e=>e.link==a)).widget.name,i=n.widgets.find((e=>e.name==t));let s=(null==i?void 0:i.options.values)||null;s&&(s=s.join("\n"),e.value=s)}else Xe.error(Le("No COMBO link"),3e3)}),{serialize:!1})}),ai.includes(t.name)){let t=function(e){var t="";for(let i=0;i<e.length;i++)t+=e[i];return t},i=function(e,t="positive"){if(this.widgets){const i=this.widgets.findIndex((e=>e.name===t+"_prompt")),s="comfy-multiline-input wildcard_"+t+"_"+this.id.toString();if(-1==i&&e){const i=document.createElement("textarea");i.className=s,i.placeholder="Wildcard Prompt ("+t+")";const a=this.addDOMWidget(t+"_prompt","customtext",i,{getValue:e=>i.value,setValue(e){i.value=e},serialize:!1});a.inputEl=i,a.inputEl.readOnly=!0,i.addEventListener("input",(()=>{var e;null==(e=a.callback)||e.call(a,a.value)})),a.value=e}else if(this.widgets[i])if(e){this.widgets[i].value=e}else{this.widgets.splice(i,1);const e=document.getElementsByClassName(s);e&&e[0]&&e[0].remove()}}};e.prototype.onExecuted=function(e){null==r||r.apply(this,arguments);const s=t(e.positive),a=t(e.negative);i.call(this,s,"positive"),i.call(this,a,"negative")}}if(["easy sv3dLoader"].includes(t.name)){let t=function(e,t,i){switch(e){case"azimuth":return i.readOnly=!0,i.style.opacity=.6,"0:(0.0,0.0)"+(t>1?`\n${t-1}:(360.0,0.0)`:"");case"elevation":return i.readOnly=!0,i.style.opacity=.6,"0:(-90.0,0.0)"+(t>1?`\n${t-1}:(90.0,0.0)`:"");case"custom":return i.readOnly=!1,i.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)),i=this.widgets.find((e=>"batch_size"==e.name)),s=this.widgets.find((e=>"scheduler"==e.name));setTimeout((a=>{s.value||(s.value=t(e.value,i.value,s.inputEl))}),1),e.callback=e=>{s.value=t(e,i.value,s.inputEl)},i.callback=i=>{s.value=t(e.value,i,s.inputEl)}}}if(si.includes(a)&&(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","control_before_generate","control_after_generate"].includes(e.name)));if("easy seed"==t.name&&s){const t=this.addWidget("button","🎲 Manual Random Seed",null,(t=>{"fixed"!=s.value&&(s.value="fixed"),e.value=Math.floor(Math.random()*Ne),i.queuePrompt(0,1)}),{serialize:!1});e.linkedWidgets=[t,s]}},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","control_before_generate","control_after_generate"].includes(e.name)));t&&setTimeout((i=>{["control before generate","control_before_generate"].includes(t.name)&&0===e.value&&(e.value=Math.floor(Math.random()*Ne))}),1)}),"easy convertAnything"==a&&(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"==a){let t=function(e){const t=e.widgets[0];for(let i=1;i<=4;i++)"Pixels"===t.value?(e.widgets[i].options.step=80,void 0!==e.widgets[i].options.step2&&(e.widgets[i].options.step2=8),e.widgets[i].options.max=8192):(e.widgets[i].options.step=10,void 0!==e.widgets[i].options.step2&&(e.widgets[i].options.step2=1),e.widgets[i].options.max=99)};e.prototype.onAdded=async function(e){const i=this.widgets[0];let s=i.callback;i.callback=(...e)=>{t(this),s&&s.apply(i,[...e])},setTimeout((e=>{t(this)}),1)}}if(ui.includes(a)){const t=e=>{switch(a){case"easy forLoopStart":case"easy whileLoopStart":return 0;case"easy forLoopEnd":case"easy whileLoopEnd":return 1}},i=e=>{switch(a){case"easy forLoopStart":return 2;case"easy forLoopEnd":case"easy whileLoopEnd":return 0;case"easy whileLoopStart":return 1}};e.prototype.onNodeCreated=async function(){if("easy loadImagesForLoop"==a&&(this.outputs[0].shape=5),li.includes(a)){const e=this.inputs.findIndex((e=>"flow"===e.name)),s=this.outputs.findIndex((e=>"flow"===e.name));-1!==e&&(this.inputs[e].shape=5),-1!==s&&(this.outputs[s].shape=5),this.inputs=this.inputs.filter(((e,i)=>i<=t()||e.widget)),this.outputs=this.outputs.filter(((e,t)=>t<=i())),yt(this)}return ri.includes(a)&&("easy textIndexSwitch"==a&&(this.widgets=this.widgets.filter(((e,t)=>t<=2))),this.inputs=this.inputs.filter(((e,t)=>t<=1||e.widget)),yt(this)),null==o?void 0:o.apply(this,arguments)},e.prototype.onConnectionsChange=function(e,s,n,o){var l,r;if(o)if(1==e){let e=this.inputs.every((e=>null!==e.link||e.widget)),i=this.inputs.filter((e=>!["condition","index","total"].includes(e.name)));if(li.includes(a)){if(e){if(i.length>=20)return void Xe.warn(Le("The maximum number of inputs is 20"));let e=i[i.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,a="value"+t;this.addInput(s,"*"),this.addOutput(a,"*")}else if(!n){const e=t();let i=this.inputs.findLastIndex((e=>e.link));if(s>=e&&(-1===i||s>=i)){let e=this.inputs[s];if(!e.name||["condition","total"].includes(e.name))return;let t=parseInt(e.name.split("initial_value")[1])+1,i=this.inputs.findIndex((e=>e.name==="initial_value"+t)),a=this.outputs.findIndex((e=>e.name==="value"+t));-1!==i&&this.removeInput(i),-1!==a&&this.removeOutput(a)}}}else if(ri.includes(a))if(e){if(i.length>=20)return void Xe.warn(Le("The maximum number of inputs is 20"));let e=Ai[a]+i.length;this.addInput(e,"*")}else n||s==this.inputs.length-2&&this.removeInput(s+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(li.includes(a)){if(t){if(e.length>=20)return void Xe.warn(Le("The maximum number of outputs is 20"));let t=e[e.length-1],i=parseInt(t.name.split("value")[1])+1;if(this.inputs.find((e=>e.name==="initial_value"+i)))return;if(this.outputs.find((e=>e.name==="value"+i)))return;let s="initial_value"+i,a="value"+i;this.addInput(s,"*"),this.addOutput(a,"*")}else if(!n){const e=i();let t=o.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 i=parseInt(e.name.split("value")[1])+1,s=this.inputs.findIndex((e=>e.name==="initial_value"+i)),a=this.outputs.findIndex((e=>e.name==="value"+i));if(-1!==s&&(null==(l=this.inputs[s])?void 0:l.link))return;-1!==s&&this.removeInput(s),-1!==a&&this.removeOutput(a)}}}else if(di.includes(a))if(t){if(e.length>=20)return void Xe.warn(Le("The maximum number of outputs is 20"));let t=Ai[a]+e.length;this.addOutput(t,"*")}else if(!n){let t=o.origin_slot;t==this.outputs.length-2&&0==(null==(r=e[t].links)?void 0:r.length)&&this.removeOutput(t+1)}}}}if(["easy fluxLoader","easy fullLoader"].includes(a)&&(e.prototype.onConnectionsChange=async function(e,t){d&&d.apply(this,[]);const i=this.inputs.find((e=>"model_override"===e.name)),s=this.inputs.find((e=>"vae_override"===e.name));let a=ft(this,"ckpt_name"),n=ft(this,"vae_name");if((null==i?void 0:i.link)&&0==t){const e=(null==a?void 0:a.options.values)||[];setTimeout((t=>{this.widgets[0].value=(null==e?void 0:e[0])||"None",gt(this,a,!(null==i?void 0:i.link))}),1)}else gt(this,a,!(null==i?void 0:i.link));if(!(null==s?void 0:s.link)||1!=t&&2!=t)gt(this,n,!(null==s?void 0:s.link));else{let e=this.widgets.findIndex((e=>"vae_name"==e.name));setTimeout((t=>{this.widgets[e].value="Baked VAE",gt(this,n,!(null==s?void 0:s.link))}),1)}}),ni.includes(a)||-1!==a.indexOf("workflow")){const i=(null==(s=null==t?void 0:t.input)?void 0:s.required)||{};if(!i.image_output&&!i["图像输出"]&&!i["视频输出"])return;e.prototype.onDrawBackground=function(e){try{$t(this)}catch(t){}}}},nodeCreated(e){if(e.comfyClass.startsWith("easy ")){if(e.widgets)for(const i of e.widgets){if(!ei.includes(i.name))continue;let t=i.value;ci(e,i),Object.defineProperty(i,"value",{get:e=>t,set(s){s!==t&&(t=s,requestAnimationFrame((t=>{ci(e,i)})))}})}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","easy wildcardsMatrix"].includes(t)){const t=e.widgets.find((e=>"text"==e.name));let i=1;Object.defineProperty(e.widgets[i],"value",{set:e=>{if("Select the LoRA to add to the text"!=e){let i=e;i.endsWith(".safetensors")&&(i=i.slice(0,-12)),t.value+=`<lora:${i}>`}},get:e=>"Select the LoRA to add to the text"}),Object.defineProperty(e.widgets[i+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[i].serializeValue=e=>"Select the LoRA to add to the text",e.widgets[i+1].serializeValue=e=>"Select the Wildcard to add to the text"}if("easy prompt"==t){const t=e.widgets.find((e=>"text"==e.name));let i=1;Object.defineProperty(e.widgets[i],"value",{set:s=>{var a,n;"Select the prefix to add to the text"!=s&&(null==(n=null==(a=e.widgets[i])?void 0:a.options)?void 0:n.values.includes(s))&&(""==t.value?t.value+=s:t.value+=" "+s)},get:e=>"Select the prefix to add to the text"}),Object.defineProperty(e.widgets[i+1],"value",{set:s=>{var a,n;"👤Select the subject add to the text"!=s&&(null==(n=null==(a=e.widgets[i+1])?void 0:a.options)?void 0:n.values.includes(s))&&(""==t.value?t.value+=s:t.value+=" "+s)},get:e=>"👤Select the subject add to the text"}),Object.defineProperty(e.widgets[i+2],"value",{set:s=>{var a,n;"🎬Select the action add to the text"!=s&&(null==(n=null==(a=e.widgets[i+2])?void 0:a.options)?void 0:n.values.includes(s))&&(""==t.value?t.value+=s:t.value+=","+s)},get:e=>"🎬Select the action add to the text"}),Object.defineProperty(e.widgets[i+3],"value",{set:s=>{var a,n;"👚Select the clothes add to the text"!=s&&(null==(n=null==(a=e.widgets[i+3])?void 0:a.options)?void 0:n.values.includes(s))&&(""==t.value?t.value+=s:t.value+=","+s)},get:e=>"👚Select the clothes add to the text"}),Object.defineProperty(e.widgets[i+4],"value",{set:s=>{var a,n;"☀Select the illumination environment add to the text"!=s&&(null==(n=null==(a=e.widgets[i+4])?void 0:a.options)?void 0:n.values.includes(s))&&(""==t.value?t.value+=s:t.value+=","+s)},get:e=>"☀Select the illumination environment add to the text"}),Object.defineProperty(e.widgets[i+5],"value",{set:s=>{var a,n;"🎞Select the background add to the text"!=s&&(null==(n=null==(a=e.widgets[i+5])?void 0:a.options)?void 0:n.values.includes(s))&&(""==t.value?t.value+=s:t.value+=" "+s)},get:e=>"🎞Select the background add to the text"}),Object.defineProperty(e.widgets[i+6],"value",{set:s=>{var a,n;"🔞Select the nsfw add to the text"!=s&&(null==(n=null==(a=e.widgets[i+6])?void 0:a.options)?void 0:n.values.includes(s))&&(""==t.value?t.value+=s:t.value+=","+s)},get:e=>"🔞Select the nsfw add to the text"}),e.widgets[i].serializeValue=e=>"Select the prefix add to the text",e.widgets[i+1].serializeValue=e=>"👤Select the subject add to the text",e.widgets[i+2].serializeValue=e=>"🎬Select the action add to the text",e.widgets[i+3].serializeValue=e=>"👚Select the clothes add to the text",e.widgets[i+4].serializeValue=e=>"☀Select the illumination environment add to the text",e.widgets[i+5].serializeValue=e=>"🎞Select the background add to the text",e.widgets[i+6].serializeValue=e=>"🔞Select the nsfw add to the text"}if(oi.includes(t)){const t=document.createElement("textarea");t.className="comfy-multiline-input",t.readOnly=!0;const i=e.addDOMWidget("info","customtext",t,{getValue:e=>t.value,setValue:e=>t.value=e,serialize:!1});i.inputEl=t,t.addEventListener("input",(()=>{var e;null==(e=i.callback)||e.call(i,i.value)}))}}}});const pi=LiteGraph.LGraphNode;ce.registerExtension({name:"easy bookmark",registerCustomNodes(){class e extends pi{constructor(){super("🔖"),v(this,"type","easy bookmark"),v(this,"title","🔖"),v(this,"slot_start_y",-20),v(this,"___collapsed_width",0),v(this,"isVirtualNode",!0),v(this,"serialize_widgets",!0),v(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=ce.canvas,i=t.canvas.getContext("2d");if(i){const e=i.font;i.font=t.title_text_font,this.___collapsed_width=40+i.measureText(this.title).width,i.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 i=ce.canvas;(null==(e=null==i?void 0:i.ds)?void 0:e.offset)&&(i.ds.offset[0]=16-this.pos[0],i.ds.offset[1]=40-this.pos[1]),null!=(null==(t=null==i?void 0:i.ds)?void 0:t.scale)&&(i.ds.scale=Number(this.widgets[1].value||1)),i.setDirty(!0,!0)}}LiteGraph.registerNodeType("easy bookmark",Object.assign(e,{title:"Bookmark 🔖"})),e.category="EasyUse/Util"}}),ce.registerExtension({name:"Comfy.EasyUse.ChainNode",init(){ce.canvas._mousemove_callback=e=>{be("EasyUse.Nodes.ChainGetSet",null)&&((e=!1,t={})=>{var i,s,a,n,o;const l=It();if(!l||l.length<1)return;const r=wt();if(0===r.length)return;let d=t.inputX||160,u=t.ouputX||60;if(r.filter((e=>Ct(e))).length>1)return;for(const c of r){let n=t.inputY||10,o=t.outputY||30;const l=[],A=c.id;if(c.graph){Tt[A]||(Tt[A]=[]);for(const e of c.inputs??[]){const t=e.link;if(!t)continue;const{origin_id:i,target_slot:s}=xt(t),a=bt(i);if(!a)continue;if(!Ct(a))continue;let o=c.getConnectionPos(!0,s);Tt[A][s]||(Tt[A][s]=o),!Tt[A]||Tt[A][s][1]===o[1]&&Tt[A][s][0]===o[0]||(d=o[0]-Tt[A][s][0],n=o[1]-Tt[A][s][1],a.pos=[a.pos[0]+d,a.pos[1]+n]),Tt[A][s]=o,l.push(a)}Ot[A]||(Ot[A]=[]);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:a}=xt(t),n=bt(e);if(!n)continue;if(!Ct(n))continue;const r=null==(i=n.outputs)?void 0:i.links;if((null==r?void 0:r.length)>1)return;const d=c.getConnectionPos(!1,a);Ot[A][a]||(Ot[A][a]=d),!Ot[A]||Ot[A][a][0]===d[0]&&Ot[A][a][1]===d[1]||(u=d[0]-Ot[A][a][0],o=d[1]-Ot[A][a][1],n.pos=[n.pos[0]+u,n.pos[1]+o]),Ot[A][a]=d,l.push(n)}if(e&&1===r.length){const e=[c,...l];(null==(a=null==(s=c.graph)?void 0:s.list_of_graphcanvas)?void 0:a[0]).selectNodes(e)}}}const A=r[0];if(!A)return;(null==(o=null==(n=A.graph)?void 0:n.list_of_graphcanvas)?void 0:o[0]).setDirty(!0,!0)})()};const e=LGraphCanvas.prototype.showLinkMenu;LGraphCanvas.prototype.showLinkMenu=$e(e,(function(t,i){return i.shiftKey?(((e,t=!1)=>{var i,s,a,n,o,l,r,d,u,A;const{type:c}=e;if("*"===c)return;let{origin_id:p,target_id:h,origin_slot:m,target_slot:f}=e,g=bt(p),v=bt(h);if(!g||!v)return!1;if("Reroute"===g.type){let e=0;[g,e]=Pt(g),p=null==g?void 0:g.id,m=e,void 0!==m&&-1!==m||(m=0)}if("Reroute"===v.type&&(v=Gt(v),h=null==v?void 0:v.id,f=null==v?void 0:v.inputs.findIndex((e=>e.type===c)),void 0!==f&&-1!==f||(f=0)),void 0===p||void 0===h||!g||!v)return!1;if(t&&(Ct(g)||Ct(v)))return!1;let y=kt((null==(i=v.getInputInfo(f))?void 0:i.name)??c.toLowerCase());y||(y=kt((null==(a=null==(s=null==g?void 0:g.outputs)?void 0:s[m])?void 0:a.name)??(null==(o=null==(n=null==g?void 0:g.outputs)?void 0:n[m])?void 0:o.type.toString())??y+`_from_${p}_to_${h}`));let b,w=!1,_=!1;if(Ct(g))y=vt(g),_=!0;else{const e=null==(r=null==(l=g.outputs)?void 0:l[m])?void 0:r.links;if(e)for(const t of e){const e=bt((null==(d=xt(t))?void 0:d.target_id)??-1);e&&Ct(e)&&Nt(e)&&(y=vt(e),_=!0)}if(!_){for(const e of It()){if(y!==vt(e)||!Nt(e))continue;const t=null==(u=e.inputs[0])?void 0:u.link;(null==(A=xt(t))?void 0:A.origin_id)===g.id?_=!0:w=!0}w&&(y+=`_from_${p}_to_${h}`)}}if(!_){b=LiteGraph.createNode("easy setNode"),b.is_auto_link=!0;const e=g.getConnectionPos(!1,m);b.pos=[e[0]+20,e[1]],b.inputs[0].name=y,b.inputs[0].type=c,b.inputs[0].widget=v.inputs[f].widget,Mt(b,y),Dt(b),b.flags.collapsed=!0;let t=[];g.widgets?t=Object.values(g.widgets).map((e=>e.value)):g.widgets_values&&(t=JSON.parse(JSON.stringify(g.widgets_values))),g.connect(m,b,0),g.widgets_values=t,"PrimitiveNode"===g.type&&setTimeout((()=>{if(g){g.connect(m,b,0);for(const[e,i]of t.entries())Mt(g,i,e);null!==b&&b.setSize(b.computeSize())}}))}const S=LiteGraph.createNode("easy getNode"),L=v.getConnectionPos(!0,f);S.pos=[L[0]-150,L[1]],S.outputs[0].name=y,S.outputs[0].type=c,S.outputs[0].widget=v.inputs[f].widget,Dt(S),Mt(S,y),null===S||(S.flags.collapsed=!0,S.setSize(S.computeSize()),S.connect(0,v,f))})(t),!1):(e.apply(this,[t,i]),!1)}))}});const hi=async()=>{try{const{Running:e,Pending:t}=await pe.getQueue();if(e.length>0||t.length>0)return void Xe.error(Le("Clean Failed")+":"+Le("Please stop all running tasks before cleaning GPU"));200==(await pe.fetchApi("/easyuse/cleangpu",{method:"POST"})).status?Xe.success(Le("Clean SuccessFully")):Xe.error(Le("Clean Failed"))}catch(e){}};let mi={},fi=!1;function gi(e,t,i,s,a){var n=LGraphCanvas.active_canvas,o=n.getCanvasWindow(),l=n.graph;if(l)return function e(t,s){var r=LiteGraph.getNodeTypesCategories(n.filter||l.filter).filter((function(e){return e.startsWith(t)})),d=[];r.map((function(i){if(i){var s=new RegExp("^("+t+")"),a=i.replace(s,"").split("/")[0],n=""===t?a+"/":t+a+"/",o=a;-1!=o.indexOf("::")&&(o=o.split("::")[1]),-1===d.findIndex((function(e){return e.value===n}))&&d.push({value:n,content:o,has_submenu:!0,callback:function(t,i,s,a){e(t.value,a)}})}})),LiteGraph.getNodeTypesInCategory(t.slice(0,-1),n.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,i,s){var o=s.getFirstEvent();n.graph.beforeChange();var l=LiteGraph.createNode(e.value);l&&(l.pos=n.convertEventToCanvasOffset(o),n.graph.add(l)),a&&a(l),n.graph.afterChange()}};d.push(t)}}));const u=be("EasyUse.ContextMenu.NodesSort",null);""===t&&u&&(d=function(e){let t=[],i=[];return e.forEach((e=>{(null==e?void 0:e.value)&&Ce.includes(e.value.split("/")[0])?t.push(e):i.push(e)})),[{title:Le("ComfyUI Basic"),is_category_title:!0},...t,{title:Le("Others A~Z"),is_category_title:!0},...i.sort(((e,t)=>e.content.localeCompare(t.content)))]}(d)),new LiteGraph.ContextMenu(d,{event:i,parentMenu:s},o)}("",s),!1}function vi(e){try{return encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))}catch(t){return e}}function yi(e,t,i){var s=this;i=i||{};var a=document.createElement("div");a.className="litemenu-entry submenu";var n=!1;function o(e){var t=this.value,a=!0;(s.current_submenu&&s.current_submenu.close(e),i.callback)&&(!0===i.callback.call(this,t,i,e,s,i.node)&&(a=!1));if(t){if(t.callback&&!i.ignore_item_callbacks&&!0!==t.disabled)!0===t.callback.call(this,t,i,e,s,i.extra)&&(a=!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:i.autoopen}),a=!1}}a&&!s.lock&&s.close()}return null===t?a.classList.add("separator"):t.is_category_title?(a.classList.remove("litemenu-entry"),a.classList.remove("submenu"),a.classList.add("litemenu-title"),a.innerHTML=t.title):(a.innerHTML=t&&t.title?t.title:e,a.value=t,t&&(t.disabled&&(n=!0,a.classList.add("disabled")),(t.submenu||t.has_submenu)&&a.classList.add("has_submenu")),"function"==typeof t?(a.dataset.value=e,a.onclick_callback=t):a.dataset.value=t,t.className&&(a.className+=" "+t.className)),a&&(null==t?void 0:t.thumbnail)&&(a.addEventListener("mouseenter",wi(a,t,this.root),{passive:!0}),a.addEventListener("mouseleave",_i(),{passive:!0}),a.addEventListener("click",_i(),{passive:!0})),this.root.appendChild(a),n||a.addEventListener("click",o),!n&&i.autoopen&&LiteGraph.pointerListenerAdd(a,"enter",(function(e){var t=this.value;if(!t||!t.has_submenu)return;o.call(this,e)})),a}ce.registerExtension({name:"Comfy.EasyUse.ContextMenu",async setup(){LGraphCanvas.onMenuAdd=gi,bi();const e=LiteGraph.ContextMenu;LiteGraph.ContextMenu=function(t,i){if(!(null==i?void 0:i.callback)||t.some((e=>"string"!=typeof e))){if(i.parentMenu);else if(i.extra);else if(i.scale);else{const e=be("EasyUse.ContextMenu.QuickOptions",null);if(i.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 i={content:`<i class="mdi mdi-refresh-circle comfyui-easyuse-error" style="margin-right:2px;font-size:16px"></i>${Le("Reboot ComfyUI")}`,callback:e=>(async()=>{if(confirm(Le("Are you sure you'd like to reboot the server?")))try{pe.fetchApi("/easyuse/reboot")}catch(e){}})()};"At the forefront"==e?t.unshift(i):t.push(i)}const i=be("EasyUse.Hotkeys.cleanVRAMUsed",null)?"("+Fe("Shift+r")+")":"",a={content:`<i class="mdi mdi-rocket comfyui-easyuse-theme" style="margin-right:2px;font-size:16px"></i>${Le("Cleanup Of VRAM Usage")} ${i}`,callback:e=>hi()};"At the forefront"==e?t.unshift(a):t.push(a);const n=be("EasyUse.Hotkeys.toggleNodesMap",null)?"("+Fe("Shift+m")+")":"",o={content:`<i class="mdi mdi-sitemap comfyui-easyuse-warning" style="margin-right:2px;font-size:14px"></i>${Le("Nodes Map")} ${n}`,callback:e=>{var t,i,s;const a=(null==(t=ce.extensionManager)?void 0:t.sidebarTab)||ce.extensionManager,n=(null==(i=ce.extensionManager.sidebarTab)?void 0:i.activeSidebarTabId)||(null==(s=ce.extensionManager)?void 0:s.activeSidebarTab);a.activeSidebarTabId=n==Oe?null:Oe}};"At the forefront"==e?t.unshift(o):t.push(o)}}return e.apply(this,[...arguments])}{const s=function(e,t){const i=be("EasyUse.ContextMenu.ModelsThumbnails",null),s=be("EasyUse.ContextMenu.SubDirectories",null);if(!i&&!s)return null;if(fi)return null;const a=["ckpt","pt","bin","pth","safetensors","gguf"];if((null==e?void 0:e.length)>0){const t=null==(n=e[e.length-1])?void 0:n.substring(n.lastIndexOf(".")+1);if(!a.includes(t))return null}var n;const o=t.callback,l=[...e];t.callback=null;const r=(e,t)=>{["None","无","無","なし"].includes(e.content)?o("None",t):o(l.find((t=>t.endsWith(e.content)),t))};if(i&&!s)return e.map((e=>{var t,i;let s=null==(t=mi[e])?void 0:t.folder,a=null==(i=mi[e])?void 0:i.pathIndex;const n=window.location.protocol,o=window.location.host;let l=s?`${`${n}//${o}`}/api/experiment/models/preview/${s}/${a}/${vi(e)}`:"";return{folder:s,content:e,fullName:e,title:he("div.comfyui-easyuse-contextmenu-model",{},[he("span",{},e)]).outerHTML,thumbnail:l,callback:r}}));const d=e,u={},A=[],c=[];for(const f of d){const e=f.indexOf("/")>-1?"/":"\\",t=f.split(e);if(t.length>1){const i=t.shift();u[i]=u[i]||[],u[i].push({value:t.join(e),fullValue:f})}else"CHOOSE"===f||f.startsWith("DISABLE ")?A.push({value:f,fullValue:f}):c.push({value:f,fullValue:f})}const p=Object.values(u).length,h=[],m=(e,t="",s)=>{var a,n;let o;o=he("div.comfyui-easyuse-contextmenu-model",{},[he("span",{},e)]);let l=null==(a=mi[s])?void 0:a.folder,d=null==(n=mi[s])?void 0:n.pathIndex;const u=window.location.protocol,A=window.location.host;let c=l?`${`${u}//${A}`}/api/experiment/models/preview/${l}/${d}/${vi(s)}`:"";return{folder:l,content:e,fullName:s,thumbnail:i?c:null,title:o.outerHTML,callback:r}};if(p>0){const e=(t,i)=>{let s=[],a=[];const n=t.map((({value:e,fullValue:t})=>{const n={},o=e.indexOf("/")>-1?"/":"\\",l=e.split(o);if(l.length>1){const e=l.shift();n[e]=n[e]||[],n[e].push({value:l.join(o),fullValue:t})}if(Object.values(u).length>0){let i=Object.keys(n)[0];i&&n[i]?s.push({key:i,value:n[i][0]}):a.push(m(e,i,t))}return m(e,i,t)}));if(s.length>0){let t={};return s.forEach((e=>{t[e.key]=t[e.key]||[],t[e.key].push(e.value)})),[...Object.entries(t).map((t=>({content:t[0],has_submenu:!0,callback:()=>{},submenu:{options:e(t[1],t[0])}}))),...a]}return n};for(const[t,i]of Object.entries(u))h.push({content:t,has_submenu:!0,callback:()=>{},submenu:{options:e(i,t)}})}h.push(...c.map((e=>m(e.value,"",e.fullValue)))),A.length>0&&h.push(...A.map((e=>m(e.value,"",e.fullValue))));return h}(t,i);return s?e.call(this,s,i):e.apply(this,[...arguments])}var s},LiteGraph.ContextMenu.prototype=e.prototype,be("EasyUse.ContextMenu.NodesSort")&&(LiteGraph.ContextMenu.prototype.addItem=yi),document.getElementById("graph-canvas").addEventListener("mouseenter",(e=>{setTimeout((e=>{const t=document.getElementById("easyuse-model-thumbnail");t&&0!=t.style.opacity&&(t.style.display="none",t.style.opacity=0,t.style.left="0px",t.style.top="0px")}),100)}))},async beforeRegisterNodeDef(e,t,i){const s=e.prototype.onNodeCreated;["CheckpointLoader|pysssss","LoraLoader|pysssss"].includes(t.name)&&(e.prototype.onNodeCreated=async function(){s&&s.apply(this,[]);let e=ft(this,"lora_name")||ft(this,"ckpt_name");if(e){let t=e.onClick;e.onClick=function(e){return fi=!0,setTimeout((e=>{fi=!1}),500),t.call(this,e)}}})}});const bi=async()=>{["checkpoints","loras","diffusion_models"].map((async e=>{const t=await pe.getModels(e);(null==t?void 0:t.length)>0&&t.map((t=>{mi[t.name]={folder:e,pathIndex:t.pathIndex}}))}))},wi=(e,t,i)=>s=>{var a;const n=t=>{setTimeout((s=>{const a=i.getBoundingClientRect();if(!a)return;const n=document.body.getBoundingClientRect();if(!n)return;const{left:o,top:l}=((e,t,i)=>{const{x:s}=e.getBoundingClientRect();let{top:a,left:n}=t;const{width:o,height:l}=i;return s<=o&&(n+=t.width),t.top<=l||(a=l),{left:n,top:a}})(e,a,n),r=document.getElementById("easyuse-model-thumbnail");r.src=t,r.style.left=`${o}px`,r.style.top=`${l}px`,r.style.display="block",r.style.opacity=1,r.onerror=e=>{r.src=Me}}),10)};if(null==(a=null==mi?void 0:mi[t.fullName])?void 0:a.img){let e=mi[t.fullName].img;n("no_preview_image"==e?Me:e.src)}else{let e=new Image;e.src=t.thumbnail,e.onload=i=>{mi[t.fullName].img=e,n(t.thumbnail)},e.onerror=i=>{e=null,mi[t.fullName].img="no_preview_image",n(Me)}}},_i=()=>e=>{const t=document.getElementById("easyuse-model-thumbnail");t&&0!=t.style.opacity&&(t.style.display="none",t.style.opacity=0,t.style.left="0px",t.style.top="0px")};class Si extends me{constructor(){super(),this.element.classList.add("easyuse-model-metadata")}show(e){super.show(he("div",Object.keys(e).map((t=>he("div",[he("label",{textContent:t}),he("span",{textContent:e[t]})])))))}}class Li extends me{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 i=pe.fetchApi("/easyuse/metadata/"+encodeURIComponent(`${e}/${t}`));this.info=he("div",{style:{flex:"auto"}}),this.imgCurrent=0,this.imgList=he("div.easyuse-preview-list",{style:{display:"none"}}),this.imgWrapper=he("div.easyuse-preview",[he("div.easyuse-preview-group",[this.imgList])]),this.main=he("main",{style:{display:"flex"}},[this.imgWrapper,this.info]),this.content=he("div.easyuse-model-content",[he("div.easyuse-model-header",[he("h2",{textContent:this.name})]),this.main]);const s=he("div",{textContent:" Loading...",parent:this.content});super.show(this.content),this.metadata=await(await i).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=he("button",{type:"button",textContent:"View raw metadata",disabled:"disabled",style:{opacity:.5,cursor:"not-allowed"},onclick:e=>{this.metadata&&(new Si).show(this.metadata)}}),e.unshift(this.viewMetadata),e}parseNote(){if(!this.customNotes)return[];let e=[];const t=new RegExp("(\\bhttps?:\\/\\/[^\\s]+)","g");let i,s=0;do{let a;i=t.exec(this.customNotes);let n=0;i?(a=i.index,n=i.index+i[0].length):a=this.customNotes.length;let o=this.customNotes.substring(s,a);o&&(o=o.replaceAll("\n","<br>"),e.push(he("span",{innerHTML:o}))),i&&e.push(he("a",{href:i[0],textContent:i[0],target:"_blank"})),s=n}while(i);return e}addInfoEntry(e,t){return he("p",{parent:this.info},["string"==typeof e?he("label",{textContent:e+": "}):e,"string"==typeof t?he("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=he("span",{textContent:" Loading..."});return this.addInfoEntry(he("label",[he("img",{style:{width:"18px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),he("span",{textContent:"Civitai: "})]),t),e.then((e=>{var t,i;this.imgWrapper.style.display="block";let s=this.element.querySelector(".easyuse-model-header");s&&s.replaceChildren(he("h2",{textContent:this.name}),he("div.easyuse-model-header-remark",[he("h5",{textContent:Le("Updated At:")+Ue(new Date(e.updatedAt),"yyyy/MM/dd")}),he("h5",{textContent:Le("Created At:")+Ue(new Date(e.updatedAt),"yyyy/MM/dd")})]));let a=null,n=this.parseNote.call(this),o=Le("✏️ Edit"),l=he("div.easyuse-model-detail-textarea",[he("p",(null==n?void 0:n.length)>0?n:{textContent:Le("No notes")})]);if(n&&0!=n.length?l.classList.remove("empty"):l.classList.add("empty"),this.info.replaceChildren(he("div.easyuse-model-detail",[he("div.easyuse-model-detail-head.flex-b",[he("span",Le("Notes")),he("a",{textContent:o,href:"#",style:{fontSize:"12px",float:"right",color:"var(--warning-color)",textDecoration:"none"},onclick:async e=>{if(e.preventDefault(),a){if(a.value!=this.customNotes){Xe.showLoading(Le("Saving Notes...")),this.customNotes=a.value;const e=await pe.fetchApi("/easyuse/metadata/notes/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:this.customNotes});if(Xe.hideLoading(),200!==e.status)return Xe.error(Le("Saving Failed")),void alert(`Error saving notes (${e.status}) ${e.statusText}`);Xe.success(Le("Saving Succeed")),n=this.parseNote.call(this),l.replaceChildren(he("p",(null==n?void 0:n.length)>0?n:{textContent:Le("No notes")})),a.value?l.classList.remove("empty"):l.classList.add("empty")}else l.replaceChildren(he("p",{textContent:Le("No notes")})),l.classList.add("empty");e.target.textContent=o,a.remove(),a=null}else e.target.textContent="💾 Save",a=he("textarea",{placeholder:Le("Type your notes here"),style:{width:"100%",minWidth:"200px",minHeight:"50px",height:"100px"},textContent:this.customNotes}),l.replaceChildren(a),a.focus()}})]),l]),he("div.easyuse-model-detail",[he("div.easyuse-model-detail-head",{textContent:Le("Details")}),he("div.easyuse-model-detail-body",[he("div.easyuse-model-detail-item",[he("div.easyuse-model-detail-item-label",{textContent:Le("Type")}),he("div.easyuse-model-detail-item-value",{textContent:e.model.type})]),he("div.easyuse-model-detail-item",[he("div.easyuse-model-detail-item-label",{textContent:Le("BaseModel")}),he("div.easyuse-model-detail-item-value",{textContent:e.baseModel})]),he("div.easyuse-model-detail-item",[he("div.easyuse-model-detail-item-label",{textContent:Le("Download")}),he("div.easyuse-model-detail-item-value",{textContent:(null==(t=e.stats)?void 0:t.downloadCount)||0})]),he("div.easyuse-model-detail-item",[he("div.easyuse-model-detail-item-label",{textContent:Le("Trained Words")}),he("div.easyuse-model-detail-item-value",{textContent:(null==e?void 0:e.trainedWords.join(","))||"-"})]),he("div.easyuse-model-detail-item",[he("div.easyuse-model-detail-item-label",{textContent:Le("Source")}),he("div.easyuse-model-detail-item-value",[he("label",[he("img",{style:{width:"14px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),he("a",{href:"https://civitai.com/models/"+e.modelId,textContent:"View "+e.model.name,target:"_blank"})])])])])])),null==(i=e.images)?void 0:i.length){this.imgCurrent=0,this.isSaving=!1,e.images.map((e=>e.url&&this.imgList.appendChild(he("div.easyuse-preview-slide",[he("div.easyuse-preview-slide-content",[he("img",{src:e.url}),he("div.save",{textContent:"Save as preview",onclick:async()=>{if(this.isSaving)return;this.isSaving=!0,Xe.showLoading(Le("Saving Preview..."));const t=await(await fetch(e.url)).blob(),i="temp_preview."+new URL(e.url).pathname.split(".")[1],s=new FormData;s.append("image",new File([t],i)),s.append("overwrite","true"),s.append("type","temp");if(200!==(await pe.fetchApi("/upload/image",{method:"POST",body:s})).status)return this.isSaving=!1,Xe.error(Le("Saving Failed")),Xe.hideLoading(),void alert(`Error saving preview (${req.status}) ${req.statusText}`);await pe.fetchApi("/easyuse/save/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:JSON.stringify({filename:i,type:"temp"}),headers:{"content-type":"application/json"}}).then((e=>{Xe.success(Le("Saving Succeed")),Xe.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=he("button.left",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" width="16" height="16" style="transform: rotate(90deg);"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>',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=he("button.right",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" width="16" height="16" style="transform: rotate(-90deg);"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>',onclick:()=>{if(!(e.images.length<=2))if(t.imgList.classList.remove("no-transition"),t.imgCurrent>=e.images.length/2-1){t.imgCurrent=0;const i=e.images.length/2;this.slides[0].style.transform="translate3d("+(660*i).toString()+"px, 0px, 0px)",this.slides[1].style.transform="translate3d("+(660*i).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d("+(-660*i).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&&he("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 xi extends Li{async addInfo(){await this.addCivitaiInfo()}}class ki extends Li{getTagFrequency(){if(!this.metadata.ss_tag_frequency)return[];const e=JSON.parse(this.metadata.ss_tag_frequency),t={};for(const i in e){const s=e[i];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:i,count:s}of Object.values(t.buckets))e.push([s,`${i.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 i=t.split(","),s=i[0].replace("(",""),a=i[1].replace(")","");e.push(`${s.trim()}x${a.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=>he("li.easyuse-model-tag",{dataset:{tag:e[0]},$:e=>{e.onclick=()=>{e.classList.toggle("easyuse-model-tag--selected")}}},[he("p",{textContent:e[0]}),he("span",{textContent:e[1]})])))}addTags(){let e,t=this.getTagFrequency();if(null==t?void 0:t.length){const i=t.length;let s;i>500&&(t=t.slice(0,500),e=he("p",[he("span",{textContent:"⚠️ Only showing first 500 tags "}),he("a",{href:"#",textContent:`Show all ${i}`,onclick:()=>{s.replaceChildren(...this.getTagList(this.getTagFrequency())),e.remove()}})])),s=he("ol.easyuse-model-tags-list",this.getTagList(t)),this.tags=he("div",[s])}else this.tags=he("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&&he("div",{parent:this.content,innerHTML:t.description,style:{maxHeight:"250px",overflow:"auto"}})}createButtons(){const e=super.createButtons();function t(e,t){const i=he("textarea",{parent:document.body,style:{position:"fixed"},textContent:t.map((e=>e.dataset.tag)).join(", ")});i.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(i)}}return e.unshift(he("button",{type:"button",textContent:"Copy Selected",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag--selected")])}}),he("button",{type:"button",textContent:"Copy All",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag")])}})),e}}const Ei={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","Preview Any"],input:{anything:"anything"},output:{output:"output"}},saveText:{category:"Save Text",nodes:["easy saveText"],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"}},indextts_emotions:{category:"IndexTTS Emotions",nodes:["easy indexTTSEmotionVector","easy indexTTSEmotionText","easy indexTTSEmotionAudio"],input:{reference_audio:"reference_audio"},output:{emotions:"emotions"}},indextts_generate:{category:"IndexTTS Generate",nodes:["easy indexTTSGenerate","easy indexTTSGenerateSimple"],input:{indextts_model:"indextts_model",reference_audio:"reference_audio",reference_audios:"reference_audios",emotions:"emotions"},output:{audio:"audio",seed:"seed",subtitle:"subtitle"},widget:{text:"text",unload_model:"unload_model",seed:"seed"}},fast_loaders:{category:"Fast Loaders",nodes:["fast ckptLoader","fast unetLoader"],input:{"开始加载":"开始加载"},output:{"模型加载器":"模型加载器",MODEL:"MODEL",VAE:"VAE",CLIP:"CLIP"}},fast_inputs:{category:"Fast Inputs",nodes:["fast sdInput","fast fluxInput","fast hiDreamInput","fast videoInput","fast qwenImageInput"],input:{"模型加载器":"模型加载器","更多Controlnet":"更多Controlnet","图像":"图像","遮罩":"遮罩","功能节点":"功能节点"},output:{"采样":"采样","正面条件":"正面条件","负面条件":"负面条件","潜空间":"潜空间"},widget:{Sigmas:"Sigmas","分离Sigmas步数":"分离Sigmas步数","分离降噪":"分离降噪","降噪":"降噪","添加噪声":"添加噪声",seed:"seed","生成数量":"生成数量"}},fast_outputResult:{category:"Fast Outputs",nodes:["fast outputResult","fast outputResultVideo","fast outputLatent"],input:{"采样":"采样","噪声":"噪声","模型加载器":"模型加载器"},output:{"图像":"图像序列","图像序列":"图像","输出":"输出","降噪输出":"降噪输出",VAE:"VAE"},widget:{"采样预览":"采样预览","VAE解码":"VAE解码","图像输出":"视频输出","视频输出":"图像输出","保存路径":"保存路径"}},fast_loadImage:{category:"Fast LoadImage",nodes:["fast loadImage","fast loadImageList"],output:{"图像":"图像","遮罩":"遮罩","文件名":"文件名"},widget:{"模式":"模式","图像":"图像","路径":"路径","最大张数":"最大张数","开始索引":"开始索引",Base64:"Base64","链接":"链接"}}};function Ni(e,t,i){return function(){!function(e,t,i){var s;const a=LiteGraph.createNode(t);if(a){if(ce.graph.add(a),a.pos=e.pos.slice(),a.size=e.size.slice(),(null==(s=e.widgets)?void 0:s.length)>0&&e.widgets.forEach((e=>{var t,s,n;if(null==(s=null==(t=Ei[i])?void 0:t.widget)?void 0:s[e.name]){const t=Ei[i].widget[e.name];if(t&&a.widgets){const i=(n=t,a.widgets.find((e=>"object"==typeof n?n.includes(e.name):e.name===n)));i&&(i.value=e.value,"seed_num"==e.name&&(i.linkedWidgets[0].value=e.linkedWidgets[0].value),"converted-widget"==e.type&&Ri(a,i,e))}}})),e.inputs&&e.inputs.forEach(((t,s)=>{var n,o,l;if(t&&t.link&&(null==(o=null==(n=Ei[i])?void 0:n.input)?void 0:o[t.name])){const s=null==(l=Ei[i])?void 0:l.input[t.name];if(null===s)return;const n=a.findInputSlot(s);if(-1!==n){const i=e.graph.links[t.link];if(i){const t=e.graph.getNodeById(i.origin_id);t&&t.connect(i.origin_slot,a,n)}}}})),e.outputs&&e.outputs.forEach(((t,s)=>{var n,o;if(t&&t.links&&(null==(o=null==(n=Ei[i])?void 0:n.output)?void 0:o[t.name])){const s=Ei[i].output[t.name];if(null===s)return;const n=a.findOutputSlot(s);-1!==n&&t.links.forEach((t=>{const i=e.graph.links[t];if(i){const t=e.graph.getNodeById(i.target_id);t&&a.connect(n,t,i.target_slot)}}))}})),ce.graph.remove(e),"easy fullkSampler"==a.type){const e=a.outputs[0].links;if(e&&e[0]){const t=ce.graph._nodes.find((t=>t.inputs&&t.inputs[0]&&t.inputs[0].link==e[0]));t&&ce.graph.remove(t)}}else if(Ei.preSampling.nodes.includes(a.type)){const e=a.outputs[0].links;if(!e||!e[0]){const e=LiteGraph.createNode("easy kSampler");ce.graph.add(e),e.pos=a.pos.slice(),e.pos[0]=e.pos[0]+a.size[0]+20;const t=a.findInputSlot("pipe");-1!==t&&a&&a.connect(0,e,t)}}a.setSize([a.size[0],a.computeSize()[1]])}}(e,t,i)}}const Ci=(e,t)=>{const i=e.prototype.getExtraMenuOptions;e.prototype.getExtraMenuOptions=function(){const e=i.apply(this,arguments);return t.apply(this,arguments),e}},Ii=(e,t,i,s,a=!0)=>{Ci(s,(function(s,n){n.unshift({content:e,has_submenu:a,callback:(e,s,a,n,o)=>Ti(e,s,a,n,o,t,i)}),"loaders"==t&&(n.unshift({content:Le("💎 View Lora Info..."),callback:(e,t,i,s,a)=>{let n=a.widgets.find((e=>"lora_name"==e.name)).value;n&&"None"!=n&&new ki(n).show("loras",n)}}),n.unshift({content:Le("💎 View Checkpoint Info..."),callback:(e,t,i,s,a)=>{let n=a.widgets[0].value;n&&"None"!=n&&new xi(n).show("checkpoints",n)}}))}))},Ti=(e,t,i,s,a,n,o)=>{const l=[];return o.map((e=>{a.type!==e&&l.push({content:`${e}`,callback:Ni(a,e,n)})})),new LiteGraph.ContextMenu(l,{event:i,callback:null,parentMenu:s,node:a}),!1},Oi="converted-widget",Mi=Symbol();function Di(e,t,i=""){if(t.origType=t.type,t.origComputeSize=t.computeSize,t.origSerializeValue=t.serializeValue,t.computeSize=()=>[0,-4],t.type=Oi+i,t.serializeValue=()=>{if(!e.inputs)return;let i=e.inputs.find((e=>{var i;return(null==(i=e.widget)?void 0:i.name)===t.name}));return i&&i.link?t.origSerializeValue?t.origSerializeValue():t.value:void 0},t.linkedWidgets)for(const s of t.linkedWidgets)Di(e,s,":"+t.name)}function Ri(e,t,i){Di(e,t);const{type:s}=function(e){let t=e[0];t instanceof Array&&(t="COMBO");return{type:t}}(i),a=e.size;t.options&&t.options.forceInput||e.addInput(t.name,s,{widget:{name:t.name,[Mi]:()=>i}});for(const n of e.widgets)n.last_y+=LiteGraph.NODE_SLOT_HEIGHT;e.setSize([Math.max(a[0],e.size[0]),Math.max(a[1],e.size[1])])}const Pi=function(e){var t,i,s,a;const n=e.constructor.type,o=e.properties.origVals||{},l=o.title||e.title,r=o.color||e.color,d=o.bgcolor||e.bgcolor,u=e,A={size:[...e.size],color:r,bgcolor:d,pos:[...e.pos]};let c=[],p=[];if(e.inputs)for(const g of e.inputs)if(g.link){const t=g.name,i=e.findInputSlot(t),s=e.getInputNode(i),a=e.getInputLink(i);c.push([a.origin_slot,s,t])}if(e.outputs)for(const g of e.outputs)if(g.links){const e=g.name;for(const t of g.links){const i=graph.links[t],s=graph._nodes_by_id[i.target_id];p.push([e,s,i.target_slot])}}ce.graph.remove(e);let h=ce.graph.add(LiteGraph.createNode(n,l,A));function m(){if(u.widgets)for(let e of u.widgets)if("converted-widget"===e.type){const t=h.widgets.find((t=>t.name===e.name));for(let i of u.inputs)i.name===e.name&&Ri(h,t,i.widget)}for(let e of c){const[t,i,s]=e;i.connect(t,h.id,s)}for(let e of p){const[t,i,s]=e;h.connect(t,i,s)}}h.inputs.map(((t,i)=>{h.inputs[i].label=e.inputs[i].label})),h.outputs.map(((t,i)=>{h.outputs[i].label=e.outputs[i].label}));let f=u.widgets_values;if(!f&&(null==(t=h.widgets)?void 0:t.length)>0)return h.widgets.forEach(((e,t)=>{const i=u.widgets[t];e.name===i.name&&e.type===i.type&&(e.value=i.value)})),void m();if(f){let e=function(e,t){var i,s,a,n,o,l;if(!0===e||!1===e){if((null==(i=t.options)?void 0:i.on)&&(null==(s=t.options)?void 0:s.off))return{value:e,pass:!0}}else if("number"==typeof e){if((null==(a=t.options)?void 0:a.min)<=e&&e<=(null==(n=t.options)?void 0:n.max))return{value:e,pass:!0}}else{if(null==(l=null==(o=t.options)?void 0:o.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 n=(null==f?void 0:f.length)<=(null==(i=h.widgets)?void 0:i.length);let o=n?0:f.length-1;const l=i=>{var s;const a=u.widgets[i];let l=h.widgets[i];if(l.name===a.name&&l.type===a.type){for(;(n?o<f.length:o>=0)&&!t;){let{value:t,pass:i}=e(f[o],l);if(i&&null!==t){l.value=t;break}o+=n?1:-1}o++,n||(o=f.length-((null==(s=h.widgets)?void 0:s.length)-1-i))}};if(n&&(null==(s=h.widgets)?void 0:s.length)>0)for(let i=0;i<h.widgets.length;i++)l(i);else if((null==(a=h.widgets)?void 0:a.length)>0)for(let i=h.widgets.length-1;i>=0;i--)l(i)}m()};ce.registerExtension({name:"Comfy.EasyUse.ExtraMenu",async beforeRegisterNodeDef(e,t,i){Ci(e,(function(e,i){i.unshift({content:Le("🔃 Reload Node"),callback:(e,t,i,s,a)=>{let n=LGraphCanvas.active_canvas;if(!n.selected_nodes||Object.keys(n.selected_nodes).length<=1)Pi(a);else for(let o in n.selected_nodes)Pi(n.selected_nodes[o])}}),"easy ckptNames"==t.name&&i.unshift({content:Le("💎 View Checkpoint Info..."),callback:(e,t,i,s,a)=>{a.widgets[0].value}})}));for(const s in Ei)Ei[s].nodes.includes(t.name)&&Ii(`↪️ Swap ${Ei[s].category}`,s,Ei[s].nodes,e)}});const Gi=LiteGraph.LGraphNode,zi="➡️";ce.registerExtension({name:"easy setNode",registerCustomNodes(){class e extends Gi{constructor(t){super("Set"),v(this,"defaultVisibility",!0),v(this,"serialize_widgets",!0),this.properties||(this.properties={previousName:""}),this.properties.showOutputText=e.defaultVisibility;const i=this;i.color=LGraphCanvas.node_colors.blue.color,this.addWidget("text","Constant","",((e,t,s,a,n)=>{i.validateName(i.graph),""!==this.widgets[0].value&&(this.title=zi+this.widgets[0].value),this.properties.previousName=this.widgets[0].value,this.update()}),{}),this.addInput("*","*"),this.onConnectionsChange=function(e,t,s,a,n){if(1!=e||s||(this.inputs[t].type="*",this.inputs[t].name="*",this.title="Set"),a&&i.graph&&1==e&&s){const e=i.graph._nodes.find((e=>e.id==a.origin_id)).outputs[a.origin_slot];if(!e)return;const t=e.type,s=i.is_auto_link?this.widgets[0].value:e.name;"Set"===this.title&&(this.title=zi+s,this.widgets[0].value=s),"*"===this.widgets[0].value&&(this.widgets[0].value=s),this.validateName(i.graph),this.inputs[0]&&(this.inputs[0].type=t,this.inputs[0].name=s),setTimeout((e=>{this.title=zi+this.widgets[0].value,this.properties.previousName=this.widgets[0].value}),1)}this.update()},this.validateName=function(e){let t=i.widgets[0].value;if(""!=t){let s=0,a=[];do{a=e._nodes.filter((e=>e!=this&&("easy setNode"==e.type&&e.widgets[0].value===t))),a.length>0&&(t=i.widgets[0].value+s),s++}while(a.length>0);i.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(i.graph){this.findGetters(i.graph).forEach((e=>{e.setType(this.inputs[0].type)})),this.widgets[0].value&&this.findGetters(i.graph,!0).forEach((e=>{e.setName(this.widgets[0].value)}));i.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues()}))}},this.findGetters=function(e,t){const i=t?this.properties.previousName:this.widgets[0].value;return e._nodes.filter((e=>"easy getNode"==e.type&&e.widgets[0].value===i&&""!=i))},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"}}),ce.registerExtension({name:"easy getNode",registerCustomNodes(){class e extends Gi{constructor(t){super("Get"),v(this,"defaultVisibility",!0),v(this,"serialize_widgets",!0),this.properties||(this.properties={}),this.properties.showOutputText=e.defaultVisibility;const i=this;i.color=LGraphCanvas.node_colors.blue.color,this.addWidget("combo","Constant","",(e=>{this.onRename()}),{values:()=>i.graph._nodes.filter((e=>"easy setNode"==e.type)).map((e=>e.widgets[0].value)).sort()}),this.addOutput("*","*"),this.onConnectionsChange=function(e,t,i,s,a){this.validateLinks(),2!=e||i?(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){i.widgets[0].value=e,i.onRename(),i.serialize()},this.onRename=function(e=0){const t=this.findSetter(i.graph);if(t){const i=t.inputs[0].type,s=t.inputs[0].name;this.setType(i,s),this.outputs[e].type=i,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=i.graph.links[e];t&&t.type!=this.outputs[0].type&&"*"!=t.type&&i.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 i=t.inputs[e];return this.graph.links[i.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"}}),pe.addEventListener("easyuse-global-seed",(function(e){let t=app.graph._nodes_by_id;for(let i in t){let s=t[i];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 Vi=pe.queuePrompt;pe.queuePrompt=async function(e,{output:t,workflow:i},s={}){i.seed_widgets={};for(let a in app.graph._nodes_by_id){let e=app.graph._nodes_by_id[a].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||(i.seed_widgets[a]=parseInt(t))}return await Vi.call(pe,e,{output:t,workflow:i},s)};const ji=["easy imageSave","easy fullkSampler","easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo","easy detailerFix"];ce.registerExtension({name:"Comfy.EasyUse.SaveImageExtraOutput",async beforeRegisterNodeDef(e,t,i){if(ji.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=()=>ge(i,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 Ui=["easy wildcards","easy positive","easy negative","easy stylesSelector","easy promptConcat","easy promptReplace"],Wi=["easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingDynamicCFG","easy preSamplingSdTurbo","easy preSamplingLayerDiffusion"],Fi=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo"],Xi=["easy controlnetLoader","easy controlnetLoaderADV"],Zi=["easy instantIDApply","easy instantIDApplyADV"],Hi=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition"],qi=["easy pipeIn","easy pipeOut","easy pipeEdit","easy pipeEditPrompt"],Yi=["easy XYPlot","easy XYPlotAdvanced"],Ki=["easy setNode"],Ji=["RescaleCFG","LoraLoaderModelOnly","LoraLoader","FreeU","FreeU_v2",...Hi,...Ki],Bi={"easy seed":{from:{INT:[...Wi,"easy fullkSampler"]}},"easy positive":{from:{STRING:[...Ui]}},"easy negative":{from:{STRING:[...Ui]}},"easy wildcards":{from:{STRING:["easy showAnything",...Ui]}},"easy stylesSelector":{from:{STRING:["easy showAnything",...Ui]}},"easy promptConcat":{from:{STRING:["easy showAnything",...Ui]}},"easy promptReplace":{from:{STRING:["easy showAnything",...Ui]}},"easy fullLoader":{from:{PIPE_LINE:[...Wi,"easy fullkSampler",...qi,...Ki],MODEL:Ji},to:{STRING:[...Ui]}},"easy a1111Loader":{from:{PIPE_LINE:[...Wi,...Xi,...Zi,...qi,...Ki],MODEL:Ji},to:{STRING:[...Ui]}},"easy comfyLoader":{from:{PIPE_LINE:[...Wi,...Xi,...Zi,...qi,...Ki],MODEL:Ji},to:{STRING:[...Ui]}},"easy hunyuanDiTLoader":{from:{PIPE_LINE:[...Wi,...Xi,...Zi,...qi,...Ki],MODEL:Ji},to:{STRING:[...Ui]}},"easy kolorsLoader":{from:{PIPE_LINE:[...Wi,...Xi,...Zi,...qi,...Ki],MODEL:Ji},to:{STRING:[...Ui]}},"easy pixArtLoader":{from:{PIPE_LINE:[...Wi,...Xi,...Zi,...qi,...Ki],MODEL:Ji},to:{STRING:[...Ui]}},"easy fluxLoader":{from:{PIPE_LINE:[...Wi,...Xi,...Zi,...qi,...Ki],MODEL:Ji},to:{STRING:[...Ui]}},"easy svdLoader":{from:{PIPE_LINE:["easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...qi,...Ki],MODEL:Ji},to:{STRING:[...Ui]}},"easy zero123Loader":{from:{PIPE_LINE:["easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...qi,...Ki],MODEL:Ji},to:{STRING:[...Ui]}},"easy sv3dLoader":{from:{PIPE_LINE:["easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...qi,...Ki],MODEL:Ji},to:{STRING:[...Ui]}},"easy preSampling":{from:{PIPE_LINE:[...Fi,...qi,...Xi,...Yi,...Ki]}},"easy preSamplingAdvanced":{from:{PIPE_LINE:[...Fi,...qi,...Xi,...Yi,...Ki]}},"easy preSamplingDynamicCFG":{from:{PIPE_LINE:[...Fi,...qi,...Xi,...Yi,...Ki]}},"easy preSamplingCustom":{from:{PIPE_LINE:[...Fi,...qi,...Xi,...Yi,...Ki]}},"easy preSamplingLayerDiffusion":{from:{PIPE_LINE:["easy kSamplerLayerDiffusion",...Fi,...qi,...Xi,...Yi,...Ki]}},"easy preSamplingNoiseIn":{from:{PIPE_LINE:[...Fi,...qi,...Xi,...Yi,...Ki]}},"easy fullkSampler":{from:{PIPE_LINE:[...qi.reverse(),"easy preDetailerFix","easy preMaskDetailerFix",...Wi,...Ki]}},"easy kSampler":{from:{PIPE_LINE:[...qi.reverse(),"easy preDetailerFix","easy preMaskDetailerFix","easy hiresFix",...Wi,...Ki]}},"easy controlnetLoader":{from:{PIPE_LINE:[...Wi,...Xi,...Zi,...qi,...Ki]}},"easy controlnetLoaderADV":{from:{PIPE_LINE:[...Wi,...Xi,...Zi,...qi,...Ki]}},"easy instantIDApply":{from:{PIPE_LINE:[...Wi,...Xi,...Zi,...qi,...Ki],MODEL:Ji},to:{COMBO:["easy promptLine"]}},"easy instantIDApplyADV":{from:{PIPE_LINE:[...Wi,...Xi,...Zi,...qi,...Ki],MODEL:Ji},to:{COMBO:["easy promptLine"]}},"easy ipadapterApply":{to:{COMBO:["easy promptLine"]}},"easy ipadapterApplyADV":{to:{STRING:["easy sliderControl",...Ui],COMBO:["easy promptLine"]}},"easy ipadapterStyleComposition":{to:{COMBO:["easy promptLine"]}},"easy preDetailerFix":{from:{PIPE_LINE:["easy detailerFix",...qi,...Ki]},to:{PIPE_LINE:["easy ultralyticsDetectorPipe","easy samLoaderPipe","easy kSampler","easy fullkSampler"]}},"easy preMaskDetailerFix":{from:{PIPE_LINE:["easy detailerFix",...qi,...Ki]}},"easy samLoaderPipe":{from:{PIPE_LINE:["easy preDetailerFix",...qi,...Ki]}},"easy ultralyticsDetectorPipe":{from:{PIPE_LINE:["easy preDetailerFix",...qi,...Ki]}},"easy cascadeLoader":{from:{PIPE_LINE:["easy fullCascadeKSampler","easy preSamplingCascade",...Xi,...qi,...Ki],MODEL:Ji.filter((e=>!Hi.includes(e)))}},"easy fullCascadeKSampler":{from:{PIPE_LINE:["easy preSampling","easy preSamplingAdvanced",...qi,...Ki]}},"easy preSamplingCascade":{from:{PIPE_LINE:["easy cascadeKSampler",...qi,...Ki]}},"easy cascadeKSampler":{from:{PIPE_LINE:["easy preSampling","easy preSamplingAdvanced",...qi,...Ki]}},"easy pipeEdit":{from:{PIPE_LINE:[...Wi,...Xi,...Zi,...Ki]},to:{PIPE_LINE:[...Wi,...Xi,...Zi,...qi,...Ki]}},"easy pipeEditPrompt":{from:{PIPE_LINE:[...Wi,...Xi,...Zi,...Ki]},to:{PIPE_LINE:[...Wi,...Xi,...Zi,...qi,...Ki]}}};class Qi extends Error{constructor(e="Attempted to access LGraph reference that was null or undefined.",t){super(e,{cause:t}),this.name="NullGraphError"}}ce.registerExtension({name:"Comfy.EasyUse.Suggestions",async setup(e){const t=LGraphCanvas.prototype.createDefaultNodeForSlot;LGraphCanvas.prototype.createDefaultNodeForSlot=function(e){var i;const s=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,position:[],nodeType:null,posAdd:[0,0],posSizeFix:[0,0]},e||{}),a=this,n=s.nodeFrom&&null!==s.slotFrom,o=!n&&s.nodeTo&&null!==s.slotTo,l=n?s.nodeFrom:s.nodeTo;if(!l||!Object.keys(Bi).includes(l.type))return t.call(this,e);if(!n&&!o)return!1;if(!s.nodeType)return!1;const r=n?s.nodeFrom:s.nodeTo;if(!r)throw new TypeError("nodeX was null when creating default node for slot.");const d=r.type;let u=n?s.slotFrom:s.slotTo,A=!1;switch(typeof u){case"string":A=n?r.findOutputSlot(u,!1):r.findInputSlot(u,!1),u=n?r.outputs[u]:r.inputs[u];break;case"object":if(null===u)return!1;A=n?r.findOutputSlot(u.name):r.findInputSlot(u.name);break;case"number":A=u,u=n?r.outputs[u]:r.inputs[u];break;default:return!1}var c=u.type==LiteGraph.EVENT?"_event_":u.type,p=n?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in;if(null==p?void 0:p[c]){let e=!1;const t=n?"from":"to";if(Bi[d]&&Bi[d][t]&&(null==(i=Bi[d][t][c])?void 0:i.length)>0){for(var h in Bi[d][t][c])if(s.nodeType==Bi[d][t][c][h]||"AUTO"==s.nodeType){e=Bi[d][t][c][h];break}}else if("object"==typeof p[c]||"array"==typeof p[c]){for(var h in p[c])if(s.nodeType==p[c][h]||"AUTO"==s.nodeType){e=p[c][h];break}}else s.nodeType!=p[c]&&"AUTO"!=s.nodeType||(e=p[c]);if(e){var m=!1;"object"==typeof e&&e.node&&(m=e,e=e.node);var f=LiteGraph.createNode(e);if(f){if(m){if(m.properties)for(var g in m.properties)f.addProperty(g,m.properties[g]);if(m.inputs)for(var g in f.inputs=[],m.inputs)f.addOutput(m.inputs[g][0],m.inputs[g][1]);if(m.outputs)for(var g in f.outputs=[],m.outputs)f.addOutput(m.outputs[g][0],m.outputs[g][1]);m.title&&(f.title=m.title),m.json&&f.configure(m.json)}a.graph.add(f),f.pos=[s.position[0]+s.posAdd[0]+(s.posSizeFix[0]?s.posSizeFix[0]*f.size[0]:0),s.position[1]+s.posAdd[1]+(s.posSizeFix[1]?s.posSizeFix[1]*f.size[1]:0)];const e={node:f,opts:s};if(!this.canvas.dispatchEvent(new CustomEvent("connect-new-default-node",{detail:e,cancelable:!0})))return!0;if(n){if(!s.nodeFrom)throw new TypeError("createDefaultNodeForSlot - nodeFrom was null");s.nodeFrom.connectByType(A,f,c)}else{if(!s.nodeTo)throw new TypeError("createDefaultNodeForSlot - nodeTo was null");s.nodeTo.connectByTypeOutput(A,f,c)}return!0}}}return!1};let i=LGraphCanvas.prototype.showConnectionMenu;LGraphCanvas.prototype.showConnectionMenu=function(e){var t;const s=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,e:void 0,allow_searchbox:this.allow_searchbox,showSearchBox:this.showSearchBox},e||{}),a=this,{graph:n}=this,{afterRerouteId:o}=s,l=s.nodeFrom&&s.slotFrom,r=!l&&s.nodeTo&&s.slotTo,d=l?s.nodeFrom:s.nodeTo;if(!d||!Object.keys(Bi).includes(d.type))return i.call(this,e);if(!l&&!r)return!1;const u=l?s.nodeFrom:s.nodeTo;if(!u)throw new TypeError("nodeX was null when creating default node for slot.");let A=l?s.slotFrom:s.slotTo,c=!1;switch(typeof A){case"string":c=l?u.findOutputSlot(A,!1):u.findInputSlot(A,!1),A=l?u.outputs[A]:u.inputs[A];break;case"object":if(null===A)return;c=l?u.findOutputSlot(A.name):u.findInputSlot(A.name);break;case"number":c=A,A=l?u.outputs[A]:u.inputs[A];break;default:return!1}const p=["Add Node","Add Reroute",null];s.allow_searchbox&&p.push("Search",null);var h=A.type==LiteGraph.EVENT?"_event_":A.type,m=l?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in,f=u.type;if(m&&m[h]){const e=l?"from":"to";if(Bi[f]&&Bi[f][e]&&(null==(t=Bi[f][e][h])?void 0:t.length)>0)for(var g in Bi[f][e][h])p.push(Bi[f][e][h][g]);else if("object"==typeof m[h]||"array"==typeof m[h])for(var g in m[h])p.push(m[h][g]);else p.push(m[h])}var v=new LiteGraph.ContextMenu(p,{event:s.e,extra:A,title:(A&&""!=A.name?A.name+(h?" | ":""):"")+(A&&h?h:""),callback:function(e,t,i){var r,d;switch(e){case"Add Node":LGraphCanvas.onMenuAdd(null,null,i,v,(function(e){var t,i;e&&(l?null==(t=s.nodeFrom)||t.connectByType(c,e,h,{afterRerouteId:o}):null==(i=s.nodeTo)||i.connectByTypeOutput(c,e,h,{afterRerouteId:o}))}));break;case"Add Reroute":const u=l?s.nodeFrom:s.nodeTo,p=t.extra;if(!n)throw new Qi;if(!u)throw new TypeError("Cannot add reroute: node was null");if(!p)throw new TypeError("Cannot add reroute: slot was null");if(!s.e)throw new TypeError("Cannot add reroute: CanvasPointerEvent was null");if(!u.connectFloatingReroute([s.e.canvasX,s.e.canvasY],p,o))throw new Error("Failed to create reroute");a.dirty_canvas=!0,a.dirty_bgcanvas=!0;break;case"Search":l?s.showSearchBox(i,{node_from:s.nodeFrom,slot_from:A,type_filter_in:h}):s.showSearchBox(i,{node_to:s.nodeTo,slot_from:A,type_filter_out:h});break;default:const m={position:[(null==(r=s.e)?void 0:r.canvasX)??0,(null==(d=s.e)?void 0:d.canvasY)??0],nodeType:e,afterRerouteId:o};a.createDefaultNodeForSlot(Object.assign(s,m))}}});return v}}}),ce.registerExtension({name:"Comfy.EasyUse.TimeTaken",setup(){let e=new Map,t=0;pe.addEventListener("execution_start",(e=>{graph&&graph._nodes.forEach((e=>{e.executionDuration&&delete e.executionDuration}))})),pe.addEventListener("executing",(i=>{if(!be("EasyUse.Nodes.Runtime",null))return;const s=(null==i?void 0:i.node)||(null==i?void 0:i.detail)||null,a=e.get(t);if(e.delete(t),t&&a){const e=Date.now()-a,i=bt(t);i&&(i.executionDuration||(i.executionDuration=0),i.executionDuration=i.executionDuration+e/1e3)}t=s,e.set(s,Date.now())}))},beforeRegisterNodeDef(e,t){const i=e.prototype.onDrawForeground;e.prototype.onDrawForeground=function(...e){const[t]=e;return function(e,t){if(!t)return;t=parseFloat(t).toFixed(3)+Le("s"),e.save(),e.fillStyle=LiteGraph.NODE_DEFAULT_BGCOLOR,function(e,t,i,s,a,n){e.beginPath(),e.moveTo(t+n,i),e.lineTo(t+s-n,i),e.arcTo(t+s,i,t+s,i+n,n),e.lineTo(t+s,i+a-n),e.arcTo(t+s,i+a,t+s-n,i+a,n),e.lineTo(t+n,i+a),e.arcTo(t,i+a,t,i+a-n,n),e.lineTo(t,i+n),e.arcTo(t,i,t+n,i,n),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,i,s,a="#000",n=12,o="Inter"){e.font=`${n}px ${o}`,e.fillStyle=a,e.fillText(t,i,s)}(e,t,8,-LiteGraph.NODE_TITLE_HEIGHT-6,LiteGraph.NODE_TITLE_COLOR),e.restore()}(t,this.executionDuration),null==i?void 0:i.apply(this,e)}}});let $i=null;ce.registerExtension({name:"Comfy.EasyUse.HotKeys",setup(){if(void 0!==L){L("up,down,left,right",(function(e,t){var i,s,a,n,o,l,r,d,u,A,c,p,h,m,f;e.preventDefault();if(!be("EasyUse.Hotkeys.JumpNearestNodes",null))return;const g=wt();if(0===g.length)return;const v=g[0];switch(t.key){case"up":case"left":let e=null;if(Et(v)){const e=null==(i=v.widgets_values)?void 0:i[0],t=null==(s=v.graph)?void 0:s._nodes,a=null==t?void 0:t.find((t=>{var i;if(Nt(t)){if((null==(i=t.widgets_values)?void 0:i[0])===e)return t}return null}));a&&St(a)}else if((null==(a=v.inputs)?void 0:a.length)>0){for(let t=0;t<v.inputs.length;t++)if(v.inputs[t].link){e=v.inputs[t].link;break}if(e){const t=null==(n=v.graph)?void 0:n.links;if(t[e]){const i=null==(o=t[e])?void 0:o.origin_id,s=null==(r=null==(l=v.graph)?void 0:l._nodes_by_id)?void 0:r[i];s&&St(s)}}}break;case"down":case"right":let t=null;if(Nt(v)){const e=null==(d=v.widgets_values)?void 0:d[0],t=null==(u=v.graph)?void 0:u._nodes,i=null==t?void 0:t.find((t=>{var i;if(Et(t)){if((null==(i=t.widgets_values)?void 0:i[0])===e)return t}return null}));i&&St(i)}else if((null==(A=v.outputs)?void 0:A.length)>0){for(let e=0;e<v.outputs.length;e++)if((null==(c=v.outputs[e].links)?void 0:c.length)>0&&v.outputs[e].links[0]){t=v.outputs[e].links[0];break}if(t){const e=null==(p=v.graph)?void 0:p.links;if(e[t]){const i=null==(h=e[t])?void 0:h.target_id,s=null==(f=null==(m=v.graph)?void 0:m._nodes_by_id)?void 0:f[i];s&&St(s)}}}}})),L("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(!be("EasyUse.Hotkeys.AlignSelectedNodes",null))return;const i=wt();if(i.length<=1)return;const s=i;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":Vt(s,"horizontal");break;case"shift+alt+ctrl+right":case"shift+alt+⌘+right":Vt(s,"vertical")}$i||($i=Ze()),$i&&$i.update()})),L("shift+⌘+left,shift+⌘+right,shift+ctrl+left,shift+ctrl+right",(function(e,t){e.preventDefault();if(!be("EasyUse.Hotkeys.NormalizeSelectedNodes",null))return;const i=wt();if(i.length<=1)return;const s=i;switch(t.key){case"shift+ctrl+left":case"shift+⌘+left":zt(s,"width");break;case"shift+ctrl+right":case"shift+⌘+right":zt(s,"height")}$i||($i=Ze()),$i&&$i.update()})),L("shift+g",(function(e,t){e.preventDefault();be("EasyUse.Hotkeys.AddGroup",null)&&(ts(),$i||($i=Ze()),$i&&$i.update())})),L("shift+r",(function(e,t){e.preventDefault();be("EasyUse.Hotkeys.cleanVRAMused",null)&&hi()})),L("shift+m",(function(e,t){var i,s,a;if(!be("EasyUse.Hotkeys.toggleNodesMap",null))return;let n=(null==(i=ce.extensionManager)?void 0:i.sidebarTab)||ce.extensionManager,o=(null==(s=ce.extensionManager.sidebarTab)?void 0:s.activeSidebarTabId)||(null==(a=ce.extensionManager)?void 0:a.activeSidebarTab);n.activeSidebarTabId=o==Oe?null:Oe}));const e=[];Array.from(Array(10).keys()).forEach((t=>e.push(`alt+${t}`))),L(e.join(","),(async function(e,t){e.preventDefault();if(!be("EasyUse.Hotkeys.NodesTemplate",null))return;const i=t.key;let s=parseInt(i.split("+")[1]);const a=await pe.getUserData("comfy.templates.json");let n=null;if(200==a.status)try{n=await a.json()}catch(l){Xe.error(Le("Get Node Templates File Failed"))}else localStorage["Comfy.NodeTemplates"]?n=JSON.parse(localStorage["Comfy.NodeTemplates"]):Xe.warn(Le("No Node Templates Found"));if(!n)return void Xe.warn(Le("No Node Templates Found"));s=0===s?9:s-1;const o=n[s];if(o)try{const e=(null==o?void 0:o.name)||"Group",t=(null==o?void 0:o.data)?JSON.parse(o.data):[];es((async()=>{await ve.registerFromWorkflow(t.groupNodes,{}),localStorage.litegrapheditor_clipboard=o.data,ce.canvas.pasteFromClipboard(),t.groupNodes||ts(e)}))}catch(l){Xe.error(l)}else Xe.warn(Le("Node template with {key} not set").replace("{key}",i))}));const t=async function(e){if(("b"===e.key||"m"==e.key)&&(e.metaKey||e.ctrlKey)){if(0===wt().length)return;$i||($i=Ze()),$i&&$i.update()}};window.addEventListener("keydown",t,!0)}}});const es=async e=>{const t=localStorage.litegrapheditor_clipboard;await e(),localStorage.litegrapheditor_clipboard=t},ts=e=>{const t=wt();if(0===t.length)return;const i=t;let s=new LiteGraph.LGraphGroup;s.title=e||"Group",((e,t=[],i=20)=>{var s,a,n,o,l,r,d,u,A,c;for(var p of(a=n=o=l=-1,r=d=u=A=-1,[e._nodes,t]))for(var h in p)r=(c=p[h]).pos[0],d=c.pos[1],u=c.pos[0]+c.size[0],A=c.pos[1]+c.size[1],"Reroute"!=c.type&&(d-=LiteGraph.NODE_TITLE_HEIGHT),(null==(s=c.flags)?void 0:s.collapsed)&&(A=d+LiteGraph.NODE_TITLE_HEIGHT,(null==c?void 0:c._collapsed_width)&&(u=r+Math.round(c._collapsed_width))),(-1==a||r<a)&&(a=r),(-1==n||d<n)&&(n=d),(-1==o||u>o)&&(o=u),(-1==l||A>l)&&(l=A);n-=Math.round(1.4*e.font_size),e.pos=[a-i,n-i],e.size=[o-a+2*i,l-n+2*i]})(s,i),ce.canvas.graph.add(s)},is="easy imageChooser",ss=e=>(null==e?void 0:e.comfyClass)===is;ce.registerExtension({name:"Comfy.EasyUse.imageChooser",setup(){const e=pe.interrupt;pe.interrupt=function(){var t;(null==(t=ce.graph)?void 0:t._nodes_by_id)&&(()=>{var e;Object.values(null==(e=ce.graph)?void 0:e._nodes_by_id).forEach((e=>{ss(e)&&e.cancelSelection("interrupt")}))})(),e.apply(this,arguments)},pe.addEventListener("easyuse-image-choose",(e=>{var t;const i=e.detail,s=ce.graph._nodes_by_id[i.id];if(!s||!ss(s))return;s.setExecutingState(!1),s.selected_images.clear(),s.anti_selected.clear(),s.isWaitingSelection=["Always Pause","Keep Last Selection"].includes(s.currentMode),s.isCanceling=!1,s.overIndex=null;const a=(null==(t=i.urls)?void 0:t.map(((e,t)=>({index:t,filename:e.filename,subfolder:e.subfolder,type:e.type}))))||[];s.imageData=a,s.imgs=[],a.forEach((e=>{const t=new Image;t.onload=()=>{ce.graph.setDirtyCanvas(!0)},t.src=`/view?filename=${encodeURIComponent(e.filename)}${(e=>`&type=${e.type}&subfolder=${e.subfolder}&rand=${e.random}`)(e)}`,s.imgs.push(t)})),s.update(),"Always Pause"===s.currentMode&&s.setExecutingState(!0)})),pe.addEventListener("easyuse-image-keep-selection",(e=>{const t=e.detail,i=ce.graph._nodes_by_id[t.id];i&&ss(i)&&(i.isWaitingSelection=!1,i.isCancelling=!1,t.selected&&Array.isArray(t.selected)&&(i.selected_images.clear(),t.selected.forEach((e=>{i.selected_images.add(e)}))),i.update())}))},beforeRegisterNodeDef(e,t){if(t.name==is){e.prototype.confirmSelection=function(){pe.fetchApi("/easyuse/image_chooser_message",{method:"POST",body:JSON.stringify({node_id:this.id.toString(),action:"select",selected:Array.from(this.selected_images)})}).catch((e=>{})).finally((e=>{this.isWaitingSelection=!1,this.update(),this.setExecutingState(!1)}))},e.prototype.cancelSelection=function(e){pe.fetchApi("/easyuse/image_chooser_message",{method:"POST",body:JSON.stringify({node_id:this.id.toString(),action:"cancel",selected:[]})}).catch((e=>{})).finally((e=>{this.isCanceling=!1,this.isWaitingSelection=!1,this.update(),this.setExecutingState(!1)}))},e.prototype.updateWidgets=function(){var e;if(!this.confirm_button_widget||!this.cancel_button_widget)return;const t=this.selected_images.size,i=(null==(e=this.imgs)?void 0:e.length)||0;if(this.isCanceling)this.confirm_button_widget.name=Le("Canceling"),this.cancel_button_widget.name="",this.confirm_button_widget.disabled=!0,this.cancel_button_widget.disabled=!0;else if(this.isWaitingSelection)t>0?(this.confirm_button_widget.name=t>1?`${Le("Progress selected")} (${t}/${i})`:`${Le("Progress selected image")}`,this.confirm_button_widget.disabled=!1):(this.confirm_button_widget.name=Le("Please select images to continue"),this.confirm_button_widget.disabled=!0),this.cancel_button_widget.name=Le("Cancel current run"),this.cancel_button_widget.disabled=!1;else{const e={"Always Pause":Le("Waiting for selection..."),"Keep Last Selection":Le("Using last selection")};this.confirm_button_widget.name=(t>0&&"Always Pause"==this.currentMode?Le("Please run first"):null==e?void 0:e[this.currentMode])||Le("Unknown Mode"),this.cancel_button_widget.name="",this.confirm_button_widget.disabled=!0,this.cancel_button_widget.disabled=!0}this.setDirtyCanvas(!0,!0)},e.prototype.serialize=function(){const e=LiteGraph.LGraphNode.prototype.serialize.call(this);return e.isWaitingSelection=this.isWaitingSelection,e.currentMode=this.currentMode,this.imageData&&this.imageData.length>0&&(e.imageData=this.imageData),this.selected_images&&this.selected_images.size>0&&(e.selected_images=Array.from(this.selected_images)),e.isExecuting=this.isExecuting||!1,e},e.prototype.configure=function(e){LiteGraph.LGraphNode.prototype.configure.call(this,e),this.isWaitingSelection=e.isWaitingSelection||!1,this.currentMode=e.currentMode||"Always Pause",this.imgs=[],this.updateWidgets()},e.prototype.setExecutingState=function(e){this.isExecuting=e,ce.graph&&ce.graph.setDirtyCanvas(!0,!1)};const t=e.prototype.update;e.prototype.update=function(){null==t||t.call(this,arguments),this.updateWidgets()};const i=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){null==i||i.call(this,arguments),this.selected_images=new Set,this.anti_selected=new Set,this.currentMode="Always Pause",this.isWaitingSelection=!1,this.isCanceling=!1,this.imageData=[],this.imgs,this.confirm_button_widget=this.addWidget("button","","",(()=>{this.confirmSelection()})),this.cancel_button_widget=this.addWidget("button","","",(()=>{this.cancelSelection()})),this.confirm_button_widget.serialize=!1,this.cancel_button_widget.serialize=!1,setTimeout((e=>{const t=ft(this,"mode");t.callback=e=>{requestAnimationFrame((t=>{this.currentMode=e,this.updateWidgets(),this.setDirtyCanvas(!0,!0)}))},this.currentMode=t.value||"Always Pause",this.updateWidgets()}),1),Object.defineProperty(this.confirm_button_widget,"clicked",{get:function(){return this._clicked},set:function(e){this._clicked=e&&""!=this.name}}),Object.defineProperty(this.cancel_button_widget,"clicked",{get:function(){return this._clicked},set:function(e){this._clicked=e&&""!=this.name}}),Object.defineProperty(this,"imageIndex",{get:function(){return null},set:function(e){this.overIndex=e}}),Object.defineProperty(this,"imagey",{get:function(){var e,t;return(null==(t=null==(e=this.widgets)?void 0:e[this.widgets.length-1])?void 0:t.last_y)+LiteGraph.NODE_WIDGET_HEIGHT},set:function(e){this.imagey=e}});const e=this.onMouseDown;this.onMouseDown=function(t,i,s){if(t.isPrimary){const e=as(this,i);e>=0&&this.toggleImageSelection(e)}return e&&e.apply(this,arguments)},this.update()},e.prototype.onDrawBackground,e.prototype.onDrawBackground=function(e){!function(e,t,i=0){var s,a;if(!e.imgs||!e.imgs.length)return;const n=ce.canvas,o=n.graph_mouse,l=15,r=e.size[0];let d=e.size[1]-i-l;d<200&&(d=200,requestAnimationFrame((t=>{e.size[1]=i+l+200})));if(null==e.imageIndex){let a,l,u,A;if(os(e.imgs))({cellWidth:a,cellHeight:l,cols:A,shiftX:u}=ls(e.imgs,r,d));else{const t=e.imgs.reduce(((e,t)=>Math.max(e,t.naturalWidth,t.naturalHeight)),0),i=[];i.length=null==(s=e.imgs)?void 0:s.length,i[0]={naturalWidth:t,naturalHeight:t},({cellWidth:a,cellHeight:l,cols:A,shiftX:u}=ls(i,r,d))}let c=!1,p=e.imgs.length;e.imageRects=[];for(let s=0;s<p;s++){e.imgs[s];const r=s%A*a+u,d=Math.floor(s/A)*l+i;if(!c&&(c=LiteGraph.isInsideRectangle(o[0],o[1],r+e.pos[0],d+e.pos[1],a,l),c)){e.overIndex=s;let i=110;n.pointer_is_down&&(e.pointerDown&&e.pointerDown.index===s||(e.pointerDown={index:s,pos:[...o]}),i=125),t.filter=`contrast(${i}%) brightness(${i}%)`,n.canvas.style.cursor="pointer"}e.imageRects.push([r,d,a,l])}}if(e.imageRects)for(let A=0;A<e.imgs.length;A++){t.fillStyle="#000",t.fillRect(...e.imageRects[A]);const i=e.imgs[A],s=e.imageRects[A][2],a=e.imageRects[A][3];let n=s/i.width,o=a/i.height;var u=Math.min(n,o);let l=u*i.height,r=u*i.width;const d=e.imageRects[A][0]+(s-r)/2,c=e.imageRects[A][1]+(a-l)/2,p=2;t.drawImage(i,d+p,c+p,r-2*p,l-2*p)}t.lineWidth=2,t.strokeStyle="green",e&&e.selected_images&&e.selected_images.forEach((i=>{ns(e,i,t)}));t.strokeStyle="#F88",null==(a=null==e?void 0:e.anti_selected)||a.forEach((i=>{ns(e,i,t)}))}(this,e,this.imagey||0)},e.prototype.toggleImageSelection=function(e){this.selected_images.has(e)?this.selected_images.delete(e):this.selected_images.add(e),this.update()}}}});const as=(e,t)=>{var i,s;if((null==(i=e.imgs)?void 0:i.length)>1)for(var a=0;a<e.imageRects.length;a++){const i=t[0]-e.imageRects[a][0],s=t[1]-e.imageRects[a][1];if(i>0&&i<e.imageRects[a][2]&&s>0&&s<e.imageRects[a][3])return a}else if(1==(null==(s=e.imgs)?void 0:s.length)&&t[1]>e.imagey)return 0;return-1};function ns(e,t,i){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]}i.strokeRect(s[0]+1,s[1]+1,s[2]-2,s[3]-2)}const os=e=>{if(!e.length||1===e.length)return!0;const t=e[0].naturalWidth/e[0].naturalHeight;for(let i=1;i<e.length;i++){if(t!=e[i].naturalWidth/e[i].naturalHeight)return!1}return!0};function ls(e,t,i){let s=0,a=e[0].naturalWidth,n=e[0].naturalHeight;const o=e.length;let l,r,d,u,A;for(let c=1;c<=o;c++){const e=Math.ceil(o/c),p=t/c,h=p/a,m=i/e/n,f=Math.min(h,m,1),g=a*f,v=n*f,y=g*v*o;y>s&&(s=y,l=g,r=v,d=c,u=e,A=c*((p-g)/2))}return{cellWidth:l,cellHeight:r,cols:d,rows:u,shiftX:A}}Number.prototype.div=function(e){return function(e,t){let i,s,a=0,n=0,o="string"==typeof e?e:e.toString(),l="string"==typeof t?t:t.toString();try{a=o.toString().split(".")[1].length}catch(r){}try{n=l.toString().split(".")[1].length}catch(r){}return i=Number(o.toString().replace(".","")),s=Number(l.toString().replace(".","")),i/s*Math.pow(10,n-a)}(this,e)};let rs=[],ds=0;const us={sd3:6.5,"sd3-turbo":4};class As extends me{constructor(){super(),this.lists=[],this.dialog_div=null,this.user_div=null}addItem(e,t){return he("div.easyuse-account-dialog-item",[he("input",{type:"text",placeholder:"Enter name",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);rs[t].name=e.target.value},value:rs[e].name}),he("input.key",{type:"text",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);rs[t].key=e.target.value},placeholder:"Enter APIKEY",value:rs[e].key}),he("button.choose",{textContent:Le("Choose"),onclick:async e=>{var i,s,a;const n=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);let o=rs[n].name,l=rs[n].key;if(!o)return void Xe.error(Le("Please enter the account name"));if(!l)return void Xe.error(Le("Please enter the APIKEY"));let r=!0;for(let t=0;t<rs.length;t++)if(!rs[t].key){r=!1;break}if(!r)return void Xe.error(Le("APIKEY is not Empty"));ds=n;const d=new FormData;d.append("api_keys",JSON.stringify(rs)),d.append("current",ds);const u=await pe.fetchApi("/easyuse/stability/set_api_keys",{method:"POST",body:d});if(200==u.status){const e=await u.json();if((null==e?void 0:e.account)&&(null==e?void 0:e.balance)){const n=(null==(i=e.account)?void 0:i.profile_picture)||null,o=(null==(s=e.account)?void 0:s.email)||null,l=(null==(a=e.balance)?void 0:a.credits)||0;t.replaceChildren(he("div.easyuse-account-user-info",{onclick:e=>{(new As).show(t)}},[he("div.user",[he("div.avatar",n?[he("img",{src:n})]:"😀"),he("div.info",[he("h5.name",o),he("h6.remark","Credits: "+l)])]),he("div.edit",{textContent:Le("Edit")})])),Xe.success(Le("Save Succeed"))}else Xe.success(Le("Save Succeed"));this.close()}else Xe.error(Le("Save Failed"))}}),he("button.delete",{textContent:Le("Delete"),onclick:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);rs.length<=1?Xe.error(Le("At least one account is required")):(rs.splice(t,1),this.dialog_div.removeChild(e.target.parentNode))}})])}show(e){rs.forEach(((t,i)=>{this.lists.push(this.addItem(i,e))})),this.dialog_div=he("div.easyuse-account-dialog",this.lists),super.show(he("div.easyuse-account-dialog-main",[he("div",[he("a",{href:"https://platform.stability.ai/account/keys",target:"_blank",textContent:Le("Getting Your APIKEY")})]),this.dialog_div]))}createButtons(){const e=super.createButtons();return e.unshift(he("button",{type:"button",textContent:Le("Save Account Info"),onclick:e=>{let t=!0;for(let i=0;i<rs.length;i++)if(!rs[i].key){t=!1;break}if(t){const e=new FormData;e.append("api_keys",JSON.stringify(rs)),pe.fetchApi("/easyuse/stability/set_api_keys",{method:"POST",body:e}).then((e=>{200==e.status?Xe.success(Le("Save Succeed")):Xe.error(Le("Save Failed"))}))}else Xe.error(Le("APIKEY is not Empty"))}})),e.unshift(he("button",{type:"button",textContent:Le("Add Account"),onclick:e=>{const t="Account "+rs.length.toString();rs.push({name:t,key:""});const i=this.addItem(rs.length-1);this.lists.push(i),this.dialog_div.appendChild(i)}})),e}}ce.registerExtension({name:"Comfy.EasyUse.API.SD3",async beforeRegisterNodeDef(e,t,i){if("easy stableDiffusion3API"==t.name){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=async function(){var e,i,s;t&&(null==t||t.apply(this,arguments));const a=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),n=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));let o=this.widgets.find((e=>"model"==e.name));o.callback=e=>{l.value="-"+us[e]};const l=this.addWidget("text","cost_credit","0",(e=>{}),{serialize:!1});l.disabled=!0,n&&setTimeout((e=>{"control before generate"==n.name&&0===a.value&&(a.value=Math.floor(4294967294*Math.random())),l.value="-"+us[o.value]}),100);let r=he("div.easyuse-account-user",[Le("Loading UserInfo...")]);this.addDOMWidget("account","btn",he("div.easyuse-account",r)),pe.addEventListener("stable-diffusion-api-generate-succeed",(async({detail:e})=>{var t;let i=r.querySelectorAll(".remark");if(i&&i[0]){const t=(null==e?void 0:e.model)?us[e.model]:0;if(t){let e=function(e,t){let i,s,a,n,o,l;o="string"==typeof e?e:e.toString(),l="string"==typeof t?t:t.toString();try{i=o.split(".")[1].length}catch(r){i=0}try{s=l.split(".")[1].length}catch(r){s=0}return a=Math.pow(10,Math.max(i,s)),n=i>=s?i:s,((e*a-t*a)/a).toFixed(n)}(parseFloat(i[0].innerText.replace(/Credits: /g,"")),t);e>0&&(i[0].innerText="Credits: "+e.toString())}}await je(1e4);const s=await pe.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;i&&i[0]&&(i[0].innerText="Credits: "+s)}}}));const d=await pe.fetchApi("/easyuse/stability/api_keys");if(200==d.status){let t=await d.json();if(rs=t.keys,ds=t.current,rs.length>0&&void 0!==ds){const t=rs[ds].key,a=rs[ds].name;if(t){const t=await pe.fetchApi("/easyuse/stability/user_info");if(200==t.status){const a=await t.json();if((null==a?void 0:a.account)&&(null==a?void 0:a.balance)){const t=(null==(e=a.account)?void 0:e.profile_picture)||null,n=(null==(i=a.account)?void 0:i.email)||null,o=(null==(s=a.balance)?void 0:s.credits)||0;r.replaceChildren(he("div.easyuse-account-user-info",{onclick:e=>{(new As).show(r)}},[he("div.user",[he("div.avatar",t?[he("img",{src:t})]:"😀"),he("div.info",[he("h5.name",n),he("h6.remark","Credits: "+o)])]),he("div.edit",{textContent:Le("Edit")})]))}}}else r.replaceChildren(he("div.easyuse-account-user-info",{onclick:e=>{(new As).show(r)}},[he("div.user",[he("div.avatar","😀"),he("div.info",[he("h5.name",a),he("h6.remark",Le("Click to set the APIKEY first"))])]),he("div.edit",{textContent:Le("Edit")})]))}}}}}});let cs=null;function ps(){cs&&(cs.removeEventListeners(),cs.dropdown.remove(),cs=null)}function hs(e,t,i,s=!1){ps(),new ms(e,t,i,s)}class ms{constructor(e,t,i,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=i,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),cs=this}buildNestedDropdown(e,t){let i=0;Object.keys(e).forEach((s=>{const a=e[s];if("object"==typeof a&&null!==a){const e=document.createElement("ul");e.setAttribute("role","listbox"),e.classList.add("easy-nested-dropdown");const n=document.createElement("li");n.classList.add("folder"),n.textContent=s,n.appendChild(e),n.addEventListener("mouseover",this.onMouseOver.bind(this,i,t)),t.appendChild(n),this.buildNestedDropdown(a,e),i+=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,i,t)),e.addEventListener("mousedown",this.onMouseDown.bind(this,s)),t.appendChild(e),i+=1}}))}addListItem(e,t,i){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)),i.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),i=t[this.selectedIndex];if(cs)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(),i&&i.classList.contains("folder")){const e=i.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(),i.classList.contains("item")&&(this.onSelect(t[this.selectedIndex].textContent),this.dropdown.remove(),this.removeEventListeners());const s=i.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 fs(e){const t=e.min||0,i=e.max||0,s=e.step||1;if(0===s)return[];const a=[];let n=t;for(;n<=i;){if(Number.isInteger(s))a.push(Math.round(n)+"; ");else{let e=n.toFixed(3);-0==e&&(e="0.000"),/\.\d{3}$/.test(e)||(e+="0"),a.push(e+"; ")}n+=s}return i>=0&&t>=0?a:a.reverse()}let gs={},vs={};function ys(e,t){String(e.id);const i=t.name,s=t.value.replace(/^(loader|preSampling):\s/,"");vs[i]?vs[i]!=gs[s]&&(vs[i]=gs[s]):vs={...vs,[i]:gs[s]}}ce.registerExtension({name:"Comfy.EasyUse.XYPlot",async beforeRegisterNodeDef(e,t,i){if("easy XYPlot"===t.name){gs=t.input.hidden.plot_dict[0];for(const e in gs){const t=gs[e];if(Array.isArray(t)){let i=[];for(const e of t)i.push(e+"; ");gs[e]=i}else gs[e]="object"==typeof t?"seed"==e?t+"; ":fs(t):t+"; "}gs.None=[],gs["---------------------"]=[]}},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 i=t.value;Object.defineProperty(t,"value",{get:()=>i,set(s){s!==i&&(i=s,ys(e,t))}})}}(e),function(e){if(e.widgets){const t=e.widgets.filter((e=>"customtext"===e.type&&!1!==e.dynamicPrompts||e.dynamicPrompts));for(const e of t){let t=function(e,t,s,a){return e&&(t[s]=e),t.map((e=>i(e,a))).filter((e=>""!==e)).join("")},i=function(e,t){if(e=s(e),a(e,t))return e+"; ";let i=n(e,t);return 1===i.length||2===i.length?i[0]:a(o(e),t)?o(e)+"; ":""},s=function(e){return e.replace(/(\n|;| )/g,"")},a=function(e,t){return t.includes(e+"; ")},n=function(e,t){return t.filter((t=>t.toLowerCase().includes(e.toLowerCase())))},o=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 i=e.name[0]+"_axis";let s=(null==vs?void 0:vs[i])||[];if(0===s.length)return;const a=e.inputEl.value,n=e.inputEl.selectionStart;let o=a.split("; ");const l=a.substring(0,n).split("; ").length-1,r=o[l].replace(/\n/g,"").toLowerCase(),d=s.filter((e=>e.toLowerCase().includes(r))).map((e=>e.replace(/; /g,"")));if(d.length>0)hs(e.inputEl,d,(i=>{const a=t(i,o,l,s);e.inputEl.value=a}));else{ps();const i=t(null,o,l,s);e.inputEl.value=i}};e.inputEl.removeEventListener("input",l),e.inputEl.addEventListener("input",l),e.inputEl.removeEventListener("mouseup",l),e.inputEl.addEventListener("mouseup",l)}}}(e))}}),S("domWidget",(()=>{const e=P(new Map);return{widgetStates:e,registerWidget:t=>{e.value.set(t.id,{widget:G(t),visible:!0,readonly:!1,zIndex:0,pos:[0,0],size:[0,0]})},unregisterWidget:t=>{e.value.delete(t)}}}));const bs={class:"w-full flex justify-between items-center"},ws={class:"flex justify-start items-center flex-1 gap-2"},_s={class:"flex justify-end items-center tool ml-2 position-relative"},Ss={__name:"promptAwait",props:["widget"],setup(e){const t=P({select:"now",unlock:!0,last_seed:0,seed:0}),i=P(!1),s=P(!1);let a=null;const n=()=>{if(s.value)return;const t=window.SpeechRecognition||window.webkitSpeechRecognition;t&&(s.value=!0,a||(a=new t,a.interimResults=!1),a.start(),a.addEventListener("result",(t=>{var i;const s=t.results[0][0].transcript;let a=null==(i=e.widget.value)?void 0:i.node,n=ft(a,"prompt");n&&(n.value+=s)})),a.addEventListener("end",(()=>{s.value=!1,a=null})),a.addEventListener("error",(e=>{})))},o=()=>{s.value&&a&&a.stop()};z((t=>e.widget.value),(e=>{t.value="object"==typeof e?e:JSON.parse(e)}),{immediate:!0}),V((s=>{pe.addEventListener("easyuse_prompt_await",(t=>{var s,a,n,o,l,d;const u=t.detail.id,A=-1!==(null==(s=e.widget.value)?void 0:s.node.id).toString().indexOf(":")?(null==(a=e.widget.value)?void 0:a.node.id).toString().split(":")[0]:null==(n=e.widget.value)?void 0:n.node.id;parseInt(u)===parseInt(A)&&(i.value=!0,r("last_seed",(null==(o=e.widget.value.value)?void 0:o.seed)||0),(null==(l=e.widget.value.value)?void 0:l.unlock)?r("seed",Math.floor(Math.random()*Ne)):r("seed",(null==(d=e.widget.value.value)?void 0:d.last_seed)||0))}));const a=pe.interrupt;pe.interrupt=function(){!i.value&&ce.runningNodeId||(l(JSON.stringify({result:-1,prompt:"",select:"now"}),!0),i.value=!1),a.apply(this,arguments)},e.widget.serializeValue=async({node:e},i)=>{try{let s=JSON.stringify(t.value);return(null==e?void 0:e.widgets_values)&&(e.widgets_values[i]=s,e.widgets[i].value=s),s}catch(s){return[]}}}));const l=(s,a)=>{var n,o,l,d,u,A,c,p,h;if(!i.value&&!a)return;const m=new FormData,f=null==(n=e.widget.value)?void 0:n.node,g=-1!==(null==(o=e.widget.value)?void 0:o.node.id).toString().indexOf(":")?(null==(l=e.widget.value)?void 0:l.node.id).toString().split(":")[0]:null==(d=e.widget.value)?void 0:d.node.id,v=(null==(u=ft(f,"prompt"))?void 0:u.value)||"";let y=null==(A=t.value)?void 0:A.select,b=(null==(c=t.value)?void 0:c.last_seed)||0,w=(null==(p=t.value)?void 0:p.seed)||0,_=(null==(h=t.value)?void 0:h.unlock)||!1;m.append("message",JSON.stringify({result:s,prompt:v,select:y,last_seed:b,seed:w,unlock:_})),m.append("id",g),i.value=!1,pe.fetchApi("/easyuse/message_callback",{method:"POST",body:m}).then((e=>{r("select","now")}))},r=(e,i)=>{t.value.value||(t.value={}),t.value[e]=i};return(e,a)=>(j(),U("div",bs,[W("div",ws,[F(X(x),{disabled:!Boolean(i.value),label:X(Le)("Continue"),size:"small",style:{height:"20px","font-size":"12px","white-space":"nowrap",padding:"0 8px"},onClick:a[0]||(a[0]=e=>l(1))},null,8,["disabled","label"]),F(X(x),{disabled:!Boolean(i.value),label:X(Le)("Stop"),severity:"danger",size:"small",style:{height:"20px","font-size":"12px","white-space":"nowrap",padding:"0 8px"},onClick:a[1]||(a[1]=e=>l(-1))},null,8,["disabled","label"]),F(X(k),{class:"easyuse-prompt-await-select",modelValue:t.value.select,"onUpdate:modelValue":a[2]||(a[2]=e=>t.value.select=e),options:[{name:X(Le)("now"),value:"now"},{name:X(Le)("prev"),value:"prev"}],optionLabel:"name",optionValue:"value",size:"small",style:{flex:"1",height:"24px","line-height":"10px","min-width":"70px","max-width":"100px"}},null,8,["modelValue","options"])]),W("div",_s,[Z(F(X(x),{style:{"--p-button-sm-font-size":"11px"},size:"small",icon:t.value.unlock?"pi pi-unlock":"pi pi-lock",severity:t.value.unlock?"contrast":"warn",variant:"text",onClick:a[3]||(a[3]=e=>t.value.unlock=!t.value.value.unlock),rounded:""},null,8,["icon","severity"]),[[X(E),{value:t.value.unlock?"随机种子":"锁定种子值",class:"jm-tooltip"},"top"]]),s.value?Z((j(),H(X(x),{key:0,size:"small",icon:"pi pi-pause-circle",severity:"info",variant:"outlined",onClick:o,rounded:""},null,512)),[[X(E),{value:X(Le)("Stop Recording"),class:"jm-tooltip"},"top"]]):Z((j(),H(X(x),{key:1,size:"small",icon:"pi pi-microphone",severity:"contrast",variant:"text",onClick:n,rounded:""},null,512)),[[X(E),{value:X(Le)("Voice input"),class:"jm-tooltip"},"top"]])])]))}},Ls={class:"easyuse-multiselect"},xs={__name:"multiSelectWidget",props:["widget"],setup(e){var t,i,s,a;const n=Object.keys(Ie).reduce(((e,t)=>(Array.isArray(Ie[t])?e[t]=Ie[t].map(((e,t)=>({label:e,value:t}))):"object"==typeof Ie[t]?e[t]=Object.entries(Ie[t]).map((([e,t])=>({label:e,value:t}))):e[t]=[],e)),{}),o=P([]),l=e.widget.inputSpec,r=(null==(t=null==l?void 0:l.multi_select)?void 0:t.max_selected_labels)??3,d=(null==l?void 0:l.optionLabel)??"label",u=(null==l?void 0:l.optionValue)??"value",A=(null==(i=null==l?void 0:l.multi_select)?void 0:i.placeholder)?Le(null==(s=l.multi_select)?void 0:s.placeholder):Le("select items"),c=(null==(a=null==l?void 0:l.multi_select)?void 0:a.chip)?"chip":"comma",p=P((null==l?void 0:l.options)??[]),h=e=>{e&&n[e]?p.value=n[e].map(((e,t)=>({label:Le(e.label),value:e.value}))):p.value=[]};return z((t=>e.widget.value),(e=>{o.value=e.split(",").map((e=>e&&parseInt(e.trim())))})),V((t=>{setTimeout((t=>{const i=ft(e.widget.node,"method");h(i.value),i.callback=e=>{o.value=[],h(e)}}),1),e.widget.serializeValue=async({node:e},t)=>{try{let i=o.value||[];return i=i.join(","),(null==e?void 0:e.widgets_values)&&(e.widgets_values[t]=i,e.widgets[t].value=i),i}catch(i){return[]}}})),(e,t)=>(j(),U("div",Ls,[F(X(N),{modelValue:o.value,"onUpdate:modelValue":t[0]||(t[0]=e=>o.value=e),options:p.value,optionLabel:X(d),optionValue:X(u),appendTo:"self",filter:"",placeholder:X(A),"max-selected-labels":X(r),display:X(c),class:"w-full easyuse-multiselect-container"},null,8,["modelValue","options","optionLabel","optionValue","placeholder","max-selected-labels","display"])]))}},ks={class:"flex flex-col easyuse-multiangle-widget"},Es={class:"easyuse-multiangle-tabs flex items-center gap-1 px-1 relative z-10 overflow-x-auto no-scrollbar w-full min-w-0"},Ns=["onClick"],Cs={class:"tab-number"},Is=["onClick"],Ts=["title"],Os={class:"easyuse-multiangle-content flex flex-col gap-2"},Ms=["title"],Ds={class:"settings-item flex items-center"},Rs={for:"add-angle-prompt",class:"whitespace-nowrap"},Ps={class:"settings-item flex items-center"},Gs={for:"hollow-mode",class:"whitespace-nowrap"},zs={class:"settings-item flex items-center"},Vs={for:"rotate-3d-mode",class:"whitespace-nowrap"},js=["title"],Us=["onDblclick"],Ws={key:0},Fs={key:0,style:{filter:"grayscale(10)"}},Xs={key:0,class:"absolute inset-0 flex flex-col items-center justify-center",style:{"pointer-events":"none"}},Zs={key:1,class:"easyuse-cube-face-label"},Hs={class:"flex flex-col gap-2 px-2 w-full easyuse-mulitangle-slider"},qs={class:"flex flex-col gap-2 w-full"},Ys={class:"flex justify-between items-center"},Ks={class:"font-semibold opacity-80"},Js={class:"font-mono text-primary font-bold"},Bs={class:"flex flex-col gap-2 w-full"},Qs={class:"flex justify-between items-center"},$s={class:"font-semibold opacity-80"},ea={class:"font-mono text-primary font-bold"},ta={class:"flex flex-col gap-2 w-full"},ia={class:"flex justify-between items-center"},sa={class:"font-semibold opacity-80"},aa={class:"font-mono text-primary font-bold"},na={__name:"multiAngleWidget",props:["widget"],emits:["update:value","change"],setup(e,{emit:t}){const i=P([{rotate:0,vertical:0,zoom:5,add_angle_prompt:!1}]),s=P(0),a=i.value[s.value]||{rotate:0,vertical:0,zoom:5,add_angle_prompt:!1},n=P(a.rotate??0),o=P(a.vertical??0),l=P(a.zoom??5),r=P(a.add_angle_prompt??!1),d=P(be("EasyUse.MultiAngle.HollowMode")||!1),u=P(be("EasyUse.MultiAngle.3DRotate")||!1),A=P(!1),c=()=>{A.value=!A.value},p=()=>{A.value&&(A.value=!1)};V((()=>{window.addEventListener("click",p)})),q((()=>{window.removeEventListener("click",p),x()})),z((t=>e.widget.value),(e=>{Array.isArray(e)?i.value=e:i.value=JSON.parse(e)}),{immediate:!0}),z((()=>{var e;return null==(e=i.value)?void 0:e[s.value]}),(e=>{if(e){let t=be("EasyUse.MultiAngle.AddAnglePrompt")??!1;void 0!==e.rotate&&(n.value=e.rotate),void 0!==e.vertical&&(o.value=e.vertical),void 0!==e.zoom&&(l.value=e.zoom),null!=r&&(r.value=t)}}),{deep:!0}),z(d,(e=>{_e("EasyUse.MultiAngle.HollowMode",e)})),z(u,(e=>{_e("EasyUse.MultiAngle.InvertRotate",e)})),z(r,(e=>{_e("EasyUse.MultiAngle.AddAnglePrompt",e),i.value.forEach((t=>{t.add_angle_prompt=e}))}));const h=e=>{s.value=e;const t=i.value[e];t&&(n.value=t.rotate??0,o.value=t.vertical??0,l.value=t.zoom??5,r.value=t.add_angle_prompt??!0)},m=()=>{i.value[s.value];const e={rotate:n.value,vertical:o.value,zoom:l.value,add_angle_prompt:r.value};i.value.push(JSON.parse(JSON.stringify(e))),s.value=i.value.length-1,h(s.value)},f=(e=!1)=>{e&&(A.value=!1);const t={rotate:n.value,vertical:o.value,zoom:l.value,add_angle_prompt:r.value};Array.isArray(i.value)||(i.value=[]),i.value[s.value]=JSON.parse(JSON.stringify(t))},g=()=>{n.value=0,o.value=0,l.value=5,f()},v=Y((()=>[{name:"front",text:"",style:{transform:"translateZ(40px)"}},{name:"back",text:Le("B"),style:{transform:"rotateY(180deg) translateZ(40px)"}},{name:"up",text:Le("U"),style:{transform:"rotateX(90deg) translateZ(40px)"}},{name:"down",text:Le("D"),style:{transform:"rotateX(-90deg) translateZ(40px)"}},{name:"left",text:Le("L"),style:{transform:"rotateY(-90deg) translateZ(40px)"}},{name:"right",text:Le("R"),style:{transform:"rotateY(90deg) translateZ(40px)"}},{name:"center",style:{transform:"translateZ(0.1px)",border:"none",background:"transparent",backfaceVisibility:"hidden"}},{name:"center-back",style:{transform:"rotateY(180deg) translateZ(0.1px)",border:"none",backfaceVisibility:"hidden",background:"transparent"}}])),y=P(!1),b={x:0,y:0},w={rotate:0,vertical:0},_=e=>{const t=e.deltaY;let i=l.value-.05*t;i=Math.max(0,Math.min(10,i)),l.value=Math.round(10*i)/10,f()},S=e=>{y.value=!0,b.x=e.clientX??e.touches[0].clientX,b.y=e.clientY??e.touches[0].clientY,w.rotate=n.value,w.vertical=o.value,window.addEventListener("mousemove",L),window.addEventListener("mouseup",x),window.addEventListener("touchmove",L),window.addEventListener("touchend",x)},L=e=>{if(!y.value)return;const t=e.clientX??e.touches[0].clientX,i=e.clientY??e.touches[0].clientY;let s=t-b.x,a=i-b.y;u.value&&(s=-s,a=-a);let l=w.rotate+.5*s,r=w.vertical+.5*a;l=(l%360+360)%360,r=Math.max(-90,Math.min(90,r)),n.value=Math.round(l),o.value=Math.round(r),f()},x=()=>{y.value=!1,window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",x),window.removeEventListener("touchmove",L),window.removeEventListener("touchend",x)},k=Y((()=>({transform:`scale(${1+.1*l.value}) rotateX(${-o.value}deg) rotateY(${-n.value}deg)`})));return V((t=>{d.value=be("EasyUse.MultiAngle.HollowMode"),u.value=be("EasyUse.MultiAngle.InvertRotate"),r.value=be("EasyUse.MultiAngle.AddAnglePrompt")||!1,e.widget.serializeValue=async({node:e},t)=>{try{let s=JSON.stringify(i.value);return(null==e?void 0:e.widgets_values)&&(e.widgets_values[t]=s,e.widgets[t].value=s),s}catch(s){return[]}}})),(e,t)=>(j(),U("div",ks,[W("div",Es,[(j(!0),U(K,null,J(i.value,((e,t)=>(j(),U("div",{key:t,class:B(["tab-item whitespace-nowrap flex-shrink-0",{active:s.value===t}]),onClick:e=>h(t)},[W("span",Cs,ee(t+1),1),i.value.length>1&&0!==t?(j(),U("i",{key:0,class:"pi pi-times tab-close",onClick:Q((e=>(e=>{i.value.length<=1||(i.value.splice(e,1),s.value>=i.value.length&&(s.value=i.value.length-1),h(s.value))})(t)),["stop"])},null,8,Is)):te("",!0)],10,Ns)))),128)),W("button",{class:"tab-add-btn flex-shrink-0",onClick:m,title:X(Le)("Add New Tab")},t[10]||(t[10]=[W("i",{class:"pi pi-plus"},null,-1)]),8,Ts)]),W("div",Os,[W("div",{class:B(["easyuse-multiangle-cube w-full flex items-center justify-center bg-black overflow-hidden select-none",{"is-hollow":d.value}]),onMousedown:S,onTouchstart:S,onWheel:Q(_,["prevent"])},[W("div",{class:"settings-icon",onMousedown:t[5]||(t[5]=Q((()=>{}),["stop"])),onClick:Q(c,["stop"]),title:X(Le)("Settings")},[t[11]||(t[11]=W("i",{class:"pi pi-cog"},null,-1)),A.value?(j(),U("div",{key:0,class:"settings-dropdown",onClick:t[4]||(t[4]=Q((()=>{}),["stop"]))},[W("div",Ds,[Z(W("input",{type:"checkbox","onUpdate:modelValue":t[0]||(t[0]=e=>r.value=e),onChange:t[1]||(t[1]=e=>f(!1)),id:"add-angle-prompt"},null,544),[[$,r.value]]),W("label",Rs,ee(X(Le)("Angle Prompt")),1)]),W("div",Ps,[Z(W("input",{type:"checkbox","onUpdate:modelValue":t[2]||(t[2]=e=>d.value=e),id:"hollow-mode"},null,512),[[$,d.value]]),W("label",Gs,ee(X(Le)("Hollow")),1)]),W("div",zs,[Z(W("input",{type:"checkbox","onUpdate:modelValue":t[3]||(t[3]=e=>u.value=e),id:"rotate-3d-mode"},null,512),[[$,u.value]]),W("label",Vs,ee(X(Le)("Invert Rotate Mode")),1)])])):te("",!0)],40,Ms),W("div",{class:"reset-icon",onMousedown:t[6]||(t[6]=Q((()=>{}),["stop"])),onClick:Q(g,["stop"]),title:X(Le)("Reset")},t[12]||(t[12]=[W("i",{class:"pi pi-refresh"},null,-1)]),40,js),W("div",{class:"relative transition-transform duration-75 ease-out",style:ie([{"transform-style":"preserve-3d",width:"80px",height:"80px"},k.value])},[(j(!0),U(K,null,J(v.value,(e=>(j(),U("div",{key:e.name,class:"absolute flex items-center justify-center font-bold text-xs easyuse-multiangle-cube-face",style:ie([{width:"80px",height:"80px","backface-visibility":"visible"},e.style]),onDblclick:Q((t=>(e=>{switch(e){case"front":n.value=0;break;case"back":n.value=180;break;case"left":n.value=270;break;case"right":n.value=90;break;case"up":o.value=90;break;case"down":o.value=-90}f()})(e.name)),["stop"])},["center"===e.name?(j(),U(K,{key:0},[d.value?(j(),U("div",Ws,t[13]||(t[13]=[W("div",{style:{"font-size":"20px","text-align":"center"}},"🤓",-1),W("div",{style:{"font-size":"12px","text-align":"center","margin-top":"-6px"}},"👕",-1),W("div",{style:{"font-size":"12px","text-align":"center","margin-top":"-6px"}},"👖",-1)]))):te("",!0)],64)):"center-back"===e.name?(j(),U(K,{key:1},[d.value?(j(),U("div",Fs,t[14]||(t[14]=[W("div",{style:{"font-size":"20px","text-align":"center"}},"🌕",-1),W("div",{style:{"font-size":"12px","text-align":"center","margin-top":"-6px"}},"👕",-1),W("div",{style:{"font-size":"12px","text-align":"center","margin-top":"-6px"}},"👖",-1)]))):te("",!0)],64)):(j(),U(K,{key:2},["front"!==e.name||d.value?te("",!0):(j(),U("div",Xs,t[15]||(t[15]=[W("div",{style:{"font-size":"20px","text-align":"center"}},"🤓",-1),W("div",{style:{"font-size":"12px","text-align":"center","margin-top":"-6px"}},"👕",-1),W("div",{style:{"font-size":"12px","text-align":"center","margin-top":"-6px"}},"👖",-1)]))),e.text?(j(),U("div",Zs,ee(e.text),1)):te("",!0)],64))],44,Us)))),128))],4)],34),W("div",Hs,[W("div",qs,[W("div",Ys,[W("span",Ks,ee(X(Le)("Rotate")),1),W("span",Js,ee(n.value)+"°",1)]),F(X(C),{modelValue:n.value,"onUpdate:modelValue":[t[7]||(t[7]=e=>n.value=e),f],min:0,max:360,class:"w-full"},null,8,["modelValue"])]),W("div",Bs,[W("div",Qs,[W("span",$s,ee(X(Le)("Vertical")),1),W("span",ea,ee(o.value)+"°",1)]),F(X(C),{modelValue:o.value,"onUpdate:modelValue":[t[8]||(t[8]=e=>o.value=e),f],min:-90,max:90,class:"w-full"},null,8,["modelValue"])]),W("div",ta,[W("div",ia,[W("span",sa,ee(X(Le)("Zoom")),1),W("span",aa,ee(l.value),1)]),F(X(C),{modelValue:l.value,"onUpdate:modelValue":[t[9]||(t[9]=e=>l.value=e),f],min:0,max:10,step:.1,class:"w-full"},null,8,["modelValue"])])])])]))}},oa=(e,t)=>{const i=e.__vccOpts||e;for(const[s,a]of t)i[s]=a;return i},la={class:"relative rounded-t-lg overflow-hidden select-none"},ra={key:1,class:"w-full h-full flex items-center justify-center"},da=oa({__name:"baseThumbnail",props:{hoverZoom:{type:"number",default:4},isHovered:{type:Boolean,default:!1}},setup(e){const t=P(!1),i=P(null);return V((()=>{var e;Array.from((null==(e=i.value)?void 0:e.getElementsByTagName("img"))??[]).forEach((e=>{le(e,"error",(()=>{t.value=!0}))}))})),(s,a)=>(j(),U("div",la,[t.value?(j(),U("div",ra,a[0]||(a[0]=[W("i",{class:"pi pi-file text-4xl"},null,-1)]))):(j(),U("div",{key:0,ref_key:"contentRef",ref:i,class:"w-full h-full transform-gpu transition-transform duration-1000 ease-out",style:ie(e.isHovered?{transform:`scale(${1+e.hoverZoom/100})`}:void 0)},[se(s.$slots,"default",{},void 0,!0)],4))]))}},[["__scopeId","data-v-604a4248"]]),ua=["src","alt"],Aa=oa({__name:"lazyImage",props:{src:{type:String,required:!0},alt:{type:String,default:""},imageClass:{type:[String,Array,Object],default:""},imageStyle:{type:[String,Object],default:()=>({})},placeholderClass:{type:[String,Array,Object],default:""},errorClass:{type:[String,Array,Object],default:""},rootMargin:{type:String,default:"50px"},threshold:{type:Number,default:.1},immediate:{type:Boolean,default:!1}},emits:["load","error","visible"],setup(e,{emit:t}){const i=e,s=t,a=P(null),n=P(i.immediate),o=P(!1),l=P(!1),r=Y((()=>i.src));z((()=>i.src),(()=>{o.value=!1,l.value=!1,i.immediate||(n.value=!1)}),{immediate:!0});const{stop:d}=re(a,(([e])=>{(null==e?void 0:e.isIntersecting)&&!n.value&&(n.value=!0,s("visible"),d())}),{rootMargin:i.rootMargin,threshold:i.threshold}),u=e=>{o.value=!0,l.value=!1,s("load",e)},A=e=>{l.value=!0,o.value=!1,s("error",e)};return(t,i)=>(j(),U("div",{ref_key:"containerRef",ref:a,class:"lazy-image-container"},[l.value?(j(),U("div",{key:0,class:B(["lazy-image-error","w-full h-full flex items-center justify-center bg-surface-100 dark:bg-surface-800",e.errorClass])},[se(t.$slots,"error",{},(()=>[i[0]||(i[0]=W("i",{class:"pi pi-exclamation-triangle text-2xl text-surface-400"},null,-1))]),!0)],2)):n.value&&r.value?(j(),U("img",{key:1,src:r.value,alt:e.alt,class:B(e.imageClass),style:ie(e.imageStyle),draggable:"false",onLoad:u,onError:A},null,46,ua)):n.value?te("",!0):(j(),U("div",{key:2,class:B(["lazy-image-placeholder","w-full h-full flex items-center justify-center bg-surface-100 dark:bg-surface-800",e.placeholderClass])},[se(t.$slots,"placeholder",{},(()=>[i[1]||(i[1]=W("i",{class:"pi pi-image text-2xl text-surface-400"},null,-1))]),!0)],2))],512))}},[["__scopeId","data-v-4bfc03bf"]]),ca={class:"overflow-hidden w-full h-full flex items-center justify-center"},pa={__name:"defaultThumbnail",props:{src:{type:String,required:!0},alt:{type:String,required:!0},hoverZoom:{type:Number,required:!0},isHovered:{type:Boolean,default:!1},isVideo:{type:Boolean,default:!1},rootMargin:{type:String,default:"50px"},threshold:{type:Number,default:.1},immediate:{type:Boolean,default:!1}},emits:["load","error","visible"],setup(e,{emit:t}){const i=e,{src:s,isVideo:a}=i;return a??(null==s||s.toLowerCase().endsWith(".webp")),(t,i)=>(j(),H(da,{"hover-zoom":e.hoverZoom,"is-hovered":e.isHovered},{default:ae((()=>[W("div",ca,[F(Aa,{src:X(s),"image-class":["transform-gpu transition-transform duration-300 ease-out","w-full h-full object-cover"],"image-style":e.isHovered?{transform:`scale(${1+e.hoverZoom/100})`}:void 0,"root-margin":e.rootMargin,threshold:e.threshold,immediate:e.immediate,onLoad:i[0]||(i[0]=e=>t.$emit("load",e)),onError:i[1]||(i[1]=e=>t.$emit("error",e)),onVisible:i[2]||(i[2]=e=>t.$emit("visible",e))},{placeholder:ae((()=>[se(t.$slots,"placeholder",{},(()=>[i[3]||(i[3]=W("i",{class:"pi pi-image text-2xl text-surface-400"},null,-1))]))])),error:ae((()=>[se(t.$slots,"error",{},(()=>[i[4]||(i[4]=W("i",{class:"pi pi-exclamation-triangle text-2xl text-surface-400"},null,-1))]))])),_:3},8,["src","image-style","root-margin","threshold","immediate"])])])),_:3},8,["hover-zoom","is-hovered"]))}},ha={class:"overflow-hidden w-full h-full flex items-center justify-center relative"},ma={__name:"compareSliderThumbnail",props:{baseImageSrc:{type:String,required:!0},overlayImageSrc:{type:String,required:!0},alt:{type:String,required:!0},isHovered:{type:Boolean,default:!1},isVideo:{type:Boolean,default:!1},rootMargin:{type:String,default:"50px"},threshold:{type:Number,default:.1},immediate:{type:Boolean,default:!1}},emits:["load","error","visible"],setup(e,{emit:t}){var i,s;const a=e;a.isVideo||(null==(i=a.baseImageSrc)?void 0:i.toLowerCase().endsWith(".webp"))||null==(s=a.overlayImageSrc)||s.toLowerCase().endsWith(".webp");const n=P(50),o=P(null),{elementX:l,elementWidth:r,isOutside:d}=de(o);return z([()=>a.isHovered,l,r,d],(([e,t,i,s])=>{e&&(s||(n.value=t/i*100))})),(t,i)=>(j(),H(da,{"is-hovered":e.isHovered},{default:ae((()=>[W("div",ha,[F(Aa,{src:e.baseImageSrc,"image-class":["transform-gpu transition-transform duration-300 ease-out","w-full h-full object-cover block"],"root-margin":e.rootMargin,threshold:e.threshold,immediate:e.immediate,onLoad:i[0]||(i[0]=e=>t.$emit("load",e)),onError:i[1]||(i[1]=e=>t.$emit("error",e)),onVisible:i[2]||(i[2]=e=>t.$emit("visible",e))},{placeholder:ae((()=>[se(t.$slots,"placeholder",{},(()=>[i[3]||(i[3]=W("i",{class:"pi pi-image text-2xl text-surface-400"},null,-1))]))])),error:ae((()=>[se(t.$slots,"error",{},(()=>[i[4]||(i[4]=W("i",{class:"pi pi-exclamation-triangle text-2xl text-surface-400"},null,-1))]))])),_:3},8,["src","root-margin","threshold","immediate"]),W("div",{ref_key:"containerRef",ref:o,class:"absolute inset-0"},[F(Aa,{src:e.overlayImageSrc,"image-class":["transform-gpu transition-transform duration-300 ease-out","w-full h-full object-cover block"],"image-style":{clipPath:`inset(0 ${100-n.value}% 0 0)`},"root-margin":e.rootMargin,threshold:e.threshold,immediate:e.immediate},{placeholder:ae((()=>[se(t.$slots,"placeholder",{},(()=>[i[5]||(i[5]=W("i",{class:"pi pi-image text-2xl text-surface-400"},null,-1))]))])),error:ae((()=>[se(t.$slots,"error",{},(()=>[i[6]||(i[6]=W("i",{class:"pi pi-exclamation-triangle text-2xl text-surface-400"},null,-1))]))])),_:3},8,["src","image-style","root-margin","threshold","immediate"]),W("div",{class:"absolute inset-y-0 bg-white/30 backdrop-blur-sm z-10 pointer-events-none",style:ie({left:`${n.value}%`,width:"1px"})},null,4)],512)])])),_:3},8,["is-hovered"]))}},fa={class:"selector-card-wrapper"},ga={class:"card-image-container"},va={key:2,class:"selection-badge"},ya={class:"card-content"},ba={class:"card-title"},wa=oa({__name:"selectorCard",props:{item:{type:Object,required:!0},uniqueKey:{type:String,default:"id"},selectable:{type:Boolean,default:!1},isSelected:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},showDescription:{type:Boolean,default:!0},showMeta:{type:Boolean,default:!1},showActions:{type:Boolean,default:!1},actions:{type:Array,default:()=>[]},itemFields:{type:Object,default:()=>({id:"id",title:"title",description:"description",image:"image",meta:"meta"})},locale:{type:String,default:"en"}},emits:["select","action","item-hover","item-leave"],setup(e,{emit:t}){const i=e,s=t,a=P(null),n=ue(a),o=()=>{i.selectable&&s("select",i.item)},l=()=>{s("item-hover",i.item)},r=()=>{s("item-leave",i.item)};return(t,i)=>(j(),U("div",fa,[W("div",{ref_key:"cardRef",ref:a,class:B(["card-item",{selected:e.isSelected,clickable:e.selectable}]),onClick:o,onMouseenter:l,onMouseleave:r},[W("div",ga,["compareSlider"===e.item.thumbnailVariant?(j(),H(ma,{key:0,"base-image-src":e.item.thumbnail[0],"overlay-image-src":e.item.thumbnail[1],alt:t.title,"is-hovered":X(n),"is-video":"video"===e.item.mediaType||"webp"===e.item.mediaSubtype,class:"card-image"},null,8,["base-image-src","overlay-image-src","alt","is-hovered","is-video"])):(j(),H(pa,{key:1,src:e.item.thumbnail||"",alt:"zh"==e.locale?e.item.name_cn:e.item.name,"hover-zoom":4,"is-hovered":!1,class:"card-image"},null,8,["src","alt"])),e.selectable&&e.isSelected?(j(),U("div",va,i[0]||(i[0]=[W("i",{class:"pi pi-check text-white"},null,-1)]))):te("",!0)]),W("div",ya,[W("div",ba,ee("zh"==e.locale?e.item.name_cn:e.item.name),1)])],34)]))}},[["__scopeId","data-v-88af28b0"]]),_a={class:"list-item"},Sa=["name","checked"],La={class:"list-item-content"},xa={class:"list-title"},ka=oa({__name:"selectorList",props:{item:{type:Object,required:!0},uniqueKey:{type:String,default:"id"},selectable:{type:Boolean,default:!1},isSelected:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},showDescription:{type:Boolean,default:!0},showActions:{type:Boolean,default:!1},actions:{type:Array,default:()=>[]},itemFields:{type:Object,default:()=>({id:"id",title:"title",description:"description"})},locale:{type:String,default:"en"}},emits:["select","action","item-hover","item-leave"],setup(e,{emit:t}){const i=e,s=t,a=()=>{i.selectable&&s("select",i.item)},n=()=>{s("item-hover",i.item)},o=()=>{s("item-leave",i.item)};return(t,i)=>(j(),U("div",_a,[W("span",{class:B(["list-item__tag",{selected:e.isSelected}]),onClick:a,onMouseenter:n,onMouseleave:o},[e.selectable?(j(),U("input",{key:0,type:"checkbox",name:e.item.name,checked:e.isSelected,onClick:i[0]||(i[0]=Q((()=>{}),["stop"]))},null,8,Sa)):te("",!0),W("span",La,[W("div",xa,ee("zh"==e.locale?e.item.name_cn:e.item.name),1)])],34)]))}},[["__scopeId","data-v-c93b1734"]]),Ea=S("graphStore",{state:e=>({selectors:[],selectors_styles:{},seg_selectors:[],slider_controls:[]}),actions:{setSelectors(e){this.selectors=R(e)},setStyles(e,t){this.selectors_styles[e]||(this.selectors_styles[e]=t)},setSegSelectors(e){this.seg_selectors=R(e)},setSliderControls(e){this.slider_controls=R(e)}}}),Na={class:"easyuse-styles-selector"},Ca={class:"easyuse-styles-selector-header flex justify-between gap-2"},Ia={class:"flex align-center gap-1"},Ta={class:"flex-1"},Oa={key:0,class:"grid-container gap-2"},Ma={key:1,class:"list-container"},Da={key:0,class:"easyuse-styles-selector-previewer"},Ra={class:"easyuse-styles-selector-previewer__text"},Pa=["src"],Ga={class:"title"},za={class:"easyuse-styles-selector-previewer__prompt"},Va={key:0},ja={class:"comfyui-easyuse-success"},Ua={key:1},Wa={class:"comfyui-easyuse-error"},Fa={__name:"stylesSelector",props:["widget"],setup(e){const t=Ea(),{selectors_styles:i}=I(t),s=P(""),a=P([]),n=Y((e=>be("Comfy.Locale")||"en")),o=P(be("EasyUse.StylesSelector.DisplayType")||"Grid");"Gird"==o.value&&(o.value="Grid",_e("EasyUse.StylesSelector.DisplayType","Grid"));const l=P([]),r=P("");z((e=>o.value),(e=>{_e("EasyUse.StylesSelector.DisplayType",e)})),z((t=>e.widget.value),(e=>{a.value=e.split(",").map((e=>e.trim()))}));const d=Y((()=>{if(!r.value.trim())return l.value;const e=a.value||[],t=r.value.toLowerCase(),i=[],s=[];return l.value.forEach((a=>{if(e.includes(a.name))i.push(a);else{const e="zh"===n.value&&a.name_cn?a.name_cn:a.name,i=a.prompt||"",o=a.negative_prompt||"";(e.toLowerCase().includes(t)||i.toLowerCase().includes(t)||o.toLowerCase().includes(t))&&s.push(a)}})),[...i,...s]})),u=ne({name:"",positive:"",negative:"",src:""}),A=async e=>{if(i.value[e])return!0;const s=await pe.fetchApi(`/easyuse/prompt/styles?name=${e}`);if(200===s.status){let i=(await s.json()).map(((e,t)=>(e.index=t,e)));return await t.setStyles(e,i),!0}return Xe.error(Le("Get styles list Failed")),!1},c=e=>{var t,i;u.name="zh"==n.value&&e.name_cn?e.name_cn:e.name,u.src=e.thumbnailVariant&&"default"!=e.thumbnailVariant?(null==(t=e.thumbnail)?void 0:t[1])||(null==(i=e.thumbnail)?void 0:i[0]):e.thumbnail,u.positive=e.prompt,u.negative=e.negative_prompt},p=()=>{u.name="",u.src="",u.positive="",u.negative=""},h=e=>{const t=a.value||[],n=R(i.value[s.value]);l.value=[...n.sort(((e,t)=>e.index-t.index)).sort(((e,i)=>t.includes(i.name)-t.includes(e.name)))]},m=e=>(a.value||[]).includes(e.name),f=e=>{let t=[...a.value||[]];const i=e.name,s=t.findIndex((e=>e===i));s>-1?t.splice(s,1):t.push(i),a.value=t},g=()=>{a.value=[]};return V((t=>{setTimeout((t=>{const i=ft(e.widget.node,"styles");let a=i.value;s.value=a,A(a).then((e=>e&&h())),i.callback=e=>{s.value=e,g(),A(e).then((e=>e&&h()))}}),1),e.widget.serializeValue=async({node:e},t)=>{try{let i=a.value||[];return i=i.join(","),(null==e?void 0:e.widgets_values)&&(e.widgets_values[t]=i,e.widgets[t].value=i),i}catch(i){return[]}}})),(t,i)=>(j(),U("div",Na,[W("div",Ca,[W("div",Ia,[Z(F(X(x),{icon:"pi pi-trash",severity:"secondary",outlined:"",size:"small",onClick:g},null,512),[[X(E),X(Le)("Reset")]])]),W("div",Ta,[F(X(M),null,{default:ae((()=>[F(X(T),{class:"pi pi-search"}),F(X(O),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=e=>r.value=e),placeholder:X(Le)("Search styles..."),class:"w-full"},null,8,["modelValue","placeholder"])])),_:1})]),F(X(D),{modelValue:o.value,"onUpdate:modelValue":i[1]||(i[1]=e=>o.value=e),options:["Grid","List"],"allow-empty":!1},{option:ae((({option:e})=>[W("i",{class:B(["List"===e?"pi pi-bars":"pi pi-table"])},null,2)])),_:1},8,["modelValue"])]),W("div",{class:"easyuse-styles-selector-content",onMouseleave:i[2]||(i[2]=t=>h(e.widget.node.name))},["Grid"===o.value?(j(),U("div",Oa,[(j(!0),U(K,null,J(d.value,((e,t)=>(j(),H(wa,{key:`${e.name}-${t}`,item:e,"unique-key":"name",locale:n.value,selectable:!0,"is-selected":m(e),"show-description":!0,"preview-enabled":!0,onSelect:f,onItemHover:c,onItemLeave:p},null,8,["item","locale","is-selected"])))),128))])):(j(),U("div",Ma,[(j(!0),U(K,null,J(d.value,((e,t)=>(j(),H(ka,{key:`${e.name}-${t}`,item:e,"unique-key":"name",locale:n.value,selectable:!0,"is-selected":m(e),"show-description":!0,onSelect:f,onItemHover:c,onItemLeave:p},null,8,["item","locale","is-selected"])))),128))]))],32),(null==u?void 0:u.positive)||(null==u?void 0:u.negative)?(j(),U("div",Da,[W("div",Ra,[W("img",{src:u.src,alt:"",style:{width:"100%",height:"auto","object-fit":"contain","border-radius":"6px"}},null,8,Pa),W("span",Ga,ee(u.name),1),W("div",za,[u.positive?(j(),U("h6",Va,[W("span",ja,ee(X(Le)("Positive"))+":",1),W("span",null,ee(u.positive),1)])):te("",!0),u.negative?(j(),U("h6",Ua,[W("span",Wa,ee(X(Le)("Negative"))+":",1),W("span",null,ee(u.negative),1)])):te("",!0)])])])):te("",!0)]))}},Xa=new Map,Za={width:"100%",height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},Ha=(e,t)=>{const i=document.createElement("div"),s=e.node,a=e.options||{getMinHeight:()=>100,hideOnZoom:!0,serialize:!0},n=e.styles||null;i.id=`easyuse-vue-widget-${s.id}`,Object.assign(i.style,Za,n||{});const o=s.addDOMWidget(e.name||"ustom_vue_component_basic","vue-basic",i,a);e.inputSpec&&(o.inputSpec=e.inputSpec);const l=oe(t,{widget:o,node:s});return l.use(Ae),l.mount(i),Xa.set(s.id,l),o.onRemove=()=>{const e=Xa.get(s.id);e&&(e.unmount(),Xa.delete(s.id))},{widget:o}};ce.registerExtension({name:"Comfy.EasyUse.CustomWidget",getCustomWidgets:e=>({EASY_PROMPT_AWAIT_BAR:e=>{const t=P(JSON.stringify({select:"now",unlock:!0,last_seed:0,seed:0})),i=!!["obsidian","obsidian_dark","milk_white"].includes(be("Comfy.ColorPalette"))?48:54;return Ha({name:"toolbar",node:e,options:{getMinHeight:()=>i,getMaxHeight:()=>i,getValue:()=>t.value,setValue:e=>{try{t.value="object"==typeof e?JSON.stringify(e):e}catch(i){}}}},Ss)},EASY_PROMPT_STYLES:e=>{const t=P("");return Ha({name:"select_styles",node:e,options:{getMinHeight:()=>180,getMaxHeight:()=>e.size[1]-75,getValue:()=>t.value,setValue:e=>{t.value=Array.isArray(e)?e.join(","):e}},styles:{overflow:"visible"}},Fa)},EASY_COMBO:(e,t,i)=>{const s=P(""),a=!!["obsidian","obsidian_dark","milk_white"].includes(be("Comfy.ColorPalette"))?22:26;return Ha({name:"mask_components",node:e,options:{margin:0,getMinHeight:()=>a,getMaxHeight:()=>a,getValue:()=>s.value,setValue:e=>{s.value=Array.isArray(e)?e.join(","):e}},inputSpec:null==i?void 0:i[1],styles:{overflow:"visible"}},xs)},EASY_MULTI_ANGLE:e=>{const t=P(JSON.stringify([{rotate:0,vertical:0,zoom:5,add_angle_prompt:!0}]));return Ha({name:"multi_angle",node:e,options:{getMinHeight:()=>350,getMaxHeight:()=>e.size[1]-80,getValue:()=>t.value,setValue:e=>{try{t.value=Array.isArray(e)?JSON.stringify(e):e}catch(i){}}},styles:{overflow:"visible"}},na)}})});export{Le as $,Te as N,ce as a,Ze as b,be as c,hi as d,Oe as e,pe as f,ft as g,we as h,Lt as j,je as s,Xe as t,Ea as u};