Improved Lora data extraction process
Enhanced internationalization support Beautified the user interface.pull/57/head
parent
7f346da73d
commit
9edb42710d
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite App</title>
|
||||
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-7b355f46.js"></script>
|
||||
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-8055eb0e.js"></script>
|
||||
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-2e911f74.css">
|
||||
</head>
|
||||
|
||||
|
|
|
|||
|
|
@ -158,8 +158,16 @@ def read_info_from_image(image) -> str:
|
|||
re_param_code = r'\s*([\w ]+):\s*("(?:\\"[^,]|\\"|\\|[^\"])+"|[^,]*)(?:,|$)'
|
||||
re_param = re.compile(re_param_code)
|
||||
re_imagesize = re.compile(r"^(\d+)x(\d+)$")
|
||||
re_lora_prompt = re.compile("<lora:([\w_]+):([\d.]+)>")
|
||||
re_lora_prompt = re.compile("<lora:([\w_\s]+):([\d.]+)>")
|
||||
re_parens = re.compile(r'[\\/\[\](){}]+')
|
||||
re_lora_extract = re.compile(r"([\w_\s]+)(?:\d+)?")
|
||||
|
||||
def lora_extract(lora:str):
|
||||
"""
|
||||
提取yoshino yoshino(2a79aa5adc4a)
|
||||
"""
|
||||
res = re_lora_extract.match(lora)
|
||||
return res.group(1) if res else lora
|
||||
|
||||
def parse_prompt(x:str):
|
||||
x = re.sub(re_parens, '', x.lower().replace(',',',').replace('-',' ').replace('_', ' '))
|
||||
|
|
@ -175,7 +183,9 @@ def parse_prompt(x:str):
|
|||
if lora_res:
|
||||
lora_list.append({ "name": lora_res.group(1), "value": float(lora_res.group(2))})
|
||||
else:
|
||||
res.append(tag[0:idx_colon])
|
||||
tag = tag[0:idx_colon]
|
||||
if len(tag):
|
||||
res.append(tag)
|
||||
else:
|
||||
res.append(tag)
|
||||
return res, lora_list
|
||||
|
|
@ -221,7 +231,7 @@ def parse_generation_parameters(x: str):
|
|||
if k_s.startswith("AddNet Module") and str(res[k]).lower() == "lora":
|
||||
model = res[k_s.replace("Module", "Model")]
|
||||
value = res.get(k_s.replace("Module", "Weight A"), "1")
|
||||
lora.append({ "name": model, "value": float(value) })
|
||||
lora.append({ "name": lora_extract(model), "value": float(value) })
|
||||
return res, unique_by(lora, lambda x:x['name']), unique_by(pos_prompt, lambda x:x), unique_by(neg_prompt, lambda x:x)
|
||||
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{d as F,r as k,aW as G,a$ as N,n as U,K as V,L as $,c as l,N as n,O as s,Q as w,T as x,U as h,Y as B,aR as R,a6 as D,a8 as E}from"./index-7b355f46.js";import{u as O,b as Q,f as q,d as j,h as H,j as K,k as L,t as W,M as Y,S as J}from"./FileItem-b6918b03.js";import{g as P}from"./db-a0f7d9d4.js";import"./index-87afe530.js";import"./_baseIteratee-2c7ebf4e.js";import"./button-dad47e51.js";const X={class:"hint"},Z=F({__name:"MatchedImageGrid",props:{tabIdx:null,paneIdx:null,selectedTagIds:null,id:null},setup(y){const u=y,o=k(),m=G(new N(-1,0,-1,"throw"));U(()=>u.selectedTagIds,async()=>{var e;const{res:a}=m.pushAction(()=>P(u.selectedTagIds));o.value=await a,(e=p.value)==null||e.scrollToItem(0)},{immediate:!0});const p=k(),f={tabIdx:-1,target:"local",paneIdx:-1},{stackViewEl:b,multiSelectedIdxs:v}=O().toRefs(),{itemSize:g,gridItems:M}=Q(f),{showMenuIdx:r}=q(),{showGenInfo:d,imageGenInfo:I,q:C,onContextMenuClick:S}=j(f,{openNext:R}),T=async(a,e,i)=>{if(await S(a,e,i),a.key==="deleteFiles"){const c=v.value.includes(i)?v.value:[i];o.value=o.value.filter((_,t)=>!c.includes(t))}};return(a,e)=>{const i=D,c=Y,_=J;return V(),$("div",{class:"container",ref_key:"stackViewEl",ref:b},[l(_,{size:"large",spinning:!m.isIdle},{default:n(()=>[l(c,{visible:s(d),"onUpdate:visible":e[1]||(e[1]=t=>w(d)?d.value=t:null),width:"70vw","mask-closable":"",onOk:e[2]||(e[2]=t=>d.value=!1)},{cancelText:n(()=>[]),default:n(()=>[l(i,{active:"",loading:!s(C).isIdle},{default:n(()=>[x("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:e[0]||(e[0]=t=>s(H)(s(I),"copied"))},[x("div",X,h(a.$t("doubleClickToCopy")),1),B(" "+h(s(I)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),l(s(K),{ref_key:"scroller",ref:p,class:"file-list",items:o.value||[],"item-size":s(g).first,"key-field":"fullpath","item-secondary-size":s(g).second,gridItems:s(M)},{default:n(({item:t,index:z})=>[l(L,{idx:z,file:t,"show-menu-idx":s(r),"onUpdate:showMenuIdx":e[3]||(e[3]=A=>w(r)?r.value=A:null),"full-screen-preview-image-url":s(W)(t),onContextMenuClick:T},null,8,["idx","file","show-menu-idx","full-screen-preview-image-url"])]),_:1},8,["items","item-size","item-secondary-size","gridItems"])]),_:1},8,["spinning"])],512)}}});const ne=E(Z,[["__scopeId","data-v-e4f22d78"]]);export{ne as default};
|
||||
import{d as F,r as k,aW as G,a$ as N,n as U,K as V,L as $,c as l,N as n,O as s,Q as w,T as x,U as h,Y as B,aR as R,a6 as D,a8 as E}from"./index-8055eb0e.js";import{u as O,b as Q,f as q,d as j,h as H,j as K,k as L,t as W,M as Y,S as J}from"./FileItem-78e64a0e.js";import{g as P}from"./db-b6f52049.js";import"./index-592b8738.js";import"./_baseIteratee-011cf2cf.js";import"./button-2d1093df.js";const X={class:"hint"},Z=F({__name:"MatchedImageGrid",props:{tabIdx:null,paneIdx:null,selectedTagIds:null,id:null},setup(y){const u=y,o=k(),m=G(new N(-1,0,-1,"throw"));U(()=>u.selectedTagIds,async()=>{var e;const{res:a}=m.pushAction(()=>P(u.selectedTagIds));o.value=await a,(e=p.value)==null||e.scrollToItem(0)},{immediate:!0});const p=k(),f={tabIdx:-1,target:"local",paneIdx:-1},{stackViewEl:b,multiSelectedIdxs:v}=O().toRefs(),{itemSize:g,gridItems:M}=Q(f),{showMenuIdx:r}=q(),{showGenInfo:d,imageGenInfo:I,q:C,onContextMenuClick:S}=j(f,{openNext:R}),T=async(a,e,i)=>{if(await S(a,e,i),a.key==="deleteFiles"){const c=v.value.includes(i)?v.value:[i];o.value=o.value.filter((_,t)=>!c.includes(t))}};return(a,e)=>{const i=D,c=Y,_=J;return V(),$("div",{class:"container",ref_key:"stackViewEl",ref:b},[l(_,{size:"large",spinning:!m.isIdle},{default:n(()=>[l(c,{visible:s(d),"onUpdate:visible":e[1]||(e[1]=t=>w(d)?d.value=t:null),width:"70vw","mask-closable":"",onOk:e[2]||(e[2]=t=>d.value=!1)},{cancelText:n(()=>[]),default:n(()=>[l(i,{active:"",loading:!s(C).isIdle},{default:n(()=>[x("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:e[0]||(e[0]=t=>s(H)(s(I),"copied"))},[x("div",X,h(a.$t("doubleClickToCopy")),1),B(" "+h(s(I)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),l(s(K),{ref_key:"scroller",ref:p,class:"file-list",items:o.value||[],"item-size":s(g).first,"key-field":"fullpath","item-secondary-size":s(g).second,gridItems:s(M)},{default:n(({item:t,index:z})=>[l(L,{idx:z,file:t,"show-menu-idx":s(r),"onUpdate:showMenuIdx":e[3]||(e[3]=A=>w(r)?r.value=A:null),"full-screen-preview-image-url":s(W)(t),onContextMenuClick:T},null,8,["idx","file","show-menu-idx","full-screen-preview-image-url"])]),_:1},8,["items","item-size","item-secondary-size","gridItems"])]),_:1},8,["spinning"])],512)}}});const ne=E(Z,[["__scopeId","data-v-e4f22d78"]]);export{ne as default};
|
||||
|
|
@ -0,0 +1 @@
|
|||
.container[data-v-8c324b9d]{height:var(--pane-max-height);overflow:auto;display:flex;flex-direction:column;align-items:stretch}.container .generate-idx-hint[data-v-8c324b9d]{margin:64px;padding:64px;font-size:2em;text-align:center;background-color:var(--zp-secondary-background);white-space:pre-line;line-height:2.5em;border-radius:16px}.container .select[data-v-8c324b9d]{padding:8px}.container .search-bar[data-v-8c324b9d]{padding:8px;display:flex}.container .list-container[data-v-8c324b9d]{background-color:var(--zp-secondary-background);overflow:scroll}.container .tag-list[data-v-8c324b9d]{list-style:none;margin:16px;border-radius:16px;background:var(--zp-primary-background);padding:8px}.container .tag-list .cat-name[data-v-8c324b9d]{position:sticky;top:0;padding:4px 16px;background:var(--zp-primary-background);border-left:4px solid var(--primary-color);margin:4px}.container .tag-list .tag[data-v-8c324b9d]{border:2px solid var(--zp-secondary);color:var(--zp-primary);border-radius:999px;padding:4px 16px;margin:4px;display:inline-block;cursor:pointer;max-width:256px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.container .tag-list .tag.selected[data-v-8c324b9d]{color:var(--primary-color);border:2px solid var(--primary-color)}
|
||||
|
|
@ -1 +0,0 @@
|
|||
import{ax as N,aw as V,cc as D,b$ as E,d as U,V as q,aW as G,a$ as L,r as B,A as I,aa as M,p as P,K as l,L as p,$ as b,x as y,T as f,c as j,O as m,a2 as z,W as x,N as A,Y as k,U as w,Z as $,a4 as W,cg as K,a8 as Q}from"./index-7b355f46.js";/* empty css */import{a as C,u as Y}from"./db-a0f7d9d4.js";import{b as Z}from"./_baseIteratee-2c7ebf4e.js";import{B as H}from"./button-dad47e51.js";function J(s,n,a,r){for(var e=-1,t=s==null?0:s.length;++e<t;){var i=s[e];n(r,i,a(i),s)}return r}function R(s){return function(n,a,r){for(var e=-1,t=Object(n),i=r(n),g=i.length;g--;){var h=i[s?g:++e];if(a(t[h],h,t)===!1)break}return n}}var X=R();const ee=X;function ae(s,n){return s&&ee(s,n,N)}function te(s,n){return function(a,r){if(a==null)return a;if(!V(a))return s(a,r);for(var e=a.length,t=n?e:-1,i=Object(a);(n?t--:++t<e)&&r(i[t],t,i)!==!1;);return a}}var se=te(ae);const ne=se;function re(s,n,a,r){return ne(s,function(e,t,i){n(r,e,a(e),i)}),r}function oe(s,n){return function(a,r){var e=D(a)?J:re,t=n?n():{};return e(a,s,Z(r),t)}}var ie=Object.prototype,ce=ie.hasOwnProperty,le=oe(function(s,n,a){ce.call(s,a)?s[a].push(n):E(s,a,[n])});const ue=le,de={class:"container"},pe={class:"search-bar"},ge={class:"list-container"},he={class:"cat-name"},ve=["onClick"],fe=U({__name:"TagSearch",props:{tabIdx:null,paneIdx:null},setup(s){const n=s,a=q(),r=G(new L(-1,0,-1,"throw")),e=B(),t=B(new Set),i=I(()=>e.value?e.value.tags.slice().sort((o,c)=>c.count-o.count):[]),g=["Model","Sampler","lora","pos","size"].reduce((o,c,v)=>(o[c]=v,o),{}),h=I(()=>Object.entries(ue(i.value,o=>o.type)).sort((o,c)=>g[o[0]]-g[c[0]])),O=M();P(async()=>{e.value=await C(),e.value.img_count&&e.value.expired&&S()});const S=async()=>{r.pushAction(async()=>{await Y(),e.value=await C()})},T=()=>{a.openTagSearchMatchedImageGridInRight(n.tabIdx,O,Array.from(t.value))},_=(o,c=!1)=>(c?`[${o.type}] `:"")+(o.display_name?`${o.display_name} : ${o.name}`:o.name);return(o,c)=>{const v=H;return l(),p("div",de,[b("",!0),e.value?(l(),p(y,{key:1},[f("div",null,[f("div",pe,[j(m(z),{conv:{value:u=>u.id,text:_,optionText:u=>_(u,!0)},mode:"multiple",style:{width:"100%"},options:m(i),value:Array.from(t.value),placeholder:"Select tags to match images","onUpdate:value":c[0]||(c[0]=u=>t.value=new Set(u))},null,8,["conv","options","value"]),e.value.expired||!e.value.img_count?(l(),x(v,{key:0,onClick:S,loading:!r.isIdle,type:"primary"},{default:A(()=>[k(w(e.value.img_count===0?"Generate index for search image":"Update index"),1)]),_:1},8,["loading"])):(l(),x(v,{key:1,type:"primary",onClick:T,loading:!r.isIdle,disabled:!t.value.size},{default:A(()=>[k("Search ")]),_:1},8,["loading","disabled"]))])]),f("div",ge,[(l(!0),p(y,null,$(m(h),([u,F])=>(l(),p("ul",{class:"tag-list",key:u},[f("h3",he,w(o.$t(u)),1),(l(!0),p(y,null,$(F,d=>(l(),p("li",{key:d.id,class:W(["tag",{selected:t.value.has(d.id)}]),onClick:me=>t.value.has(d.id)?t.value.delete(d.id):t.value.add(d.id)},[t.value.has(d.id)?(l(),x(m(K),{key:0})):b("",!0),k(" "+w(_(d)),1)],10,ve))),128))]))),128))])],64)):b("",!0)])}}});const we=Q(fe,[["__scopeId","data-v-bc20e7bb"]]);export{we as default};
|
||||
|
|
@ -0,0 +1 @@
|
|||
import{ax as N,aw as V,cc as D,b$ as E,d as U,V as q,aW as G,a$ as L,r as $,A as B,aa as M,p as P,K as u,L as p,$ as _,x as k,T as y,c as j,O as g,a2 as z,W as x,N as S,Y as w,U as v,Z as A,a4 as W,cg as H,a8 as K}from"./index-8055eb0e.js";/* empty css */import{a as C,u as Q}from"./db-b6f52049.js";import{b as Y}from"./_baseIteratee-011cf2cf.js";import{B as Z}from"./button-2d1093df.js";function J(s,n,a,o){for(var e=-1,t=s==null?0:s.length;++e<t;){var i=s[e];n(o,i,a(i),s)}return o}function R(s){return function(n,a,o){for(var e=-1,t=Object(n),i=o(n),h=i.length;h--;){var f=i[s?h:++e];if(a(t[f],f,t)===!1)break}return n}}var X=R();const ee=X;function ae(s,n){return s&&ee(s,n,N)}function te(s,n){return function(a,o){if(a==null)return a;if(!V(a))return s(a,o);for(var e=a.length,t=n?e:-1,i=Object(a);(n?t--:++t<e)&&o(i[t],t,i)!==!1;);return a}}var se=te(ae);const ne=se;function re(s,n,a,o){return ne(s,function(e,t,i){n(o,e,a(e),i)}),o}function oe(s,n){return function(a,o){var e=D(a)?J:re,t=n?n():{};return e(a,s,Y(o),t)}}var ie=Object.prototype,le=ie.hasOwnProperty,ue=oe(function(s,n,a){le.call(s,a)?s[a].push(n):E(s,a,[n])});const ce=ue,de={class:"container"},pe={class:"search-bar"},ge={key:0,class:"generate-idx-hint"},he={class:"list-container"},ve={class:"cat-name"},fe=["onClick"],me=U({__name:"TagSearch",props:{tabIdx:null,paneIdx:null},setup(s){const n=s,a=q(),o=G(new L(-1,0,-1,"throw")),e=$(),t=$(new Set),i=B(()=>e.value?e.value.tags.slice().sort((r,l)=>l.count-r.count):[]),h=["Model","Sampler","lora","pos","size"].reduce((r,l,m)=>(r[l]=m,r),{}),f=B(()=>Object.entries(ce(i.value,r=>r.type)).sort((r,l)=>h[r[0]]-h[l[0]])),O=M();P(async()=>{e.value=await C(),e.value.img_count&&e.value.expired&&I()});const I=async()=>{o.pushAction(async()=>{await Q(),e.value=await C()})},T=()=>{a.openTagSearchMatchedImageGridInRight(n.tabIdx,O,Array.from(t.value))},b=(r,l=!1)=>(l?`[${r.type}] `:"")+(r.display_name?`${r.display_name} : ${r.name}`:r.name);return(r,l)=>{const m=Z;return u(),p("div",de,[_("",!0),e.value?(u(),p(k,{key:1},[y("div",null,[y("div",pe,[j(g(z),{conv:{value:c=>c.id,text:b,optionText:c=>b(c,!0)},mode:"multiple",style:{width:"100%"},options:g(i),value:Array.from(t.value),disabled:!g(i).length,placeholder:"Select tags to match images","onUpdate:value":l[0]||(l[0]=c=>t.value=new Set(c))},null,8,["conv","options","value","disabled"]),e.value.expired||!e.value.img_count?(u(),x(m,{key:0,onClick:I,loading:!o.isIdle,type:"primary"},{default:S(()=>[w(v(e.value.img_count===0?r.$t("generateIndexHint"):r.$t("UpdateIndex")),1)]),_:1},8,["loading"])):(u(),x(m,{key:1,type:"primary",onClick:T,loading:!o.isIdle,disabled:!t.value.size},{default:S(()=>[w(v(r.$t("search")),1)]),_:1},8,["loading","disabled"]))])]),g(i).length?_("",!0):(u(),p("p",ge,v(r.$t("needGenerateIdx")),1)),y("div",he,[(u(!0),p(k,null,A(g(f),([c,F])=>(u(),p("ul",{class:"tag-list",key:c},[y("h3",ve,v(r.$t(c)),1),(u(!0),p(k,null,A(F,d=>(u(),p("li",{key:d.id,class:W(["tag",{selected:t.value.has(d.id)}]),onClick:_e=>t.value.has(d.id)?t.value.delete(d.id):t.value.add(d.id)},[t.value.has(d.id)?(u(),x(g(H),{key:0})):_("",!0),w(" "+v(b(d)),1)],10,fe))),128))]))),128))])],64)):_("",!0)])}}});const Ie=K(me,[["__scopeId","data-v-8c324b9d"]]);export{Ie as default};
|
||||
|
|
@ -1 +0,0 @@
|
|||
.container[data-v-bc20e7bb]{height:var(--pane-max-height);overflow:auto;display:flex;flex-direction:column;align-items:stretch}.container .select[data-v-bc20e7bb]{padding:8px}.container .search-bar[data-v-bc20e7bb]{padding:8px;display:flex}.container .list-container[data-v-bc20e7bb]{background-color:var(--zp-secondary-background);overflow:scroll}.container .tag-list[data-v-bc20e7bb]{list-style:none;margin:16px;border-radius:16px;background:var(--zp-primary-background);padding:8px}.container .tag-list .cat-name[data-v-bc20e7bb]{position:sticky;top:0;padding:4px 16px;background:var(--zp-primary-background);border-left:4px solid var(--primary-color);margin:4px}.container .tag-list .tag[data-v-bc20e7bb]{border:2px solid var(--zp-secondary);color:var(--zp-primary);border-radius:999px;padding:4px 16px;margin:4px;display:inline-block;cursor:pointer}.container .tag-list .tag.selected[data-v-bc20e7bb]{color:var(--primary-color);border:2px solid var(--primary-color)}
|
||||
|
|
@ -1 +1 @@
|
|||
import{ce as M,ch as c,bw as _,ax as g,aS as d,ci as h,aU as E,cj as p,aR as y,cc as C}from"./index-7b355f46.js";function I(n){return function(r){return r==null?void 0:r[n]}}var L=1,w=2;function D(n,r,e,i){var t=e.length,a=t,A=!i;if(n==null)return!a;for(n=Object(n);t--;){var f=e[t];if(A&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++t<a;){f=e[t];var u=f[0],s=n[u],o=f[1];if(A&&f[2]){if(s===void 0&&!(u in n))return!1}else{var R=new M;if(i)var l=i(s,o,u,n,r,R);if(!(l===void 0?c(o,s,L|w,i,R):l))return!1}}return!0}function O(n){return n===n&&!_(n)}function G(n){for(var r=g(n),e=r.length;e--;){var i=r[e],t=n[i];r[e]=[i,t,O(t)]}return r}function P(n,r){return function(e){return e==null?!1:e[n]===r&&(r!==void 0||n in Object(e))}}function F(n){var r=G(n);return r.length==1&&r[0][2]?P(r[0][0],r[0][1]):function(e){return e===n||D(e,n,r)}}function S(n,r,e){var i=n==null?void 0:d(n,r);return i===void 0?e:i}var x=1,U=2;function m(n,r){return h(n)&&O(r)?P(E(n),r):function(e){var i=S(e,n);return i===void 0&&i===r?p(e,n):c(r,i,x|U)}}function K(n){return function(r){return d(r,n)}}function N(n){return h(n)?I(E(n)):K(n)}function $(n){return typeof n=="function"?n:n==null?y:typeof n=="object"?C(n)?m(n[0],n[1]):F(n):N(n)}export{$ as b};
|
||||
import{ce as M,ch as c,bw as _,ax as g,aS as d,ci as h,aU as E,cj as p,aR as y,cc as C}from"./index-8055eb0e.js";function I(n){return function(r){return r==null?void 0:r[n]}}var L=1,w=2;function D(n,r,e,i){var t=e.length,a=t,A=!i;if(n==null)return!a;for(n=Object(n);t--;){var f=e[t];if(A&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++t<a;){f=e[t];var u=f[0],s=n[u],o=f[1];if(A&&f[2]){if(s===void 0&&!(u in n))return!1}else{var R=new M;if(i)var l=i(s,o,u,n,r,R);if(!(l===void 0?c(o,s,L|w,i,R):l))return!1}}return!0}function O(n){return n===n&&!_(n)}function G(n){for(var r=g(n),e=r.length;e--;){var i=r[e],t=n[i];r[e]=[i,t,O(t)]}return r}function P(n,r){return function(e){return e==null?!1:e[n]===r&&(r!==void 0||n in Object(e))}}function F(n){var r=G(n);return r.length==1&&r[0][2]?P(r[0][0],r[0][1]):function(e){return e===n||D(e,n,r)}}function S(n,r,e){var i=n==null?void 0:d(n,r);return i===void 0?e:i}var x=1,U=2;function m(n,r){return h(n)&&O(r)?P(E(n),r):function(e){var i=S(e,n);return i===void 0&&i===r?p(e,n):c(r,i,x|U)}}function K(n){return function(r){return d(r,n)}}function N(n){return h(n)?I(E(n)):K(n)}function $(n){return typeof n=="function"?n:n==null?y:typeof n=="object"?C(n)?m(n[0],n[1]):F(n):N(n)}export{$ as b};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{bC as a}from"./index-7b355f46.js";const n=async()=>(await a.get("/db/basic_info")).data,i=async()=>{await a.post("/db/update_image_data",{},{timeout:1/0})},o=async t=>(await a.get("/db/match_images_by_tags",{params:{tag_ids:t.join()}})).data;export{n as a,o as g,i as u};
|
||||
import{bC as a}from"./index-8055eb0e.js";const n=async()=>(await a.get("/db/basic_info")).data,i=async()=>{await a.post("/db/update_image_data",{},{timeout:1/0})},o=async t=>(await a.get("/db/match_images_by_tags",{params:{tag_ids:t.join()}})).data;export{n as a,o as g,i as u};
|
||||
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
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite App</title>
|
||||
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-7b355f46.js"></script>
|
||||
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-8055eb0e.js"></script>
|
||||
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-2e911f74.css">
|
||||
</head>
|
||||
|
||||
|
|
|
|||
|
|
@ -107,9 +107,18 @@ const zh = {
|
|||
"Sampler": "采样器",
|
||||
"lora": "LoRA",
|
||||
"size": "尺寸",
|
||||
"pos": "正面提示"
|
||||
"pos": "正面提示",
|
||||
|
||||
"generateIndexHint": "生成索引用于搜索图像",
|
||||
'UpdateIndex': '更新索引',
|
||||
needGenerateIdx: '你需要先点击按钮生成索引用于搜索图像\n这个过程可能需要消耗几分钟',
|
||||
search: '搜索'
|
||||
}
|
||||
const en: Record<keyof typeof zh, string> = {
|
||||
needGenerateIdx: 'You need to click the button to generate an index for searching images. \n This process may take a few minutes to complete.',
|
||||
search: 'Search',
|
||||
'UpdateIndex': 'Update index',
|
||||
"generateIndexHint": "Generate index for search image",
|
||||
"Model": "Model",
|
||||
"Sampler": "Sampler",
|
||||
"lora": "LoRA",
|
||||
|
|
|
|||
|
|
@ -51,15 +51,18 @@ const toTagDisplayName = (v: Tag, withType = false) => (withType ? `[${v.type}]
|
|||
<div class="search-bar">
|
||||
<SearchSelect :conv="{ value: v => v.id, text: toTagDisplayName, optionText: v => toTagDisplayName(v, true) }"
|
||||
mode="multiple" style="width: 100%;" :options="tags" :value="Array.from(selectedId)"
|
||||
:disabled="!tags.length"
|
||||
placeholder="Select tags to match images" @update:value="v => selectedId = new Set(v)" />
|
||||
<AButton @click="onUpdateBtnClick" :loading="!queue.isIdle" type="primary"
|
||||
v-if="info.expired || !info.img_count">
|
||||
{{
|
||||
info.img_count === 0 ? 'Generate index for search image' : 'Update index' }}</AButton>
|
||||
<AButton v-else type="primary" @click="query" :loading="!queue.isIdle" :disabled="!selectedId.size">Search
|
||||
info.img_count === 0 ? $t('generateIndexHint') : $t('UpdateIndex') }}</AButton>
|
||||
<AButton v-else type="primary" @click="query" :loading="!queue.isIdle" :disabled="!selectedId.size">{{ $t('search') }}
|
||||
</AButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="generate-idx-hint" v-if="!tags.length">{{ $t('needGenerateIdx') }}</p>
|
||||
<div class="list-container">
|
||||
|
||||
<ul class="tag-list" v-for="([name, list]) in classifyTags" :key="name">
|
||||
|
|
@ -83,6 +86,17 @@ const toTagDisplayName = (v: Tag, withType = false) => (withType ? `[${v.type}]
|
|||
align-items: stretch;
|
||||
|
||||
|
||||
.generate-idx-hint {
|
||||
margin: 64px;
|
||||
padding: 64px;
|
||||
font-size: 2em;
|
||||
text-align: center;
|
||||
background-color: var(--zp-secondary-background);
|
||||
white-space: pre-line;
|
||||
line-height: 2.5em;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
.select {
|
||||
padding: 8px;
|
||||
}
|
||||
|
|
@ -122,6 +136,10 @@ const toTagDisplayName = (v: Tag, withType = false) => (withType ? `[${v.type}]
|
|||
margin: 4px;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
max-width: 256px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
&.selected {
|
||||
color: var(--primary-color);
|
||||
|
|
|
|||
Loading…
Reference in New Issue