comfy-ts 2.25.0 → 2.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-y714t866.js → chunk-6mgjbrp6.js} +2 -2
- package/dist/{chunk-xk25ecw5.js → chunk-6tsg7fm5.js} +6 -4
- package/dist/{chunk-xk25ecw5.js.map → chunk-6tsg7fm5.js.map} +3 -3
- package/dist/{chunk-qw7be3v5.js → chunk-dvxjvwe7.js} +3 -3
- package/dist/{chunk-17hrzqcr.js → chunk-dw0t1nye.js} +5 -5
- package/dist/{chunk-3vhqs473.js → chunk-he70ewwx.js} +4 -4
- package/dist/{chunk-94f854t1.js → chunk-n22qz0j1.js} +4 -4
- package/dist/{chunk-94f854t1.js.map → chunk-n22qz0j1.js.map} +1 -1
- package/dist/{chunk-tye3z60z.js → chunk-n35nffm8.js} +4 -4
- package/dist/cli.js +5 -5
- package/dist/host/loraManagerApi.d.cts +1 -1
- package/dist/host/loraManagerApi.d.ts +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +2 -2
- package/dist/serve-web.js +1 -1
- package/dist/web.js +2 -2
- package/dist/web.js.map +2 -2
- package/package.json +1 -1
- package/src/cli/serve/web/components/controls/LorasControl.tsx +2 -0
- package/src/host/loraManagerApi.ts +8 -3
- /package/dist/{chunk-y714t866.js.map → chunk-6mgjbrp6.js.map} +0 -0
- /package/dist/{chunk-qw7be3v5.js.map → chunk-dvxjvwe7.js.map} +0 -0
- /package/dist/{chunk-17hrzqcr.js.map → chunk-dw0t1nye.js.map} +0 -0
- /package/dist/{chunk-3vhqs473.js.map → chunk-he70ewwx.js.map} +0 -0
- /package/dist/{chunk-tye3z60z.js.map → chunk-n35nffm8.js.map} +0 -0
package/dist/serve-web.js
CHANGED
|
@@ -143,7 +143,7 @@ void main() {
|
|
|
143
143
|
CLIP models read it in chunks of 75`,children:["≈ ",u," tokens"]})]})]})});function Vf(e){let[t,n]=G(!1),i=e.entries.length;return w(ie,{children:[w("button",{type:"button",className:e.compact===!0?"link":"mini",disabled:i===0,"data-tip":i===0?`every ${e.what} you submit shows here, until you close the page`:`${i} past ${e.what}s: search, preview, restore`,onClick:()=>n(!0),children:[h(N,{name:"history"}),e.compact===!0?null:" history"]}),t?h(PF,{entries:e.entries,what:e.what,onPick:(r)=>{n(!1),e.onPick(r)},onClose:()=>n(!1)}):null]})}function PF(e){let[t,n]=G(""),[i,r]=G(0),[o,s]=G(()=>Date.now()),l=F(null),a=BM(e.entries,t),u=a[Math.min(i,Math.max(0,a.length-1))]??null;W(()=>{let f=setInterval(()=>s(Date.now()),1e4);return()=>clearInterval(f)},[]),W(()=>{let f=(d)=>{Me(d,()=>{d.stopImmediatePropagation(),e.onClose()})};return window.addEventListener("keydown",f,!0),()=>window.removeEventListener("keydown",f,!0)},[e]),W(()=>{l.current?.querySelector(".hist-row.sel")?.scrollIntoView({block:"nearest"})},[i,t]);let c=(f)=>r((d)=>Math.max(0,Math.min(a.length-1,d+f)));return h("div",{className:"modal-overlay top hist-overlay",onClick:()=>e.onClose(),children:w("div",{className:"modal hist-modal",onClick:(f)=>f.stopPropagation(),children:[w("div",{className:"modal-head",children:[h(N,{name:"history"}),h("input",{type:"text",autoFocus:!0,placeholder:`search ${e.entries.length} past ${e.what}s, every word must match`,value:t,onChange:(f)=>{n(f.target.value),r(0)},onKeyDown:(f)=>{if(f.key==="ArrowDown")f.preventDefault(),c(1);else if(f.key==="ArrowUp")f.preventDefault(),c(-1);else if(f.key==="Enter"){if(f.preventDefault(),u!=null)e.onPick(u)}}}),h("button",{type:"button",className:"modal-close","data-tip":"close (esc)",onClick:()=>e.onClose(),children:h(N,{name:"close"})})]}),w("div",{className:"hist-cols",children:[w("div",{className:"hist-list",ref:l,children:[a.length===0?w("div",{className:"hist-empty",children:["nothing matches '",t,"'"]}):null,a.map((f,d)=>w("button",{type:"button",className:f===u?"hist-row sel":"hist-row",onMouseEnter:()=>r(d),onClick:()=>e.onPick(f),children:[h("span",{className:"hist-first",children:f.text.split(`
|
|
144
144
|
`)[0]}),w("span",{className:"hist-meta",children:[PM(f.at,o),f.count>1?` · ${f.count}×`:"",f.source===""?"":` · ${f.source}`]})]},f.text))]}),h("div",{className:"hist-preview",children:u==null?null:w(ie,{children:[h("pre",{className:"hist-text",children:u.text}),w("div",{className:"hist-foot",children:[h("span",{className:"hint",children:"↑↓ to preview, enter or click to restore"}),w("button",{type:"button",className:"primary",onClick:()=>e.onPick(u),children:["restore this ",e.what]})]})]})})]})]})})}var VF=["off","low","medium","high"],HF={openrouter:"openrouter (cloud)",openwebui:"open webui (local)",openai:"llama.cpp / ollama / vllm (openai /v1)"},UF={openrouter:"",openwebui:"http://localhost:3000",openai:"http://localhost:8080/v1"},Wz=H(function(t){let n=async()=>{let r=await St.prompt({message:`name the new ${t.kind}`,value:t.newName});if(r!=null)t.onCreate(r)},i=(r)=>{let o=t.status?.(r)??null;return o==null?null:h("span",{className:`enh-dot ${o.cls}`,"data-tip":o.tip})};return w("div",{className:"enh-tabs",children:[w("div",{className:"enh-tabs-title",children:[t.title,t.save==="saving"?h("span",{className:"enh-save",children:"saving…"}):null,t.save==="error"?h("span",{className:"enh-save error","data-tip":t.saveError,children:"\uD83D\uDD34 not saved"}):null]}),h("select",{className:"enh-tab-select",value:t.selected,onChange:(r)=>t.onSelect(r.target.value),children:t.names.map((r)=>h("option",{value:r,children:r},r))}),w("div",{className:"enh-tab-list",role:"tablist",children:[t.names.map((r)=>w("div",{className:r===t.selected?"enh-tab sel":"enh-tab",children:[w("button",{type:"button",role:"tab","aria-selected":r===t.selected,onClick:()=>t.onSelect(r),children:[i(r),h("span",{className:"enh-tab-name",children:r})]}),r===t.selected?h("button",{type:"button",className:t.editing?"enh-tab-edit sel":"enh-tab-edit","data-tip":t.editing?"close the editor":`edit this ${t.kind}`,onClick:()=>t.onEdit(),children:h(N,{name:"pen"})}):null]},r)),w("button",{type:"button",className:"enh-tab-new",onClick:()=>void n(),children:[h(N,{name:"plus"})," new ",t.kind]})]})]})}),KF=H(function(t){let n=t.e,{configEntry:i,preset:r}=n;return w("nav",{className:"enh-side",children:[i==null?w("div",{className:"enh-tabs",children:[h("div",{className:"enh-tabs-title",children:"llm"}),w("button",{type:"button",className:"enh-tab-new",onClick:()=>n.setEditing("llm"),children:[h(N,{name:"plus"})," set up an llm"]})]}):h(Wz,{title:"llm",names:n.configs.map((o)=>o.name),selected:i.name,kind:"llm",newName:"my-llm",save:n.configSaveState,saveError:n.configSaveError,editing:n.editing==="llm",onEdit:()=>n.setEditing(n.editing==="llm"?null:"llm"),status:(o)=>{let s=n.configStatus.get(o);if(s==null)return null;let l=n.configStatusError.get(o);return{cls:s,tip:s==="up"?"answers":s==="checking"?"checking…":`does not answer: ${l??""}`}},onSelect:(o)=>n.selectConfig(o),onCreate:(o)=>{n.addConfig(o),n.setEditing("llm")}}),r==null?w("div",{className:"enh-tabs",children:[h("div",{className:"enh-tabs-title",children:"master prompt"}),w("button",{type:"button",className:"enh-tab-new",onClick:()=>n.addPreset("refine-prompt"),children:[h(N,{name:"plus"})," new master prompt"]})]}):h(Wz,{title:"master prompt",names:n.presets.map((o)=>o.name),selected:r.name,kind:"master prompt",newName:"refine-<model>-prompt",save:n.saveState,saveError:n.saveError,editing:n.editing==="preset",onEdit:()=>n.setEditing(n.editing==="preset"?null:"preset"),onSelect:(o)=>n.selectPreset(o),onCreate:(o)=>{n.addPreset(o),n.setEditing("preset")}})]})});function Yz(e){let t=async()=>{if(e.name==null)return;let i=await St.prompt({message:`rename this ${e.kind} (renames the file)`,value:e.name});if(i!=null)e.onRename(i)},n=async()=>{if(e.name==null)return;if(await St.confirm({message:`delete ${e.kind} '${e.name}'? its file is removed.`,ok:"delete",danger:!0}))e.onDelete()};return w("section",{className:"enh-edit",children:[w("div",{className:"enh-edit-head",children:[w("h3",{className:"enh-h","data-tip":e.tip,children:[e.kind," ",h("span",{className:"enh-h-name",children:e.name??"new"})]}),e.name==null?null:w("span",{className:"btn-group",children:[h("button",{type:"button",onClick:()=>e.onDuplicate(),children:"duplicate"}),h("button",{type:"button",onClick:()=>void t(),children:"rename"}),w("button",{type:"button",className:"quiet-danger",onClick:()=>void n(),children:[h(N,{name:"trash"})," delete"]})]}),h("button",{type:"button",className:"enh-edit-close","data-tip":"done (esc), everything is already saved",onClick:()=>e.onClose(),children:"done"})]}),h("div",{className:"enh-edit-body",children:e.children})]})}var $F=H(function(t){let n=t.e,i=n.visibleModels,r=n.provider!=="openrouter",o=n.configEntry;return w(Yz,{kind:"llm",name:o?.name??null,tip:o==null?"any edit creates the config file":`.comfy-ts/llm-configs/${o.name}.json, saved as you type`,onRename:(s)=>void n.renameConfig(s),onDuplicate:()=>n.duplicateConfig(),onDelete:()=>void n.deleteConfig(),onClose:()=>n.setEditing(null),children:[w("div",{className:"enh-grid",children:[h("label",{children:"provider"}),h("select",{value:n.provider,onChange:(s)=>n.setProvider(s.target.value),children:JM.map((s)=>h("option",{value:s,children:HF[s]},s))}),r?w(ie,{children:[h("label",{children:"address"}),h("input",{type:"text",placeholder:UF[n.provider],value:n.baseUrl,onChange:(s)=>n.setBaseUrl(s.target.value)})]}):null,h("label",{"data-tip":"kept in this browser only, never in a file",children:"api key"}),h("input",{type:"password",placeholder:r?"blank if none":"sk-or-v1-…",value:n.apiKey,onChange:(s)=>n.setApiKey(s.target.value)}),h("label",{children:"model"}),w("div",{className:"enh-inline",children:[i.length>0?w("select",{value:n.model,onChange:(s)=>n.setModel(s.target.value),children:[i.some((s)=>s.id===n.model)?null:w("option",{value:n.model,children:[n.model," (not in the list)"]}),i.map((s)=>h("option",{value:s.id,children:s.id},s.id))]}):h("input",{type:"text",placeholder:r?"e.g. qwen3:8b":"e.g. anthropic/claude-sonnet-5",value:n.model,onChange:(s)=>n.setModel(s.target.value)}),h("button",{type:"button",onClick:()=>void n.loadModels(),disabled:n.modelsState==="loading",children:n.modelsState==="loading"?"asking…":"list models"})]}),n.provider==="openwebui"?null:w(ie,{children:[h("label",{"data-tip":r?"off = no thinking (chat template switch), anything else = think first":"reasoning effort sent to the model",children:"thinking"}),w("div",{className:"enh-inline",children:[h("span",{className:"btn-group",children:VF.map((s)=>h("button",{type:"button",className:n.effort===s?"mode sel":"mode",onClick:()=>n.setEffort(s),children:s},s))}),w("label",{className:"row-inline","data-tip":"hide models that report no reasoning support",children:[h("input",{type:"checkbox",checked:n.thinkingOnly,onChange:()=>n.toggleThinkingOnly()}),"thinking models only"]})]})]})]}),n.modelsError!==""?w("div",{className:"error",children:["\uD83D\uDD34 ",n.modelsError]}):null,n.configsError!==""?w("div",{className:"error",children:["\uD83D\uDD34 ",n.configsError]}):null]})}),FF=H(function(t){let n=t.e.preset;return w(Yz,{kind:"master prompt",name:n?.name??null,tip:n==null?void 0:`.comfy-ts/prompt-enhancers/${n.name}.md, saved as you type`,onRename:(i)=>void t.e.renamePreset(i),onDuplicate:()=>t.e.duplicatePreset(),onDelete:()=>void t.e.deletePreset(),onClose:()=>t.e.setEditing(null),children:[n==null?h("div",{className:"enh-empty",children:t.e.presetsState==="loading"?"loading…":"no master prompt yet: add one on the left"}):h("textarea",{className:"enh-text enh-master",rows:18,value:n.text,onChange:(i)=>t.e.setPresetText(i.target.value)}),t.e.presetsError!==""?w("div",{className:"error",children:["\uD83D\uDD34 ",t.e.presetsError]}):null]})}),jF=H(function(t){let n=t.e,i=n.phase==="running",r=F(null);W(()=>{let a=r.current;if(a==null)return;a.focus(),a.setSelectionRange(a.value.length,a.value.length)},[]);let o=Qz(n),s=(a)=>w("span",{className:"kbd-hint",children:[Le,zc[a]]}),l=n.result.trim()==="";return w("section",{className:"enh-job",children:[w("div",{className:"enh-actions",children:[i?h("button",{type:"button",className:"enh-big enh-go",onClick:()=>n.cancel(),children:"stop"}):w("button",{type:"button",className:"primary enh-big enh-go",onClick:o.enhance,children:[h(N,{name:"sparkle"})," enhance ",s("enhance")]}),w("button",{type:"button",className:"enh-big","data-tip":"generate the draft with this rewrite in place of the prompt: the prompt itself is not changed",onClick:()=>t.st.generate(n.tryOverride),disabled:l,children:[h(N,{name:"play",size:0.85})," try it ",w("span",{className:"kbd-hint",children:[Le,"⏎"]})]}),w("button",{type:"button",className:"accent enh-big","data-tip":"write this rewrite into the prompt and close",onClick:o.apply,disabled:l,children:["apply to prompt ",s("apply")]}),h("span",{className:"run-error","data-tip":n.error===""?void 0:n.error,children:n.error===""?"":`\uD83D\uDD34 ${n.error}`})]}),w("div",{className:"enh-label enh-label-row",children:[h("span",{children:"yours, what gets sent (the form is untouched)"}),w("span",{className:"row-inline",children:[h("button",{type:"button",className:"mini","data-tip":"replace this text with the prompt you opened the enhancer from",onClick:()=>n.usePrompt(),children:"use the prompt"}),h(Vf,{entries:n.inputHistory,what:"enhance input",onPick:(a)=>n.setOriginal(a.value)})]})]}),h("textarea",{ref:r,className:"enh-text enh-box",value:n.original,onChange:(a)=>n.setOriginal(a.target.value)}),w("div",{className:"enh-label",children:[i?`rewriting… ${n.result.length} chars`:"rewrite, editable before you apply",n.thinking===""?null:w("span",{className:"enh-think-tip","data-tip":n.thinking,children:["· thinking (",n.thinking.length," chars)"]})]}),h("textarea",{className:"enh-text enh-box enh-result",value:n.result,placeholder:"press enhance",onChange:(a)=>n.setResult(a.target.value)})]})});function Qz(e){return{enhance:()=>e.phase==="running"?void 0:e.run(),apply:()=>e.apply()}}var qF=H(function(t){let{e:n,st:i}=t;return W(()=>{let r=(o)=>{if(Me(o,()=>{if(n.editing!=null)n.setEditing(null);else n.close()}))return;let l=eM(o);if(l==null)return;o.preventDefault(),Qz(n)[l]()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[n,i]),h("div",{className:"modal-overlay top",onClick:()=>n.close(),children:w("div",{className:"modal enh-modal",onClick:(r)=>r.stopPropagation(),children:[w("div",{className:"modal-head",children:[w("b",{className:"enh-title",children:[h(N,{name:"sparkle"})," enhance prompt"]}),h("button",{type:"button",className:"modal-close","data-tip":"close (esc), nothing is applied",onClick:()=>n.close(),children:h(N,{name:"close"})})]}),w("div",{className:"enh-layout",children:[h(KF,{e:n}),w("div",{className:"enh-right",children:[h("div",{className:"modal-body enh-main",children:h(jF,{e:n,st:i})}),n.editing==="llm"?h($F,{e:n}):null,n.editing==="preset"?h(FF,{e:n}):null]})]})]})})}),e1=H(function(t){let n=t.st.enhancer;return w(ie,{children:[w("button",{type:"button",className:t.compact===!0?"link":"mini","data-tip":"rewrite this prompt with an llm",onClick:()=>n.openFor({v:t.v,module:t.module,lane:t.lane}),children:[h(N,{name:"sparkle"}),t.compact===!0?null:" enhance",t.shortcut===!0?w("span",{className:"kbd-hint",children:[Le,Ot["open-enhancer"]]}):null]}),n.target===t.v&&n.targetLane===(t.lane??null)?h(qF,{e:n,st:t.st}):null]})});var Jz=H(function(t){let[n,i]=G(null),r=t.st.form,o=r?.loraKeywordGroups(t.v)??[];if(r==null||o.length===0)return null;return h("div",{className:"kw-prefix",children:o.map((s)=>{let l=s.parts.filter((a)=>a.on).length;return w("div",{className:"preset-box kw-box",children:[w("button",{type:"button",className:s.running?"kw-line":"kw-line stopped","aria-expanded":n===s.lora,"data-tip":`${s.lora}
|
|
145
145
|
${s.running?"added in front of your prompt at run time":"not running: paused, or its lane is off"}
|
|
146
|
-
click to choose the words`,onClick:()=>i(n===s.lora?null:s.lora),children:[h("span",{className:"kw-lora",children:s.label}),h("span",{className:"kw-words",children:s.parts.filter((a)=>a.on).map((a)=>a.text).join(", ")||"no words"}),s.parts.length-l>0?w("span",{className:"kw-off",children:["+",s.parts.length-l," disabled"]}):null]}),n===s.lora?w(ie,{children:[h("div",{className:"preset-backdrop",onClick:()=>i(null)}),w("div",{className:"preset-menu kw-menu",children:[w("div",{className:"row-inline kw-menu-head",children:[h("span",{className:"kw-lora",children:s.label}),h("button",{type:"button",className:"link",onClick:()=>r.setKeywordMute(t.v,s.lora,[]),children:"all"}),h("button",{type:"button",className:"link",onClick:()=>r.setKeywordMute(t.v,s.lora,s.parts.map((a)=>a.text)),children:"none"})]}),s.parts.map((a)=>w("label",{className:"kw-item",children:[h("input",{type:"checkbox",checked:a.on,onChange:()=>r.toggleKeywordPart(t.v,s.lora,a.text)}),h("span",{children:a.text})]},a.text))]})]}):null]},s.lora)})})}),$m="application/x-comfy-lane",XF=H(function(t){let[n,i]=G(!1),r=t.lanes[t.ix];if(r==null)return null;let o=(s)=>{t.v.set({lanes:s})};return w("div",{className:r.active?"lane-box":"lane-box off",onDragOver:(s)=>{if(s.dataTransfer.types.includes($m))s.preventDefault()},onDrop:(s)=>{let l=Number(s.dataTransfer.getData($m));if(s.dataTransfer.getData($m)===""||!Number.isInteger(l)||l===t.ix)return;s.preventDefault(),o(kp(t.lanes,l,t.ix-l))},children:[w("div",{className:"lane-bar",children:[n?h("input",{type:"text",className:"lane-name",autoFocus:!0,defaultValue:r.name,onFocus:(s)=>s.currentTarget.select(),onKeyDown:(s)=>{if(s.key==="Enter")o(_i(t.lanes,t.ix,{name:s.currentTarget.value.trim()||r.name})),i(!1);Me(s,()=>i(!1))},onBlur:()=>i(!1)}):h("button",{type:"button",className:r.active?"lane-pill":"lane-pill off",draggable:!0,"data-tip":`${r.active?"in the prompt":"left out"}: click to switch, drag to reorder, double-click to rename`,onDragStart:(s)=>{s.dataTransfer.effectAllowed="move",s.dataTransfer.setData($m,String(t.ix))},onClick:()=>o(_i(t.lanes,t.ix,{active:!r.active})),onDoubleClick:()=>i(!0),children:r.name}),w("span",{className:"lane-tools",children:[h(e1,{v:t.v,st:t.st,module:t.module,lane:t.ix,compact:!0,shortcut:t.shortcut}),h(tf,{tip:"lane actions",children:(s)=>w(ie,{children:[h(fn,{label:"rename",onClick:()=>{s(),i(!0)}}),h(fn,{label:"remove",disabled:t.lanes.length===1,onClick:()=>{s(),o(Ep(t.lanes,t.ix))}})]})})]})]}),h(Zw,{v:t.v,st:t.st,module:t.module,value:r.prompt,onChange:(s)=>o(_i(t.lanes,t.ix,{prompt:s})),minLines:2})]})}),Zz=H(function(t){let n=t.v.value;if(Gr(n)){let r=UM(n);return w("div",{children:[h(Jz,{v:t.v,st:t.st}),h("div",{className:"lanes",children:n.lanes.map((o,s)=>h(XF,{v:t.v,st:t.st,module:t.module,lanes:n.lanes,ix:s,shortcut:t.jumpTarget===!0&&s===0},s))}),w("div",{className:"row-inline lane-foot",children:[h("button",{type:"button",className:"link",onClick:()=>t.v.set({lanes:[...n.lanes,{name:Uc(n.lanes),prompt:"",active:!0}]}),children:"+ lane"}),r==null?null:h("button",{type:"button",className:"link","data-tip":"back to a single prompt box",onClick:()=>t.v.set(r),children:"single box"}),h(Vf,{entries:t.st.promptHistory,what:"prompt",onPick:(o)=>t.v.set(o.value)}),h("span",{className:"hint",children:"lanes merge top to bottom"})]})]})}let i=typeof n==="string"?n:"";return w("div",{children:[h(Jz,{v:t.v,st:t.st}),h(Zw,{v:t.v,st:t.st,module:t.module,value:i,onChange:(r)=>t.v.set(r),minLines:4}),w("div",{className:"row-inline prompt-actions",children:[h(ef,{v:t.v}),h(e1,{v:t.v,st:t.st,module:t.module,shortcut:t.jumpTarget}),h(Vf,{entries:t.st.promptHistory,what:"prompt",onPick:(r)=>t.v.set(r.value)}),h("button",{type:"button",className:"mini","data-tip":"split this prompt into named lanes, merged in the order they are listed",onClick:()=>t.v.set(HM(i)),children:"lanes"})]})]})});function eI(e){return{label:"Run",fill:e.isRunning?Math.max(0,Math.min(100,Math.round(e.percent??0))):null,running:e.isRunning}}function tI(e){let t=e.map(()=>null),n=0;while(n<e.length){let i=e[n]?.group;if(i==null){n++;continue}let r=n;while(r+1<e.length&&e[r+1]?.group===i)r++;let o=e.slice(n,r+1).find((s)=>s.groupColor!=null)?.groupColor??null;for(let s=n;s<=r;s++)t[s]={pos:n===r?"solo":s===n?"start":s===r?"end":"mid",color:o};n=r+1}return t}function nI(e){let t=e.dataTransfer.types;return t.includes(Kc)||t.includes("Files")}function GF(e){if(e.kind==="audio")return h("audio",{controls:!0,preload:"metadata",src:e.url,onError:e.onError});if(e.kind==="video")return h("video",{controls:!0,muted:!0,preload:"metadata",src:e.url,onError:e.onError});return h("img",{src:e.url,alt:e.alt,onError:e.onError})}function WF(e){return h("div",{className:"media-presets",children:e.presets.map((t)=>w("button",{type:"button",className:`media-preset${t.value===e.value?" sel":""}`,disabled:t.missing===!0,"data-tip":t.missing===!0?`${t.label}: not on this machine (${t.value})`:t.value,onClick:()=>e.onPick(t.value),children:[t.thumb!=null?h("img",{src:t.thumb,alt:"",loading:"lazy"}):h("span",{className:"media-preset-none"}),h("span",{children:t.label})]},t.label))})}var iI=H(function(t){let n=F(null),[i,r]=G(!1),o=typeof t.v.value==="string"?t.v.value:"",s=/^https?:\/\//.test(o),l=t.kind==="image"&&o!==""&&!s?`/thumb?src=${encodeURIComponent(o)}&w=360`:null,a=s?o:t.v.uploadedUrl??l,[u,c]=G(!1);W(()=>c(!1),[a]);let f=t.v.desc.mediaPresets??[],d=t.v.desc.extensions??[];return w("div",{className:`media-drop${i?" over":""}`,onDragOver:(m)=>{if(!nI(m))return;m.preventDefault(),m.dataTransfer.dropEffect="copy",r(!0)},onDragLeave:(m)=>{if(m.currentTarget.contains(m.relatedTarget))return;r(!1)},onDrop:(m)=>{if(!nI(m))return;m.preventDefault(),m.stopPropagation(),r(!1);let v=m.dataTransfer.getData(Kc);if(v!==""){let b=fR(v);if(b==null)return t.v.setMediaError("that drop is not a gallery output this panel knows");t.v.takeOutput(b);return}let y=m.dataTransfer.files[0];if(y!=null)t.v.takeFile(y)},children:[w("div",{className:"row-inline",children:[h("input",{type:"text",style:{flex:1},placeholder:`local ${t.kind} path or http(s) url`,value:o,onChange:(m)=>{t.v.set(m.target.value),t.v.setUploadedUrl(null),t.v.setMediaError(null)}}),h("button",{type:"button",disabled:t.v.mediaBusy,onClick:()=>n.current?.click(),children:t.v.mediaBusy?"uploading…":"upload…"}),o!==""?h("button",{type:"button","data-tip":`clear the ${t.kind}`,onClick:()=>{t.v.set(""),t.v.setUploadedUrl(null),t.v.setMediaError(null)},children:h(N,{name:"close"})}):null,h("input",{ref:n,type:"file",accept:d.map((m)=>`.${m}`).join(","),style:{display:"none"},onChange:(m)=>{let v=m.target.files?.[0];if(v!=null)t.v.takeFile(v);m.target.value=""}})]}),w("div",{className:"hint media-drop-hint",children:["drop a ",t.kind," file here, or drag one from the results (or use its ",w("b",{children:["→ ",t.v.name]})," button)"]}),f.length>0?h(WF,{presets:f,value:o,onPick:(m)=>{t.v.set(m),t.v.setUploadedUrl(null),t.v.setMediaError(null)}}):null,t.v.mediaError!=null?h("div",{className:"error",children:t.v.mediaError}):null,a!=null&&a!==""&&!u?h("div",{className:`img-preview media-preview-${t.kind}`,children:h(GF,{kind:t.kind,url:a,alt:o,onError:()=>c(!0)})}):null,u?h("div",{className:"hint",children:"no preview: the panel shows files of the workflow's folders, the outputs and the presets"}):null]})});var hu="application/x-comfy-lora",t1="application/x-comfy-lora-lane",YF=H(function(t){let[n,i]=G(!1),r=t.lanes[t.ix];if(r==null)return null;let o=(s)=>{t.v.set({lanes:s})};return w("div",{className:"lane-bar",onDragOver:(s)=>{let l=s.dataTransfer.types;if(l.includes(hu)||l.includes(t1))s.preventDefault()},onDrop:(s)=>{let l=s.dataTransfer.getData(hu);if(l!==""){s.preventDefault(),t.onDropCard(l);return}let a=s.dataTransfer.getData(t1),u=Number(a);if(a===""||!Number.isInteger(u)||u===t.ix)return;s.preventDefault(),o(kp(t.lanes,u,t.ix-u))},children:[n?h("input",{type:"text",className:"lane-name",autoFocus:!0,defaultValue:r.name,onFocus:(s)=>s.currentTarget.select(),onKeyDown:(s)=>{if(s.key==="Enter")o(_i(t.lanes,t.ix,{name:s.currentTarget.value.trim()||r.name})),i(!1);Me(s,()=>i(!1))},onBlur:()=>i(!1)}):h("button",{type:"button",className:r.active?"lane-pill":"lane-pill off",draggable:!0,"data-tip":`${r.active?"runs":"left out"}: click to switch, drag to reorder, double-click to rename`,onDragStart:(s)=>{s.dataTransfer.effectAllowed="move",s.dataTransfer.setData(t1,String(t.ix))},onClick:()=>o(_i(t.lanes,t.ix,{active:!r.active})),onDoubleClick:()=>i(!0),children:r.name}),t.count===0?null:h("span",{className:"hint",children:`${t.on}/${t.count} on`}),h("span",{className:"lane-tools",children:h(tf,{tip:"lane actions",children:(s)=>w(ie,{children:[h(fn,{label:"rename",onClick:()=>{s(),i(!0)}}),h(fn,{label:"remove",disabled:t.count>0||t.lanes.length===1,tip:t.count>0?"empty the lane first":void 0,onClick:()=>{s(),o(Ep(t.lanes,t.ix))}})]})})})]})}),rI=H(function(t){let n=$o(()=>({open:!1,filter:"",info:new Map,previewFailed:new Set,paused:new Set,target:-1,openFor(T){this.target=T,this.open=!0},setOpen(T){this.open=T},setFilter(T){this.filter=T},noteInfo(T,B){this.info.set(T,B)},notePreviewFailed(T){this.previewFailed.add(T)},details:null,setDetails(T){this.details=T},split:new Map,isSplit(T,B){return this.split.get(T)??B},setSplit(T,B){this.split.set(T,B)}})),i=wp(t.v.value)?t.v.value:{},r=Ci(i)?i:null,o=t.v.desc.options??[],s=t.v.desc.optionLabels??{},l=(T)=>s[T]??T,a=Ci(i)?i.lanes.map((T,B)=>({ix:B,record:T.loras,lane:T})):[{ix:-1,record:i,lane:null}],u=(T)=>kR({record:T.record,options:o}),c=[...new Set(a.flatMap(u))],f=(T,B)=>xR(T.record[B]),d=a.reduce((T,B)=>T+u(B).filter((re)=>f(B,re)).length,0),p=a.find((T)=>T.ix===n.target)??a[0]??null,m=p==null?[]:u(p),v=(T,B)=>{let re=Ma(B,o);if(r==null)t.v.set(re);else t.v.set({lanes:_i(r.lanes,T,{loras:re})})},y=new Set(t.v.desc.managerOnlyOptions??[]),b="on disk and known to the lora manager, but not in ComfyUI's list yet: it refuses the prompt. the panel refreshes the host by itself when it changes; if this stays, the models drive is probably exFAT (install extra/comfyui-fresh-model-lists) or ComfyUI needs a restart",g=(T)=>y.has(T)?h("span",{className:"lora-warn","data-tip":"on disk and known to the lora manager, but not in ComfyUI's list yet: it refuses the prompt. the panel refreshes the host by itself when it changes; if this stays, the models drive is probably exFAT (install extra/comfyui-fresh-model-lists) or ComfyUI needs a restart",children:h(N,{name:"warn",size:0.9})}):null,x=t.st.showLoraImages,S=t.v.desc.optionTriggers??{},k=(T)=>{let B=S[T];if(B==null)return h("span",{className:"chip-triggers missing","data-tip":"this lora is newer than the copy of the lora manager's list kept here: the next host refresh brings its trigger words, name and preview (it runs by itself). The lora itself runs fine",children:"trigger words not loaded yet"});if(B.state==="unfetched"){let re=t.st.loraFetching.has(T);return w("span",{className:"chip-triggers missing",children:["trigger words never fetched",h("button",{type:"button",className:"trigger-fetch",disabled:re,"data-tip":"ask the lora manager to fetch this lora's civitai metadata, trigger words included",onClick:()=>void t.st.fetchLoraTriggers(T),children:re?"fetching…":"fetch"})]})}if(B.state==="not-on-civitai"){let re=t.st.loraFetching.has(T);return w("span",{className:"chip-triggers missing","data-tip":"civitai was asked and has no version for this file: a private or local lora, so no trigger words exist there",children:["not on civitai",h("button",{type:"button",className:"trigger-fetch",disabled:re,"data-tip":"ask civitai again (it may have been published since)",onClick:()=>void t.st.fetchLoraTriggers(T),children:re?"asking…":"retry"})]})}if(B.state==="none")return h("span",{className:"chip-triggers none","data-tip":"civitai was asked, and this lora has no trigger words",children:"no trigger words"});return h("span",{className:"chip-triggers words","data-tip":C?B.words.join(`
|
|
146
|
+
click to choose the words`,onClick:()=>i(n===s.lora?null:s.lora),children:[h("span",{className:"kw-lora",children:s.label}),h("span",{className:"kw-words",children:s.parts.filter((a)=>a.on).map((a)=>a.text).join(", ")||"no words"}),s.parts.length-l>0?w("span",{className:"kw-off",children:["+",s.parts.length-l," disabled"]}):null]}),n===s.lora?w(ie,{children:[h("div",{className:"preset-backdrop",onClick:()=>i(null)}),w("div",{className:"preset-menu kw-menu",children:[w("div",{className:"row-inline kw-menu-head",children:[h("span",{className:"kw-lora",children:s.label}),h("button",{type:"button",className:"link",onClick:()=>r.setKeywordMute(t.v,s.lora,[]),children:"all"}),h("button",{type:"button",className:"link",onClick:()=>r.setKeywordMute(t.v,s.lora,s.parts.map((a)=>a.text)),children:"none"})]}),s.parts.map((a)=>w("label",{className:"kw-item",children:[h("input",{type:"checkbox",checked:a.on,onChange:()=>r.toggleKeywordPart(t.v,s.lora,a.text)}),h("span",{children:a.text})]},a.text))]})]}):null]},s.lora)})})}),$m="application/x-comfy-lane",XF=H(function(t){let[n,i]=G(!1),r=t.lanes[t.ix];if(r==null)return null;let o=(s)=>{t.v.set({lanes:s})};return w("div",{className:r.active?"lane-box":"lane-box off",onDragOver:(s)=>{if(s.dataTransfer.types.includes($m))s.preventDefault()},onDrop:(s)=>{let l=Number(s.dataTransfer.getData($m));if(s.dataTransfer.getData($m)===""||!Number.isInteger(l)||l===t.ix)return;s.preventDefault(),o(kp(t.lanes,l,t.ix-l))},children:[w("div",{className:"lane-bar",children:[n?h("input",{type:"text",className:"lane-name",autoFocus:!0,defaultValue:r.name,onFocus:(s)=>s.currentTarget.select(),onKeyDown:(s)=>{if(s.key==="Enter")o(_i(t.lanes,t.ix,{name:s.currentTarget.value.trim()||r.name})),i(!1);Me(s,()=>i(!1))},onBlur:()=>i(!1)}):h("button",{type:"button",className:r.active?"lane-pill":"lane-pill off",draggable:!0,"data-tip":`${r.active?"in the prompt":"left out"}: click to switch, drag to reorder, double-click to rename`,onDragStart:(s)=>{s.dataTransfer.effectAllowed="move",s.dataTransfer.setData($m,String(t.ix))},onClick:()=>o(_i(t.lanes,t.ix,{active:!r.active})),onDoubleClick:()=>i(!0),children:r.name}),w("span",{className:"lane-tools",children:[h(e1,{v:t.v,st:t.st,module:t.module,lane:t.ix,compact:!0,shortcut:t.shortcut}),h(tf,{tip:"lane actions",children:(s)=>w(ie,{children:[h(fn,{label:"rename",onClick:()=>{s(),i(!0)}}),h(fn,{label:"remove",disabled:t.lanes.length===1,onClick:()=>{s(),o(Ep(t.lanes,t.ix))}})]})})]})]}),h(Zw,{v:t.v,st:t.st,module:t.module,value:r.prompt,onChange:(s)=>o(_i(t.lanes,t.ix,{prompt:s})),minLines:2})]})}),Zz=H(function(t){let n=t.v.value;if(Gr(n)){let r=UM(n);return w("div",{children:[h(Jz,{v:t.v,st:t.st}),h("div",{className:"lanes",children:n.lanes.map((o,s)=>h(XF,{v:t.v,st:t.st,module:t.module,lanes:n.lanes,ix:s,shortcut:t.jumpTarget===!0&&s===0},s))}),w("div",{className:"row-inline lane-foot",children:[h("button",{type:"button",className:"link",onClick:()=>t.v.set({lanes:[...n.lanes,{name:Uc(n.lanes),prompt:"",active:!0}]}),children:"+ lane"}),r==null?null:h("button",{type:"button",className:"link","data-tip":"back to a single prompt box",onClick:()=>t.v.set(r),children:"single box"}),h(Vf,{entries:t.st.promptHistory,what:"prompt",onPick:(o)=>t.v.set(o.value)}),h("span",{className:"hint",children:"lanes merge top to bottom"})]})]})}let i=typeof n==="string"?n:"";return w("div",{children:[h(Jz,{v:t.v,st:t.st}),h(Zw,{v:t.v,st:t.st,module:t.module,value:i,onChange:(r)=>t.v.set(r),minLines:4}),w("div",{className:"row-inline prompt-actions",children:[h(ef,{v:t.v}),h(e1,{v:t.v,st:t.st,module:t.module,shortcut:t.jumpTarget}),h(Vf,{entries:t.st.promptHistory,what:"prompt",onPick:(r)=>t.v.set(r.value)}),h("button",{type:"button",className:"mini","data-tip":"split this prompt into named lanes, merged in the order they are listed",onClick:()=>t.v.set(HM(i)),children:"lanes"})]})]})});function eI(e){return{label:"Run",fill:e.isRunning?Math.max(0,Math.min(100,Math.round(e.percent??0))):null,running:e.isRunning}}function tI(e){let t=e.map(()=>null),n=0;while(n<e.length){let i=e[n]?.group;if(i==null){n++;continue}let r=n;while(r+1<e.length&&e[r+1]?.group===i)r++;let o=e.slice(n,r+1).find((s)=>s.groupColor!=null)?.groupColor??null;for(let s=n;s<=r;s++)t[s]={pos:n===r?"solo":s===n?"start":s===r?"end":"mid",color:o};n=r+1}return t}function nI(e){let t=e.dataTransfer.types;return t.includes(Kc)||t.includes("Files")}function GF(e){if(e.kind==="audio")return h("audio",{controls:!0,preload:"metadata",src:e.url,onError:e.onError});if(e.kind==="video")return h("video",{controls:!0,muted:!0,preload:"metadata",src:e.url,onError:e.onError});return h("img",{src:e.url,alt:e.alt,onError:e.onError})}function WF(e){return h("div",{className:"media-presets",children:e.presets.map((t)=>w("button",{type:"button",className:`media-preset${t.value===e.value?" sel":""}`,disabled:t.missing===!0,"data-tip":t.missing===!0?`${t.label}: not on this machine (${t.value})`:t.value,onClick:()=>e.onPick(t.value),children:[t.thumb!=null?h("img",{src:t.thumb,alt:"",loading:"lazy"}):h("span",{className:"media-preset-none"}),h("span",{children:t.label})]},t.label))})}var iI=H(function(t){let n=F(null),[i,r]=G(!1),o=typeof t.v.value==="string"?t.v.value:"",s=/^https?:\/\//.test(o),l=t.kind==="image"&&o!==""&&!s?`/thumb?src=${encodeURIComponent(o)}&w=360`:null,a=s?o:t.v.uploadedUrl??l,[u,c]=G(!1);W(()=>c(!1),[a]);let f=t.v.desc.mediaPresets??[],d=t.v.desc.extensions??[];return w("div",{className:`media-drop${i?" over":""}`,onDragOver:(m)=>{if(!nI(m))return;m.preventDefault(),m.dataTransfer.dropEffect="copy",r(!0)},onDragLeave:(m)=>{if(m.currentTarget.contains(m.relatedTarget))return;r(!1)},onDrop:(m)=>{if(!nI(m))return;m.preventDefault(),m.stopPropagation(),r(!1);let v=m.dataTransfer.getData(Kc);if(v!==""){let b=fR(v);if(b==null)return t.v.setMediaError("that drop is not a gallery output this panel knows");t.v.takeOutput(b);return}let y=m.dataTransfer.files[0];if(y!=null)t.v.takeFile(y)},children:[w("div",{className:"row-inline",children:[h("input",{type:"text",style:{flex:1},placeholder:`local ${t.kind} path or http(s) url`,value:o,onChange:(m)=>{t.v.set(m.target.value),t.v.setUploadedUrl(null),t.v.setMediaError(null)}}),h("button",{type:"button",disabled:t.v.mediaBusy,onClick:()=>n.current?.click(),children:t.v.mediaBusy?"uploading…":"upload…"}),o!==""?h("button",{type:"button","data-tip":`clear the ${t.kind}`,onClick:()=>{t.v.set(""),t.v.setUploadedUrl(null),t.v.setMediaError(null)},children:h(N,{name:"close"})}):null,h("input",{ref:n,type:"file",accept:d.map((m)=>`.${m}`).join(","),style:{display:"none"},onChange:(m)=>{let v=m.target.files?.[0];if(v!=null)t.v.takeFile(v);m.target.value=""}})]}),w("div",{className:"hint media-drop-hint",children:["drop a ",t.kind," file here, or drag one from the results (or use its ",w("b",{children:["→ ",t.v.name]})," button)"]}),f.length>0?h(WF,{presets:f,value:o,onPick:(m)=>{t.v.set(m),t.v.setUploadedUrl(null),t.v.setMediaError(null)}}):null,t.v.mediaError!=null?h("div",{className:"error",children:t.v.mediaError}):null,a!=null&&a!==""&&!u?h("div",{className:`img-preview media-preview-${t.kind}`,children:h(GF,{kind:t.kind,url:a,alt:o,onError:()=>c(!0)})}):null,u?h("div",{className:"hint",children:"no preview: the panel shows files of the workflow's folders, the outputs and the presets"}):null]})});var hu="application/x-comfy-lora",t1="application/x-comfy-lora-lane",YF=H(function(t){let[n,i]=G(!1),r=t.lanes[t.ix];if(r==null)return null;let o=(s)=>{t.v.set({lanes:s})};return w("div",{className:"lane-bar",onDragOver:(s)=>{let l=s.dataTransfer.types;if(l.includes(hu)||l.includes(t1))s.preventDefault()},onDrop:(s)=>{let l=s.dataTransfer.getData(hu);if(l!==""){s.preventDefault(),t.onDropCard(l);return}let a=s.dataTransfer.getData(t1),u=Number(a);if(a===""||!Number.isInteger(u)||u===t.ix)return;s.preventDefault(),o(kp(t.lanes,u,t.ix-u))},children:[n?h("input",{type:"text",className:"lane-name",autoFocus:!0,defaultValue:r.name,onFocus:(s)=>s.currentTarget.select(),onKeyDown:(s)=>{if(s.key==="Enter")o(_i(t.lanes,t.ix,{name:s.currentTarget.value.trim()||r.name})),i(!1);Me(s,()=>i(!1))},onBlur:()=>i(!1)}):h("button",{type:"button",className:r.active?"lane-pill":"lane-pill off",draggable:!0,"data-tip":`${r.active?"runs":"left out"}: click to switch, drag to reorder, double-click to rename`,onDragStart:(s)=>{s.dataTransfer.effectAllowed="move",s.dataTransfer.setData(t1,String(t.ix))},onClick:()=>o(_i(t.lanes,t.ix,{active:!r.active})),onDoubleClick:()=>i(!0),children:r.name}),t.count===0?null:h("span",{className:"hint",children:`${t.on}/${t.count} on`}),h("span",{className:"lane-tools",children:h(tf,{tip:"lane actions",children:(s)=>w(ie,{children:[h(fn,{label:"rename",onClick:()=>{s(),i(!0)}}),h(fn,{label:"remove",disabled:t.count>0||t.lanes.length===1,tip:t.count>0?"empty the lane first":void 0,onClick:()=>{s(),o(Ep(t.lanes,t.ix))}})]})})})]})}),rI=H(function(t){let n=$o(()=>({open:!1,filter:"",info:new Map,previewFailed:new Set,paused:new Set,target:-1,openFor(T){this.target=T,this.open=!0,this.previewFailed.clear()},setOpen(T){this.open=T},setFilter(T){this.filter=T},noteInfo(T,B){this.info.set(T,B)},notePreviewFailed(T){this.previewFailed.add(T)},details:null,setDetails(T){this.details=T},split:new Map,isSplit(T,B){return this.split.get(T)??B},setSplit(T,B){this.split.set(T,B)}})),i=wp(t.v.value)?t.v.value:{},r=Ci(i)?i:null,o=t.v.desc.options??[],s=t.v.desc.optionLabels??{},l=(T)=>s[T]??T,a=Ci(i)?i.lanes.map((T,B)=>({ix:B,record:T.loras,lane:T})):[{ix:-1,record:i,lane:null}],u=(T)=>kR({record:T.record,options:o}),c=[...new Set(a.flatMap(u))],f=(T,B)=>xR(T.record[B]),d=a.reduce((T,B)=>T+u(B).filter((re)=>f(B,re)).length,0),p=a.find((T)=>T.ix===n.target)??a[0]??null,m=p==null?[]:u(p),v=(T,B)=>{let re=Ma(B,o);if(r==null)t.v.set(re);else t.v.set({lanes:_i(r.lanes,T,{loras:re})})},y=new Set(t.v.desc.managerOnlyOptions??[]),b="on disk and known to the lora manager, but not in ComfyUI's list yet: it refuses the prompt. the panel refreshes the host by itself when it changes; if this stays, the models drive is probably exFAT (install extra/comfyui-fresh-model-lists) or ComfyUI needs a restart",g=(T)=>y.has(T)?h("span",{className:"lora-warn","data-tip":"on disk and known to the lora manager, but not in ComfyUI's list yet: it refuses the prompt. the panel refreshes the host by itself when it changes; if this stays, the models drive is probably exFAT (install extra/comfyui-fresh-model-lists) or ComfyUI needs a restart",children:h(N,{name:"warn",size:0.9})}):null,x=t.st.showLoraImages,S=t.v.desc.optionTriggers??{},k=(T)=>{let B=S[T];if(B==null)return h("span",{className:"chip-triggers missing","data-tip":"this lora is newer than the copy of the lora manager's list kept here: the next host refresh brings its trigger words, name and preview (it runs by itself). The lora itself runs fine",children:"trigger words not loaded yet"});if(B.state==="unfetched"){let re=t.st.loraFetching.has(T);return w("span",{className:"chip-triggers missing",children:["trigger words never fetched",h("button",{type:"button",className:"trigger-fetch",disabled:re,"data-tip":"ask the lora manager to fetch this lora's civitai metadata, trigger words included",onClick:()=>void t.st.fetchLoraTriggers(T),children:re?"fetching…":"fetch"})]})}if(B.state==="not-on-civitai"){let re=t.st.loraFetching.has(T);return w("span",{className:"chip-triggers missing","data-tip":"civitai was asked and has no version for this file: a private or local lora, so no trigger words exist there",children:["not on civitai",h("button",{type:"button",className:"trigger-fetch",disabled:re,"data-tip":"ask civitai again (it may have been published since)",onClick:()=>void t.st.fetchLoraTriggers(T),children:re?"asking…":"retry"})]})}if(B.state==="none")return h("span",{className:"chip-triggers none","data-tip":"civitai was asked, and this lora has no trigger words",children:"no trigger words"});return h("span",{className:"chip-triggers words","data-tip":C?B.words.join(`
|
|
147
147
|
`):"titles are hidden",children:C?B.words.join(", "):`${B.words.length} trigger word${B.words.length===1?"":"s"}`})},C=t.st.showLoraTitles,E=(T,B,re)=>{let st={...T.record};if(re==null)delete st[B];else st[B]=re;v(T.ix,st)},_=(T,B,re)=>{v(T.ix,SR(T.record,B,re))},P=(T,B,re)=>{v(T.ix,CR(T.record,B,re))},O=(T,B)=>{let re=wR(T.record[B]),st=n.isSplit(B,re.model!==re.clip),le=(Bn,Ui)=>{if(!Number.isFinite(Ui))return;let Ki=Math.round(Ui*100)/100;if(Bn==="both")return P(T,B,{model:Ki,clip:Ki});P(T,B,Bn==="model"?{model:Ki,clip:re.clip}:{model:re.model,clip:Ki})},Be=(Bn,Ui,Ki,Hf)=>w("div",{className:"st-line",children:[h("button",{type:"button",className:"st-label","data-tip":Hf,onClick:()=>n.setSplit(B,!st),children:Ki}),h("input",{type:"range",min:0,max:1,step:0.05,value:Ui,onChange:(hl)=>le(Bn,parseFloat(hl.target.value))}),h("input",{type:"number",step:0.05,value:Ui,onChange:(hl)=>le(Bn,parseFloat(hl.target.value))})]});if(!st)return Be("both",re.model,"m+c","model and clip together — click to set them apart");return w(ie,{children:[Be("model",re.model,"m","model strength — click to tie them back together"),Be("clip",re.clip,"c","clip strength — click to tie them back together")]})},A=n.open,z=t.host,X=c.join(`
|
|
148
148
|
`);W(()=>{if(!A)return;for(let T of X.split(`
|
|
149
149
|
`)){if(T===""||n.info.has(T))continue;n.noteInfo(T,"loading"),Jy({host:z,name:T}).then((B)=>n.noteInfo(T,B)).catch(()=>n.noteInfo(T,"error"))}},[A,X,z,n]);let D=t.st.jump,q=a[0]?.ix??-1,Y=F(D?.seq??0);W(()=>{if(!t.jumpTarget||!gp(D,"loras",Y.current))return;Y.current=D?.seq??0,n.openFor(q)},[D,t.jumpTarget,q,n]),W(()=>{if(!A)return;let T=(B)=>{Me(B,()=>n.setOpen(!1))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[A,n]);let Q=n.filter.toLowerCase(),I=(T)=>T.toLowerCase().includes(Q)||l(T).toLowerCase().includes(Q),te=KR({names:o.filter(I),mode:t.st.loraSort,label:l,addedAt:t.v.desc.optionAddedAt??{}}),oe=t.st.loraCap,{cards:J,enterPick:ee}=$R({matches:te,picked:m,cap:oe}),ye=(T)=>{let B=T.split(/[\\/]+/);return B.length<=1?"":B.slice(0,-1).join("/")},be=(()=>{if(t.st.loraSort!=="folder")return[{folder:null,names:J}];let T=new Map;for(let B of J){let re=ye(B),st=T.get(re);if(st==null)T.set(re,[B]);else st.push(B)}return[...T.entries()].map(([B,re])=>({folder:B,names:re})).sort((B,re)=>B.folder.localeCompare(re.folder))})(),ue=F(null);W(()=>{if(!A)return;let T=ue.current;if(T==null)return;T.focus(),T.select()},[A]);let Ue=()=>{let T=ee;if(T==null)return;if(p!=null)E(p,T,[1,1]);ue.current?.select()},vt=t.st.loraFormScale,mn=t.st.loraPopupScale,io=Math.round(168*vt),Hi=Math.round(120*mn),yt=(T,B)=>{if(!x)return null;let re=B==null?void 0:{height:B};return n.previewFailed.has(T)?h("div",{className:"lora-thumb none",style:re,children:"no preview"}):h("img",{style:re,className:t.st.loraFill?"lora-thumb fill":"lora-thumb",loading:"lazy",src:Zy({host:t.host,name:T}),alt:l(T),onError:()=>n.notePreviewFailed(T)},T)},wr=h("span",{className:"paused-mark","aria-label":"paused",children:h(N,{name:"pause",size:2.6})}),fs=(T,B,re)=>x?h("input",{type:"range",className:"setting-range",min:0.6,max:2,step:0.05,value:B,"data-tip":`lora image size in the ${T} ×${B.toFixed(2)}`,onChange:(st)=>re(parseFloat(st.target.value))}):null,dl=w(ie,{children:[h("button",{type:"button",className:x?"mode sel":"mode","data-tip":x?"hide lora images":"show lora images",onClick:()=>t.st.toggleLoraImages(),children:h(N,{name:"image"})}),h("button",{type:"button",className:C?"mode sel":"mode","data-tip":C?"hide lora titles":"show lora titles",onClick:()=>t.st.toggleLoraTitles(),children:h(N,{name:"tag"})}),h("button",{type:"button",className:t.st.showLoraTriggers?"mode sel":"mode","data-tip":t.st.showLoraTriggers?"hide the trigger words":"show the trigger words",onClick:()=>t.st.toggleLoraTriggers(),children:h(N,{name:"text"})}),x?h("button",{type:"button",className:t.st.loraFill?"mode sel":"mode","data-tip":t.st.loraFill?"fit the whole preview inside the card":"fill the card with the preview",onClick:()=>t.st.toggleLoraFill(),children:h(N,{name:t.st.loraFill?"shrink":"expand"})}):null]});return w("div",{children:[w("div",{className:"lora-actions",children:[w("button",{type:"button",className:"field-height accent",onClick:()=>n.openFor(a[0]?.ix??-1),children:[h(N,{name:"plus"})," add"]}),h(tf,{tip:"display, lora manager, lanes",children:(T)=>w(ie,{children:[h(fn,{label:"images",checked:x,onClick:()=>t.st.toggleLoraImages()}),h(fn,{label:"titles",checked:C,onClick:()=>t.st.toggleLoraTitles()}),h(fn,{label:"fill the card",checked:t.st.loraFill,disabled:!x,onClick:()=>t.st.toggleLoraFill()}),h(fn,{label:"trigger words",checked:t.st.showLoraTriggers,onClick:()=>t.st.toggleLoraTriggers()}),x?w("label",{className:"menu-item menu-range",children:[h("span",{className:"menu-check"}),"size",fs("form",vt,(B)=>t.st.setLoraFormScale(B))]}):null,h("div",{className:"menu-sep"}),t.hostUrl==null?null:h(fn,{label:"open the lora manager ↗",onClick:()=>{T(),window.open(`${t.hostUrl}/loras`,"_blank","noreferrer")}}),h("div",{className:"menu-sep"}),r==null?h(fn,{label:"split into lanes",onClick:()=>{T(),t.v.set(jM(i))}}):w(ie,{children:[h(fn,{label:"+ lane",onClick:()=>{T(),t.v.set({lanes:[...r.lanes,{name:Uc(r.lanes),active:!0,loras:{}}]})}}),h(fn,{label:"back to a single row",disabled:Sp(r)==null,tip:Sp(r)==null?"only with one active lane: nothing gets merged behind your back":void 0,onClick:()=>{T();let B=Sp(r);if(B!=null)t.v.set(B)}})]})]})}),c.length>0?w("span",{className:"hint",children:[c.length," in the palette · ",d," on"]}):null]}),w("div",{className:"lora-lanes",children:[!x&&!C?w("span",{className:"hint",children:[c.length," lora",c.length===1?"":"s"," in the palette"]}):a.map((T)=>{let B=u(T),re=(le,Be)=>{let[Bn,Ui]=le.split(`
|
package/dist/web.js
CHANGED
|
@@ -95,7 +95,7 @@ function getComfyStorage() {
|
|
|
95
95
|
import { join as join6 } from "pathe";
|
|
96
96
|
// package.json
|
|
97
97
|
var package_default = {
|
|
98
|
-
version: "2.25.
|
|
98
|
+
version: "2.25.1"
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
// src/host/ComfyHost.ts
|
|
@@ -8332,5 +8332,5 @@ export {
|
|
|
8332
8332
|
widget
|
|
8333
8333
|
};
|
|
8334
8334
|
|
|
8335
|
-
//# debugId=
|
|
8335
|
+
//# debugId=696EADFE15C2EFFF64756E2164756E21
|
|
8336
8336
|
//# sourceMappingURL=web.js.map
|