Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a277691935 | ||
|
|
89b3dbd1b1 | ||
|
|
ea32af33bf |
@@ -41,6 +41,7 @@ cd custom_nodes && git clone https://github.com/tzwm/comfyui-browser.git
|
||||
## Notes
|
||||
|
||||
- Your 'Saves' are stored in the `ComfyUI/custom_nodes/comfyui-browser/collections`.
|
||||
- Press 'B' to toggle the Browser dialog in the ComfyUI.
|
||||
|
||||
|
||||
## Development
|
||||
|
||||
@@ -70,6 +70,7 @@ cd custom_nodes && git clone https://github.com/tzwm/comfyui-browser.git
|
||||
- 备注
|
||||
|
||||
- 请尽量在 Windows 上测试, 因为我只有 Linux 和 macOS
|
||||
- 在 ComfyUI 中可以按 'B' 键来打开/关闭 Browser
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -251,9 +251,14 @@
|
||||
>Load</button>
|
||||
{/if}
|
||||
<button
|
||||
class="btn btn-link btn-sm p-0 no-underline text-error"
|
||||
class="btn btn-link btn-sm p-0 no-underline text-error ml-52"
|
||||
on:click={async () => await onDelete(file)}
|
||||
>Remove</button>
|
||||
>
|
||||
<svg class="w-3 h-3" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16 2v4h6v2h-2v14H4V8H2V6h6V2h8zm-2 2h-4v2h4V4zm0 4H6v12h12V8h-4zm-5 2h2v8H9v-8zm6 0h-2v8h2v-8z" fill="#f77"/>
|
||||
</svg>
|
||||
Remove
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
let showCursor = 20;
|
||||
let searchQuery = '';
|
||||
let searchRegex = new RegExp('');
|
||||
let scrollTop = 0;
|
||||
|
||||
export async function refresh() {
|
||||
loaded = true;
|
||||
@@ -37,7 +38,11 @@
|
||||
comfyApp = window.top.app;
|
||||
|
||||
folderPath = '';
|
||||
window.addEventListener('scroll', () => { showCursor = onScroll(showCursor, files.length); });
|
||||
window.addEventListener('scroll', (e) => {
|
||||
showCursor = onScroll(showCursor, files.length);
|
||||
//@ts-ignore
|
||||
scrollTop = (e.target.scrollingElement as HTMLElement).scrollTop;
|
||||
});
|
||||
});
|
||||
|
||||
async function onCollect(file: any) {
|
||||
@@ -57,6 +62,11 @@
|
||||
);
|
||||
}
|
||||
|
||||
async function scrollToTop() {
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
|
||||
|
||||
async function onDelete(file: any) {
|
||||
const ret = confirm('You want to delete this file? ' + file.name);
|
||||
if (!ret) {
|
||||
@@ -138,9 +148,14 @@
|
||||
on:click={async () => await onCollect(file)}
|
||||
>Save</button>
|
||||
<button
|
||||
class="btn btn-link btn-sm p-0 no-underline text-error"
|
||||
class="btn btn-link btn-sm p-0 no-underline text-error float-right"
|
||||
on:click={async () => await onDelete(file)}
|
||||
>Delete</button>
|
||||
>
|
||||
<svg class="w-3 h-3" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16 2v4h6v2h-2v14H4V8H2V6h6V2h8zm-2 2h-4v2h4V4zm0 4H6v12h12V8h-4zm-5 2h2v8H9v-8zm6 0h-2v8h2v-8z" fill="#f77"/>
|
||||
</svg>
|
||||
Delete
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -158,3 +173,11 @@
|
||||
</span>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if scrollTop >= 300}
|
||||
<button class="fixed right-10 bottom-10 w-10 h-10 flex justify-center items-center rounded-full bg-slate-50" on:click={scrollToTop}>
|
||||
<svg class="w-5 h-5 icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill="#333333" d="M572.235 205.282v600.365a30.118 30.118 0 11-60.235 0V205.282L292.382 438.633a28.913 28.913 0 01-42.646 0 33.43 33.43 0 010-45.236l271.058-288.045a28.913 28.913 0 0142.647 0L834.5 393.397a33.43 33.43 0 010 45.176 28.913 28.913 0 01-42.647 0l-219.618-233.23z"/>
|
||||
</svg>
|
||||
</button>
|
||||
{/if}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
function x(){}function w(t,n){for(const e in n)t[e]=n[e];return t}function j(t){return t()}function F(){return Object.create(null)}function E(t){t.forEach(j)}function P(t){return typeof t=="function"}function S(t,n){return t!=t?n==n:t!==n||t&&typeof t=="object"||typeof t=="function"}let i;function U(t,n){return t===n?!0:(i||(i=document.createElement("a")),i.href=n,t===i.href)}function A(t){return Object.keys(t).length===0}function q(t,...n){if(t==null){for(const r of n)r(void 0);return x}const e=t.subscribe(...n);return e.unsubscribe?()=>e.unsubscribe():e}function B(t,n,e){t.$$.on_destroy.push(q(n,e))}function C(t,n,e,r){if(t){const o=m(t,n,e,r);return t[0](o)}}function m(t,n,e,r){return t[1]&&r?w(e.ctx.slice(),t[1](r(n))):e.ctx}function D(t,n,e,r){if(t[2]&&r){const o=t[2](r(e));if(n.dirty===void 0)return o;if(typeof o=="object"){const l=[],_=Math.max(n.dirty.length,o.length);for(let s=0;s<_;s+=1)l[s]=n.dirty[s]|o[s];return l}return n.dirty|o}return n.dirty}function G(t,n,e,r,o,l){if(o){const _=m(n,e,r,l);t.p(_,o)}}function H(t){if(t.ctx.length>32){const n=[],e=t.ctx.length/32;for(let r=0;r<e;r++)n[r]=-1;return n}return-1}let f;function h(t){f=t}function y(){if(!f)throw new Error("Function called outside component initialization");return f}function I(t){y().$$.on_mount.push(t)}function J(t){y().$$.after_update.push(t)}const a=[],g=[];let u=[];const p=[],k=Promise.resolve();let b=!1;function v(){b||(b=!0,k.then(M))}function K(){return v(),k}function O(t){u.push(t)}function L(t){p.push(t)}const d=new Set;let c=0;function M(){if(c!==0)return;const t=f;do{try{for(;c<a.length;){const n=a[c];c++,h(n),z(n.$$)}}catch(n){throw a.length=0,c=0,n}for(h(null),a.length=0,c=0;g.length;)g.pop()();for(let n=0;n<u.length;n+=1){const e=u[n];d.has(e)||(d.add(e),e())}u.length=0}while(a.length);for(;p.length;)p.pop()();b=!1,d.clear(),h(t)}function z(t){if(t.fragment!==null){t.update(),E(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(O)}}function N(t){const n=[],e=[];u.forEach(r=>t.indexOf(r)===-1?n.push(r):e.push(r)),e.forEach(r=>r()),u=n}export{J as a,g as b,C as c,D as d,B as e,U as f,H as g,L as h,F as i,M as j,P as k,A as l,O as m,x as n,I as o,N as p,f as q,E as r,S as s,K as t,G as u,h as v,j as w,a as x,v as y};
|
||||
@@ -0,0 +1 @@
|
||||
function x(){}function w(t,n){for(const e in n)t[e]=n[e];return t}function j(t){return t()}function D(){return Object.create(null)}function E(t){t.forEach(j)}function F(t){return typeof t=="function"}function P(t,n){return t!=t?n==n:t!==n||t&&typeof t=="object"||typeof t=="function"}let i;function S(t,n){return t===n?!0:(i||(i=document.createElement("a")),i.href=n,t===i.href)}function U(t){return Object.keys(t).length===0}function q(t,...n){if(t==null){for(const r of n)r(void 0);return x}const e=t.subscribe(...n);return e.unsubscribe?()=>e.unsubscribe():e}function A(t,n,e){t.$$.on_destroy.push(q(n,e))}function B(t,n,e,r){if(t){const o=m(t,n,e,r);return t[0](o)}}function m(t,n,e,r){return t[1]&&r?w(e.ctx.slice(),t[1](r(n))):e.ctx}function C(t,n,e,r){if(t[2]&&r){const o=t[2](r(e));if(n.dirty===void 0)return o;if(typeof o=="object"){const l=[],_=Math.max(n.dirty.length,o.length);for(let s=0;s<_;s+=1)l[s]=n.dirty[s]|o[s];return l}return n.dirty|o}return n.dirty}function G(t,n,e,r,o,l){if(o){const _=m(n,e,r,l);t.p(_,o)}}function H(t){if(t.ctx.length>32){const n=[],e=t.ctx.length/32;for(let r=0;r<e;r++)n[r]=-1;return n}return-1}let f;function h(t){f=t}function g(){if(!f)throw new Error("Function called outside component initialization");return f}function I(t){g().$$.on_mount.push(t)}function J(t){g().$$.after_update.push(t)}function K(t){g().$$.on_destroy.push(t)}const a=[],y=[];let u=[];const p=[],k=Promise.resolve();let b=!1;function v(){b||(b=!0,k.then(z))}function L(){return v(),k}function O(t){u.push(t)}function N(t){p.push(t)}const d=new Set;let c=0;function z(){if(c!==0)return;const t=f;do{try{for(;c<a.length;){const n=a[c];c++,h(n),M(n.$$)}}catch(n){throw a.length=0,c=0,n}for(h(null),a.length=0,c=0;y.length;)y.pop()();for(let n=0;n<u.length;n+=1){const e=u[n];d.has(e)||(d.add(e),e())}u.length=0}while(a.length);for(;p.length;)p.pop()();b=!1,d.clear(),h(t)}function M(t){if(t.fragment!==null){t.update(),E(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(O)}}function Q(t){const n=[],e=[];u.forEach(r=>t.indexOf(r)===-1?n.push(r):e.push(r)),e.forEach(r=>r()),u=n}export{J as a,y as b,B as c,C as d,A as e,S as f,H as g,N as h,K as i,O as j,D as k,z as l,F as m,x as n,I as o,U as p,Q as q,E as r,P as s,L as t,G as u,f as v,h as w,j as x,a as y,v as z};
|
||||
@@ -1 +0,0 @@
|
||||
import{n as d,s as E}from"./scheduler.89bf212d.js";const u=[];function p(e,t=d){let n;const o=new Set;function r(s){if(E(e,s)&&(e=s,n)){const c=!u.length;for(const l of o)l[1](),u.push(l,e);if(c){for(let l=0;l<u.length;l+=2)u[l][0](u[l+1]);u.length=0}}}function i(s){r(s(e))}function a(s,c=d){const l=[s,c];return o.add(l),o.size===1&&(n=t(r,i)||d),s(e),()=>{o.delete(l),o.size===0&&n&&(n(),n=null)}}return{set:r,update:i,subscribe:a}}var g;const w=((g=globalThis.__sveltekit_rc3sez)==null?void 0:g.base)??"";var k;const A=((k=globalThis.__sveltekit_rc3sez)==null?void 0:k.assets)??w,R="1703310944347",I="sveltekit:snapshot",x="sveltekit:scroll",O="sveltekit:index",_={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},v=location.origin;function U(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function L(){return{x:pageXOffset,y:pageYOffset}}function f(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const b={..._,"":_.hover};function m(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function N(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=m(e)}}function z(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||T(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=(n==null?void 0:n.origin)===v&&e.hasAttribute("download");return{url:n,external:r,target:o,download:i}}function P(e){let t=null,n=null,o=null,r=null,i=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=f(s,"preload-code")),r===null&&(r=f(s,"preload-data")),t===null&&(t=f(s,"keepfocus")),n===null&&(n=f(s,"noscroll")),i===null&&(i=f(s,"reload")),a===null&&(a=f(s,"replacestate")),s=m(s);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:b[o??"off"],preload_data:b[r??"off"],keep_focus:c(t),noscroll:c(n),reload:c(i),replace_state:c(a)}}function h(e){const t=p(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function i(a){let s;return t.subscribe(c=>{(s===void 0||n&&c!==s)&&a(s=c)})}return{notify:o,set:r,subscribe:i}}function S(){const{set:e,subscribe:t}=p(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${A}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==R;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function T(e,t){return e.origin!==v||!e.pathname.startsWith(t)}function V(e){e.client}const Y={url:h({}),page:h({}),navigating:p(null),updated:S()};export{O as I,_ as P,x as S,I as a,z as b,P as c,Y as d,w as e,N as f,U as g,V as h,T as i,v as o,L as s};
|
||||
@@ -0,0 +1 @@
|
||||
import{n as d,s as E}from"./scheduler.eb55a42e.js";const u=[];function p(e,t=d){let n;const o=new Set;function r(s){if(E(e,s)&&(e=s,n)){const c=!u.length;for(const l of o)l[1](),u.push(l,e);if(c){for(let l=0;l<u.length;l+=2)u[l][0](u[l+1]);u.length=0}}}function i(s){r(s(e))}function a(s,c=d){const l=[s,c];return o.add(l),o.size===1&&(n=t(r,i)||d),s(e),()=>{o.delete(l),o.size===0&&n&&(n(),n=null)}}return{set:r,update:i,subscribe:a}}var g;const w=((g=globalThis.__sveltekit_h3barf)==null?void 0:g.base)??"";var k;const A=((k=globalThis.__sveltekit_h3barf)==null?void 0:k.assets)??w,R="1703650186236",I="sveltekit:snapshot",x="sveltekit:scroll",O="sveltekit:index",_={tap:1,hover:2,viewport:3,eager:4,off:-1},v=location.origin;function U(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function L(){return{x:pageXOffset,y:pageYOffset}}function f(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const b={..._,"":_.hover};function m(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function N(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=m(e)}}function P(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||T(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=(n==null?void 0:n.origin)===v&&e.hasAttribute("download");return{url:n,external:r,target:o,download:i}}function V(e){let t=null,n=null,o=null,r=null,i=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=f(s,"preload-code")),r===null&&(r=f(s,"preload-data")),t===null&&(t=f(s,"keepfocus")),n===null&&(n=f(s,"noscroll")),i===null&&(i=f(s,"reload")),a===null&&(a=f(s,"replacestate")),s=m(s);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:b[o??"off"],preload_data:b[r??"off"],keep_focus:c(t),noscroll:c(n),reload:c(i),replace_state:c(a)}}function h(e){const t=p(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function i(a){let s;return t.subscribe(c=>{(s===void 0||n&&c!==s)&&a(s=c)})}return{notify:o,set:r,subscribe:i}}function S(){const{set:e,subscribe:t}=p(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${A}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==R;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function T(e,t){return e.origin!==v||!e.pathname.startsWith(t)}function Y(e){e.client}const q={url:h({}),page:h({}),navigating:p(null),updated:S()};export{O as I,_ as P,x as S,I as a,P as b,V as c,q as d,w as e,N as f,U as g,Y as h,T as i,v as o,L as s};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{s as r,c as l,u as i,g as u,d as f}from"../chunks/scheduler.89bf212d.js";import{S as c,i as _,d as p,t as d}from"../chunks/index.6b8f49fb.js";const m=!0;async function g({url:o}){let s="";return typeof process>"u"&&(s=o.searchParams.get("comfyUrl")||""),{comfyUrl:s}}const h=Object.freeze(Object.defineProperty({__proto__:null,load:g,prerender:m},Symbol.toStringTag,{value:"Module"}));function y(o){let s;const a=o[1].default,t=l(a,o,o[0],null);return{c(){t&&t.c()},l(e){t&&t.l(e)},m(e,n){t&&t.m(e,n),s=!0},p(e,[n]){t&&t.p&&(!s||n&1)&&i(t,a,e,e[0],s?f(a,e[0],n,null):u(e[0]),null)},i(e){s||(p(t,e),s=!0)},o(e){d(t,e),s=!1},d(e){t&&t.d(e)}}}function $(o,s,a){let{$$slots:t={},$$scope:e}=s;return o.$$set=n=>{"$$scope"in n&&a(0,e=n.$$scope)},[e,t]}class v extends c{constructor(s){super(),_(this,s,$,y,r,{})}}export{v as component,h as universal};
|
||||
import{s as r,c as l,u as i,g as u,d as f}from"../chunks/scheduler.eb55a42e.js";import{S as c,i as _,d as p,t as d}from"../chunks/index.71d39c14.js";const m=!0;async function g({url:o}){let s="";return typeof process>"u"&&(s=o.searchParams.get("comfyUrl")||""),{comfyUrl:s}}const h=Object.freeze(Object.defineProperty({__proto__:null,load:g,prerender:m},Symbol.toStringTag,{value:"Module"}));function y(o){let s;const a=o[1].default,t=l(a,o,o[0],null);return{c(){t&&t.c()},l(e){t&&t.l(e)},m(e,n){t&&t.m(e,n),s=!0},p(e,[n]){t&&t.p&&(!s||n&1)&&i(t,a,e,e[0],s?f(a,e[0],n,null):u(e[0]),null)},i(e){s||(p(t,e),s=!0)},o(e){d(t,e),s=!1},d(e){t&&t.d(e)}}}function $(o,s,a){let{$$slots:t={},$$scope:e}=s;return o.$$set=n=>{"$$scope"in n&&a(0,e=n.$$scope)},[e,t]}class v extends c{constructor(s){super(),_(this,s,$,y,r,{})}}export{v as component,h as universal};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{s as x,n as _,e as S}from"../chunks/scheduler.89bf212d.js";import{S as j,i as q,g as f,m as d,s as y,h as g,j as h,n as v,f as u,c as C,a as m,x as $,o as E}from"../chunks/index.6b8f49fb.js";import{d as H}from"../chunks/singletons.1bbd47e3.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},k={subscribe(s){return P().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=y(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=C(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return S(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,x,{})}};export{F as component};
|
||||
import{s as x,n as _,e as S}from"../chunks/scheduler.eb55a42e.js";import{S as j,i as q,g as f,m as d,s as y,h as g,j as h,n as v,f as u,c as C,a as m,x as $,o as E}from"../chunks/index.71d39c14.js";import{d as H}from"../chunks/singletons.802818fa.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},k={subscribe(s){return P().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=y(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=C(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return S(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,x,{})}};export{F as component};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":"1703310944347"}
|
||||
{"version":"1703650186236"}
|
||||
+13
-12
@@ -5,24 +5,25 @@
|
||||
<link rel="icon" href="./favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<link href="./_app/immutable/assets/0.6da1d72f.css" rel="stylesheet">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/start.fbf5c532.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/scheduler.89bf212d.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.1bbd47e3.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/app.60fd5cee.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/index.6b8f49fb.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/0.4bf65cd8.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/2.90abaca3.js">
|
||||
<link href="./_app/immutable/assets/0.c831bdfa.css" rel="stylesheet">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/start.8f35d572.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/scheduler.eb55a42e.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.802818fa.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/app.e7b61360.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/index.71d39c14.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/0.6a97964b.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/2.5b741140.js">
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
<div style="display: contents"> <div class="flex"><ul class="menu menu-horizontal bg-base-200 rounded-box flex-1"><li><button class="active"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" d="M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"></path></svg>
|
||||
Outputs</button></li> <li><button class=""><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" d="M17.593 3.322c1.1.128 1.907 1.077 1.907 2.185V21L12 17.25 4.5 21V5.507c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0111.186 0z"></path></svg>
|
||||
Saves</button></li> <li><button class=""><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" d="M12.75 19.5v-.75a7.5 7.5 0 00-7.5-7.5H4.5m0-6.75h.75c7.87 0 14.25 6.38 14.25 14.25v.75M6 18.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"></path></svg>
|
||||
Sources</button></li></ul> <div class="hidden sm:flex flex-0 items-center justify-center p-2" data-svelte-h="svelte-1ihc90r"><a href="https://github.com/talesofai/comfyui-browser" target="_blank"><img src="https://img.shields.io/github/stars/talesofai/comfyui-browser?style=social" alt="stars - comfyui-browser"></a></div></div> <div class="max-w-full text-sm breadcrumbs flex flex-row ml-4"><ul class="basis-3/4"><li><button data-svelte-h="svelte-1paj67z">Root</button></li> <li><button></button></li></ul> <input type="text" placeholder="Filter by filename" class="input input-bordered w-full h-full rounded-none border-slate-600 text-sm basis-1/4" value=""></div> <div class="grid grid-cols-4 lg:grid-cols-6 gap-2"></div> <div class="w-full h-full flex items-center justify-center"><span class="font-bold text-4xl">It's empty here.</span></div>
|
||||
Sources</button></li> <li><button class=""><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" d="m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"></path></svg>
|
||||
Models</button></li></ul> <div class="hidden sm:flex flex-0 items-center justify-center p-2" data-svelte-h="svelte-1ihc90r"><a href="https://github.com/talesofai/comfyui-browser" target="_blank"><img src="https://img.shields.io/github/stars/talesofai/comfyui-browser?style=social" alt="stars - comfyui-browser"></a></div></div> <div class="max-w-full text-sm breadcrumbs flex flex-row ml-4"><ul class="basis-3/4"><li><button data-svelte-h="svelte-1paj67z">Root</button></li> <li><button></button></li></ul> <input type="text" placeholder="Filter by filename" class="input input-bordered w-full h-full rounded-none border-slate-600 text-sm basis-1/4" value=""></div> <div class="grid grid-cols-4 lg:grid-cols-6 gap-2"></div> <div class="w-full h-full flex items-center justify-center"><span class="font-bold text-4xl">It's empty here.</span></div>
|
||||
|
||||
<script>
|
||||
{
|
||||
__sveltekit_rc3sez = {
|
||||
__sveltekit_h3barf = {
|
||||
base: new URL(".", location).pathname.slice(0, -1),
|
||||
env: {}
|
||||
};
|
||||
@@ -32,8 +33,8 @@
|
||||
const data = [null,null];
|
||||
|
||||
Promise.all([
|
||||
import("./_app/immutable/entry/start.fbf5c532.js"),
|
||||
import("./_app/immutable/entry/app.60fd5cee.js")
|
||||
import("./_app/immutable/entry/start.8f35d572.js"),
|
||||
import("./_app/immutable/entry/app.e7b61360.js")
|
||||
]).then(([kit, app]) => {
|
||||
kit.start(app, element, {
|
||||
node_ids: [0, 2],
|
||||
|
||||
+38
-20
@@ -59,8 +59,11 @@ class BrowserDialog extends ComfyDialog {
|
||||
height: "100%",
|
||||
},
|
||||
}, [
|
||||
$el("div", {
|
||||
$: (e) => (this.textElement = e), style: { height: "inherit",
|
||||
$el("iframe", {
|
||||
src: browserUrl + "?timestamp=" + Date.now(),
|
||||
style: {
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
},
|
||||
}),
|
||||
...this.createButtons(),
|
||||
@@ -101,6 +104,16 @@ class BrowserDialog extends ComfyDialog {
|
||||
closeBtn,
|
||||
browseBtn,
|
||||
toggleSidePanelBtn,
|
||||
/*$el("span", {*/
|
||||
/*textContent: "Tips: press 'B' to toggle me",*/
|
||||
/*style: {*/
|
||||
/*color: "var(--input-text)",*/
|
||||
/*right: 0,*/
|
||||
/*position: "absolute",*/
|
||||
/*lineHeight: "28.5px",*/
|
||||
/*marginRight: "2px",*/
|
||||
/*},*/
|
||||
/*}),*/
|
||||
]),
|
||||
];
|
||||
}
|
||||
@@ -145,14 +158,18 @@ class BrowserDialog extends ComfyDialog {
|
||||
this.element.style.display = "none";
|
||||
}
|
||||
|
||||
show(html) {
|
||||
if (typeof html === "string") {
|
||||
this.textElement.innerHTML = html;
|
||||
} else {
|
||||
this.textElement.replaceChildren(html);
|
||||
}
|
||||
show() {
|
||||
this.element.style.display = "flex";
|
||||
}
|
||||
|
||||
toggle() {
|
||||
const e = this.element;
|
||||
if (e.style.display === "none") {
|
||||
this.show();
|
||||
} else {
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showToast(text, onClick) {
|
||||
@@ -189,16 +206,6 @@ function showToast(text, onClick) {
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
function showBrowserDialog(browserDialog) {
|
||||
browserDialog.show($el("iframe", {
|
||||
src: browserUrl + "?timestamp=" + Date.now(),
|
||||
style: {
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
name: "ComfyUI.Browser",
|
||||
init() {
|
||||
@@ -206,6 +213,17 @@ app.registerExtension({
|
||||
async setup() {
|
||||
const browserDialog = new BrowserDialog();
|
||||
|
||||
document.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'b') {
|
||||
if (event.target.matches('input, textarea')) {
|
||||
return;
|
||||
}
|
||||
|
||||
browserDialog.toggle();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
app.ui.menuContainer.appendChild(
|
||||
$el("div.comfy-list", {
|
||||
style: {
|
||||
@@ -224,7 +242,7 @@ app.registerExtension({
|
||||
//color: "var(--descrip-text) !important",
|
||||
width: "80%",
|
||||
},
|
||||
onclick: () => { showBrowserDialog(browserDialog); },
|
||||
onclick: () => { browserDialog.show() },
|
||||
}),
|
||||
$el("button", {
|
||||
id: "comfyui-browser-collect-button",
|
||||
@@ -263,7 +281,7 @@ app.registerExtension({
|
||||
saveBtn.style = originBtnStyle + "border-color: green;";
|
||||
showToast(
|
||||
'Saved. Click me to open.',
|
||||
() => { showBrowserDialog(browserDialog); },
|
||||
() => { browserDialog.show() },
|
||||
);
|
||||
} else {
|
||||
saveBtn.style = originBtnStyle + "border-color: red;";
|
||||
|
||||
Reference in New Issue
Block a user