12 个视觉参考图库与浏览器无限画布 AI 创作台(5,700+ 素材、中英提示词、多图对比、ComfyUI & MCP)· Visual reference library & infinite-canvas AI studio in the browser
JavaScript ai-artai-try-onchinesecloudflare-pagescomfyuidrawing-referencefashiongeminigpt-imageimage-generationinfinite-canvasmcpmoodboardoutfit-referencepose-referencepromptpwareference-boardseedreamvirtual-try-on
perf: 分离缩略图/原图到独立 assets 站,主站文件数 25,849→14,519
atuizzeb489426c86f
diff --git a/build.py b/build.pyindex b75849b..87fd3ba 100644--- a/build.py+++ b/build.py@@ -5,6 +5,9 @@ from concurrent.futures import ProcessPoolExecutorfrom PIL import Image# 素材目录:默认 ./assets-raw,可用环境变量 POSEWEAR_RAW 指定(见 scripts/fetch-assets.py)R=os.environ.get('POSEWEAR_RAW','assets-raw'); D='dist'+# 分离部署:设 POSEWEAR_ASSET_HOST 后,缩略图与原图输出到 dist-assets(独立 Pages 站),主站文件数压回免费版上限内;不设则单站构建,行为不变+AHOST=os.environ.get('POSEWEAR_ASSET_HOST','').rstrip('/'); AD='dist-assets'; AROOT=AD if AHOST else D+if AHOST: os.makedirs(AD,exist_ok=True)LINE={'全身1人・セクシー系':('全身·性感','full body, solo, sexy'),'全身1人・標準系':('全身·标准','full body, solo'),'上半身1人':('上半身','upper body, solo'),'2人絡み':('双人互动','two people, couple')}CAT={'寝そべり':'躺卧','セクシー・露骨寄り系':'性感·大胆','立ち':'站姿','座り':'坐姿','かわいい系':'可爱','胸寄せ・谷間強調系':'挤胸·乳沟','膝立ち・四つん這い':'跪立·趴姿','特殊':'特殊','正常位':'正面位','膝立ち':'跪立','横座り・女の子座り':'侧坐·鸭子坐','後背位':'后入位','背面座位':'背面坐位','しゃがみ':'蹲姿','前かがみ':'前倾','顔寄せ系':'贴脸','騎乗位':'骑乘位','立位':'立位','立位密着':'立位贴身','のけぞり・反り':'后仰','ひねり':'扭身','側位':'侧位','座位':'坐位','対面座位':'对面坐位','座位密着':'坐位贴身','密着':'贴身'}ANG={'正面':('正面','front view'),'上から':('俯拍','high angle, from above'),'下から':('仰拍','low angle, from below'),'横':('侧面','side view'),'斜め':('斜侧','three-quarter view')}@@ -65,13 +68,13 @@ for d in rd:RJ=J(pors)if os.path.exists(f'{D}/data.js'): os.remove(f'{D}/data.js')for a,b in [('costume/thumbs','c/t'),('costume/img','c/i'),('anime/thumbs','a/t'),('anime/img','a/i')]:- shutil.copytree(f'{R}/{a}',f'{D}/{b}',dirs_exist_ok=True)+ shutil.copytree(f'{R}/{a}',f'{AROOT if b.endswith("/t") else D}/{b}',dirs_exist_ok=True)os.makedirs(f'{D}/p/i',exist_ok=True)def cv(d):- t=f"{D}/p/t/{d['id']}.webp"+ t=f"{AROOT}/p/t/{d['id']}.webp"if not os.path.exists(t):im=Image.open(f"{R}/pose/{d['サムネ']}").convert('RGB');im.save(t,'WEBP',quality=80,method=6)- o=f"{D}/o/p/{d['id']}.png"+ o=f"{AROOT}/o/p/{d['id']}.png"if not os.path.exists(o): os.link(f"{R}/pose/{d['原寸']}",o)o=f"{D}/p/i/{d['id']}.webp"if not os.path.exists(o):@@ -81,26 +84,28 @@ def cm(d):o=f"{D}/c/m/{d['id']}.webp"if not os.path.exists(o):im=Image.open(f"{R}/costume/{d['画像']}").convert('RGB'); im.thumbnail((1080,1620)); im.save(o,'WEBP',quality=80)- o=f"{D}/o/c/{d['id']}.png"+ o=f"{AROOT}/o/c/{d['id']}.png"if not os.path.exists(o): os.link(f"{R}/costume/{d['原寸']}",o)def ca(d):o=f"{D}/a/m/{d['id']}.webp"if not os.path.exists(o):im=Image.open(f"{R}/anime/{d['画像']}").convert('RGB'); im.thumbnail((1080,1620)); im.save(o,'WEBP',quality=80)- o=f"{D}/o/a/{d['id']}.png"+ o=f"{AROOT}/o/a/{d['id']}.png"if not os.path.exists(o): os.link(f"{R}/anime/{d['原寸']}",o)def cr(d):- t=f"{D}/r/t/{d['id']}.webp"+ t=f"{AROOT}/r/t/{d['id']}.webp"if not os.path.exists(t): shutil.copy(f"{R}/portrait/{d['thumb']}",t)o=f"{D}/r/m/{d['id']}.webp"if not os.path.exists(o):im=Image.open(f"{R}/portrait/{d['full']}").convert('RGB'); im.thumbnail((1080,1350)); im.save(o,'WEBP',quality=80)- o=f"{D}/o/r/{d['id']}.png"+ o=f"{AROOT}/o/r/{d['id']}.png"if not os.path.exists(o): os.link(f"{R}/portrait/{d['full']}",o)-for x in ['p/t','c/m','o/p','o/c','a/m','o/a','r/t','r/m','o/r']: os.makedirs(f'{D}/{x}',exist_ok=True)-if os.path.exists(f'{D}/p/t'):- for f in os.listdir(f'{D}/p/t'):- if f.endswith('.jpg'): os.remove(f'{D}/p/t/{f}')+for x in ['p/t','c/m','o/p','o/c','a/m','o/a','r/t','r/m','o/r']: os.makedirs(f'{AROOT if x.endswith("/t") or x.startswith("o/") else D}/{x}',exist_ok=True)+if os.path.exists(f'{AROOT}/p/t'):+ for f in os.listdir(f'{AROOT}/p/t'):+ if f.endswith('.jpg'): os.remove(f'{AROOT}/p/t/{f}')+if AHOST:+ open(f'{AD}/_headers','w').write('/*\n Cache-Control: public, max-age=31536000, immutable\n Access-Control-Allow-Origin: *\n')with ProcessPoolExecutor() as ex: list(ex.map(cv,pd)); list(ex.map(cm,cd)); list(ex.map(ca,ad)); list(ex.map(cr,rd))# 深度姿势:只解析素材包里的文本,热链包不复制图片(见 depthpack.py)_dc=depthpack.catalog(); DJ=J(_dc['payload']); DEPTH_ORIGINS=_dc['origins']diff --git a/post.py b/post.pyindex 53f5dc2..ff77b7d 100644--- a/post.py+++ b/post.py@@ -1,5 +1,8 @@# v10 构建后处理:哈希资源、静态详情页、SEO 文件、_headers(由 build.py exec)SITE=os.environ.get('POSEWEAR_SITE','https://posewear.pages.dev').rstrip('/') # 部署到自己的域名时改这里+AH=os.environ.get('POSEWEAR_ASSET_HOST','').rstrip('/') # 分离部署时缩略图/原图所在站(见 build.py 的 AHOST)+def TU(p): return p if p.startswith('http') else (AH+'/'+p if AH else '/'+p) # 缩略图相对引用+def TS(p): return p if p.startswith('http') else (AH+'/'+p if AH else SITE+'/'+p) # 缩略图绝对引用(JSON-LD)h8=lambda b:hashlib.sha256(b if isinstance(b,bytes) else b.encode()).hexdigest()[:10]os.makedirs(f'{D}/assets',exist_ok=True)for f in os.listdir(f'{D}/assets'): os.remove(f'{D}/assets/{f}')@@ -9,7 +12,9 @@ def put(name,data):base,ext=name.rsplit('.',1);n=f'assets/{base}.{h8(b)}.{ext}';open(f'{D}/{n}','wb').write(b);A[name]=n;return nput('poses.json',PJ);put('costumes.json',CJ);put('anime.json',AJ);put('portraits.json',RJ);put('depths.json',DJ)for f in ['style.css','zip.js','extras.js','studio.js']: put(f,open(f'src/{f}','rb').read())-app=open('src/app.js').read().replace("'poses.json'","'/"+A['poses.json']+"'").replace("'costumes.json'","'/"+A['costumes.json']+"'").replace("'anime.json'","'/"+A['anime.json']+"'").replace("'portraits.json'","'/"+A['portraits.json']+"'").replace("'depths.json'","'/"+A['depths.json']+"'")+app=open('src/app.js').read()+if AH: app=app.replace("const AH='';",f"const AH='{AH}/';")+app=app.replace("'poses.json'","'/"+A['poses.json']+"'").replace("'costumes.json'","'/"+A['costumes.json']+"'").replace("'anime.json'","'/"+A['anime.json']+"'").replace("'portraits.json'","'/"+A['portraits.json']+"'").replace("'depths.json'","'/"+A['depths.json']+"'")put('app.js',app)VER='posewear-v10-'+h8(''.join(A.values()))idx=open('src/index.html').read()@@ -57,8 +62,8 @@ def page(kind,it,rel):ttl=f"{it['ti']} · {it['cat']}穿搭参考";img=it['m'];w,h=1080,1620;th=it['t']desc=it['zh'];meta=f"{it['cat']} · 编号 {it['id']}";en=it['en']url=f"{SITE}/{kind}/{it['id']}/"- ld={"@context":"https://schema.org","@type":"ImageObject","name":ttl,"description":desc,"contentUrl":f"{SITE}/{img}","thumbnailUrl":f"{SITE}/{th}","url":url,"width":w,"height":h,"isPartOf":{"@type":"WebSite","name":"衣姿 PoseWear","url":SITE+'/'},"creditText":"AI Pose Gallery / AI Costume Gallery (@giaaibusi)"}- rl=''.join(f'<li><a href="/{kind}/{r["id"]}/"><img src="/{r["angles"][0]["t"] if P else r["t"]}" alt="{E(r["zh"] if P else r["ti"])}" width="{300 if P else 360 if kind=="costume" else 400}" height="{400 if P else 540 if kind=="costume" else 500}" loading="lazy">{E(r["zh"] if P else r["ti"])}</a></li>' for r in rel)+ ld={"@context":"https://schema.org","@type":"ImageObject","name":ttl,"description":desc,"contentUrl":f"{SITE}/{img}","thumbnailUrl":f"{TS(th)}","url":url,"width":w,"height":h,"isPartOf":{"@type":"WebSite","name":"衣姿 PoseWear","url":SITE+'/'},"creditText":"AI Pose Gallery / AI Costume Gallery (@giaaibusi)"}+ rl=''.join(f'<li><a href="/{kind}/{r["id"]}/"><img src="{TU(r["angles"][0]["t"] if P else r["t"])}" alt="{E(r["zh"] if P else r["ti"])}" width="{300 if P else 360 if kind=="costume" else 400}" height="{400 if P else 540 if kind=="costume" else 500}" loading="lazy">{E(r["zh"] if P else r["ti"])}</a></li>' for r in rel)lab={'pose':'姿势库','costume':'服装库','portrait':'人像库'}[kind]return f'''<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{E(ttl)} | 衣姿 PoseWear</title><meta name="description" content="{E(desc[:150])}"><link rel="canonical" href="{url}">@@ -75,7 +80,7 @@ def page(kind,it,rel):open(f'{D}/404.html','w').write(f'''<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>页面不存在 | 衣姿 PoseWear</title><meta name="robots" content="noindex"><link rel="icon" href="/favicon.svg" type="image/svg+xml"><style>{CSS}.nf{{max-width:480px;margin:12vh auto;text-align:center;padding:0 20px}}.nf b{{font-size:64px;color:#d81b3a;display:block;line-height:1}}</style></head><body><header><a href="/">{LOGO}衣姿 PoseWear</a></header><div class="nf"><b>404</b><h1>这个页面不存在</h1><p class="mu">链接可能写错了,或者内容已经调整。</p><a class="go" href="/">回到首页</a><a class="go" style="background:#111" href="/#costume">看看服装库</a></div></body></html>''')-_IMG=" ".join(["'self'","data:","blob:"]+list(DEPTH_ORIGINS))+_IMG=" ".join(["'self'","data:","blob:"]+list(DEPTH_ORIGINS)+([AH] if AH else []))CSP=("default-src 'self'; script-src 'self' "+SH+"; style-src 'self' 'unsafe-inline'; img-src "+_IMG+"; font-src 'self' data:; ""connect-src 'self' data: blob: https://api.openai.com https://generativelanguage.googleapis.com https://*.volces.com https://*.bytepluses.com https://oaidalleapiprodscus.blob.core.windows.net https://*.googleusercontent.com; ""worker-src 'self'; manifest-src 'self'; media-src 'self' blob:; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests")diff --git a/scripts/fetch-assets.py b/scripts/fetch-assets.pyindex 77b2252..a4785b7 100644--- a/scripts/fetch-assets.py+++ b/scripts/fetch-assets.py@@ -22,6 +22,22 @@ UA = {'User-Agent': 'Mozilla/5.0 (PoseWear local build)'}WORKERS = 4+def _curl(url, path):+ """urllib 经代理时偶发 IncompleteRead 中断,curl 更稳,作为兜底。"""+ import subprocess+ if path is None:+ r = subprocess.run(['curl', '-sS', '-A', UA['User-Agent'], '--max-time', '90', url],+ capture_output=True, timeout=120)+ return r.stdout if r.returncode == 0 and r.stdout else None+ os.makedirs(os.path.dirname(path), exist_ok=True)+ r = subprocess.run(['curl', '-sS', '-A', UA['User-Agent'], '--max-time', '90', '-o', path + '.part', url],+ capture_output=True, timeout=120)+ if r.returncode == 0 and os.path.getsize(path + '.part') > 0:+ os.replace(path + '.part', path)+ return os.path.getsize(path)+ return 0++def get(url, path=None, tries=4):if path and os.path.exists(path) and os.path.getsize(path) > 0:return 0@@ -37,6 +53,9 @@ def get(url, path=None, tries=4):except Exception as e:err = etime.sleep(2 + i * 3)+ r = _curl(url, path)+ if r:+ return rprint('失败', url, err, flush=True)return None if path is None else 0diff --git a/seo.py b/seo.pyindex b1a03b7..cafedd1 100644--- a/seo.py+++ b/seo.py@@ -84,7 +84,7 @@ def add(sm,path,lm,imgs=(),en=True):def cardli(lang,kind,it,href=None):t=en_title(kind,it) if lang=='en' else zh_title(kind,it);w,h=TW[kind]href=href or (('/en' if lang=='en' and kind in HAS_EN else '')+f'/{kind}/{it["id"]}/')- return f'<li><a href="{href}"><img src="/{thumb(kind,it)}" alt="{E(t)}" width="{w}" height="{h}" loading="lazy" decoding="async"><span>{E(t)}</span></a></li>'+ return f'<li><a href="{href}"><img src="{TU(thumb(kind,it))}" alt="{E(t)}" width="{w}" height="{h}" loading="lazy" decoding="async"><span>{E(t)}</span></a></li>'# ---- 详情页 ----def detail(lang,kind,it,rel):zh=lang=='zh';P='/en' if not zh else '';src=SRCS[kind];ck,slug,cz_,cen=catof(kind,it)@@ -112,7 +112,7 @@ def detail(lang,kind,it,rel):kws=[cz_,cen]+([it['line'],it['lineEn']] if kind=='pose' else [])+([x[1] if x[0]=='item' else cz(x[1]) for x in ctags(it)] if kind in ('costume','anime') else [])+([it['sec'],it['st']] if kind=='portrait' else [])kws=[k for k in kws if k]creator={"@type":"Person","name":src[2],"url":src[3]}- io={"@type":"ImageObject","@id":url(lang,path)+'#image',"name":t,"description":desc,"contentUrl":f"{SITE}/{img}","thumbnailUrl":f"{SITE}/{th}","url":url(lang,path),"width":w,"height":h,+ io={"@type":"ImageObject","@id":url(lang,path)+'#image',"name":t,"description":desc,"contentUrl":f"{SITE}/{img}","thumbnailUrl":f"{TS(th)}","url":url(lang,path),"width":w,"height":h,"encodingFormat":"image/webp","inLanguage":'en' if not zh else 'zh-CN',"keywords":', '.join(kws),"creator":creator,"creditText":f"{src[0]} ({src[2]})","acquireLicensePage":src[1],"isPartOf":{"@type":"WebSite","name":"衣姿 PoseWear","url":SITE+'/'},"dateModified":LM[kind]}if kind=='portrait': io.update({"license":CC0,"copyrightNotice":"CC0 1.0 (public domain dedication) by @agi_aibusi"})@@ -187,7 +187,7 @@ def hub(lang,kind):cr=[(LAB[lang]['home'],P+'/'),(LAB[lang][kind],None)]first={s:L[0] for s,z,e,L in CATS[kind]} if kind!='tag' else {s:t['L'][0] for s,t in TAGS.items()}ki='costume' if kind=='tag' else kind- li=''.join(f'<li><a href="{P}/{kind}/{s}/"><img src="/{thumb(ki,first[s])}" alt="{E(z if zh else e)}" width="{TW[ki][0]}" height="{TW[ki][1]}" loading="lazy" decoding="async"><span>{E(z if zh else e)} · {n}</span></a></li>' for s,z,e,n in cs)+ li=''.join(f'<li><a href="{P}/{kind}/{s}/"><img src="{TU(thumb(ki,first[s]))}" alt="{E(z if zh else e)}" width="{TW[ki][0]}" height="{TW[ki][1]}" loading="lazy" decoding="async"><span>{E(z if zh else e)} · {n}</span></a></li>' for s,z,e,n in cs)extra='' if kind!='costume' else f'<p><a href="{P}/tag/">{"按单品和颜色浏览 →" if zh else "Browse by garment and colour →"}</a></p>'body=f'<div class="wrap">{crumbs_html(cr)}<h1>{E(nm)}</h1><p class="lead">{E(desc)}</p><ul class="cg">{li}</ul>{extra}</div>'ld=[{"@type":"CollectionPage","url":url(lang,path),"name":nm,"description":desc,"inLanguage":'zh-CN' if zh else 'en'},crumbs_ld(lang,cr)]@@ -229,7 +229,7 @@ HOME_COUNTS=[('288','pose'),('1439','ang'),('1407','cos'),('1320','ani'),('1499'for a,k in HOME_COUNTS:idx=idx.replace(f'<b data-n="{a}">0</b>',f'<b data-n="{HC[k]}" data-na="{HA[k]}">{HC[k]:,}</b>')def ssr(p):- t=p['zh'];a=p['angles'];return (f'<article class="card ssr"><div class="ph pose done"><a href="/pose/{p["id"]}/" class="ssl"><img class="ld" src="/{a[0]["t"]}" alt="{E(t)}" width="300" height="400" decoding="async"{"" if SP.index(p)<4 else " loading=\"lazy\""}></a><span class="badge">{p["no"]}</span></div>'+ t=p['zh'];a=p['angles'];return (f'<article class="card ssr"><div class="ph pose done"><a href="/pose/{p["id"]}/" class="ssl"><img class="ld" src="{TU(a[0]["t"])}" alt="{E(t)}" width="300" height="400" decoding="async"{"" if SP.index(p)<4 else " loading=\"lazy\""}></a><span class="badge">{p["no"]}</span></div>'f'<div class="info"><h3><a href="/pose/{p["id"]}/">{E(t)}</a></h3><div class="sub">{E(p["cat"])} · {len(a)} 个角度</div><div class="tags"><span class="tag">{E(p["line"])}</span><span class="tag c">{E(p["cat"])}</span></div></div></article>')g=re.search(r'(<main id="grid"[^>]*>)(.*?)(</main>)',idx,re.S)idx=idx[:g.start(2)]+''.join(ssr(p) for p in SP[:12])+idx[g.end(2):]diff --git a/src/app.js b/src/app.jsindex b592738..b93d7a3 100644--- a/src/app.js+++ b/src/app.js@@ -9,8 +9,9 @@ const st={tab:'pose',q:'',f:{},sort:'def',lang:LS('lang')||'zh',tl:LS('tl')||'zhconst ok=it=>it&&(st.adult||!it.a);function load(t){return LOAD[t]||(LOAD[t]=fetch({pose:'poses.json',depth:'depths.json',costume:'costumes.json',anime:'anime.json',portrait:'portraits.json'}[t]).then(r=>{if(!r.ok)throw Error(r.status);return r.json()}).then(raw=>{const a=Array.isArray(raw)?raw:(raw.items||[]);if(t=='depth')DATA.depthMeta=raw.pack||null;a.forEach((it,i)=>{it.type=t;it.k=PFX[t]+it.id;it.ord=i;if(it.angles)it.ai=st.ang[it.k]||0;ITEMS[it.k]=it});DATA[t]=a;if(t=='depth')paintDepth();counts();return a}).catch(e=>{delete LOAD[t];throw e}))}const needKeys=ks=>Promise.all([...new Set(ks.map(k=>KT[k[0]]).filter(Boolean))].map(load));-const thumb=it=>it.angles?it.angles[it.ai].t:it.t,big=it=>it.angles?it.angles[it.ai].i:(innerWidth*(devicePixelRatio||1)>1500?it.i:it.m);-const orig=it=>it.ext?'':('/'+(it.angles?it.angles[it.ai].o:it.o));+const AH='';const ath=u=>u.startsWith('http')?u:AH+u;+const thumb=it=>ath(it.angles?it.angles[it.ai].t:it.t),big=it=>it.angles?it.angles[it.ai].i:(innerWidth*(devicePixelRatio||1)>1500?it.i:it.m);+const orig=it=>it.ext?'':((AH||'/')+(it.angles?it.angles[it.ai].o:it.o));function prompt(it,lang){if(it.angles){const a=it.angles[it.ai];return lang=='en'?`${it.en}, ${it.lineEn}, ${a.en}`:`${it.zh},${it.line},${a.zh}`}return lang=='en'?it.en:it.zh}const title=it=>it.type=='pose'||it.type=='depth'?it.zh:it.ti;const subtitle=it=>it.type=='depth'?it.ja:st.lang=='en'?prompt(it,'en'):it.type=='pose'?`${it.cat} · ${it.angles.length} 个角度`:it.type=='portrait'?`${it.sec} · ${it.len}${it.rk?' · 人气第 '+it.rk:''}`:it.zh;@@ -184,4 +185,4 @@ addEventListener('hashchange',()=>{const id=location.hash.split('/')[1];if(!$('#if(innerWidth<=760)$('#q').placeholder='搜索';setLang(st.lang,true);ageSet(st.adult);hdr();countUp();needKeys([...st.sel]).then(()=>tray()).catch(()=>{});st.tab='';if(Q0&&!location.hash)history.replaceState(null,'','?q='+encodeURIComponent(Q0)+'#'+(TABS.includes(QT)?QT:'costume'));route();if('serviceWorker'in navigator&&location.protocol!='file:')addEventListener('load',()=>navigator.serviceWorker.register('/sw.js').catch(()=>{}));-window.APP={ok,ageAsk,toggleFav,toggleSel,lbOpen,lbClose,apply,li:()=>li,load,ITEMS,DATA,thumb,big,title,prompt,toast,esc,setTab,st,copy};+window.APP={ok,ageAsk,toggleFav,toggleSel,lbOpen,lbClose,apply,li:()=>li,load,ITEMS,DATA,thumb,big,ath,title,prompt,toast,esc,setTab,st,copy};diff --git a/src/studio.js b/src/studio.jsindex aefd820..ba0b78b 100644--- a/src/studio.js+++ b/src/studio.js@@ -56,7 +56,7 @@ function compose(poseSet){const en=W.pl=='en',P=W.persons.length,G=W.garments.lefunction reprompt(force){if(force||!W.dirty){$('#wbPrompt').value=compose();W.dirty=false}}// ---------- 渲染 ----------function pickRow(a,type,i){const it=a.kind=='lib'&&A.ITEMS[a.k];if(a.kind=='lib'&&!it)return'<div class="empty0">加载中…</div>';- const src=it?(type=='pose'?it.angles[a.ai??it.ai].t:A.thumb(it)):a.url,t=it?A.title(it):(a.name||'自定义图片'),sub=it?(it.type=='pose'?it.line+' · '+it.angles[a.ai??it.ai].zh:it.cat+' · '+it.id):(type=='costume'?(W.garments.length>1?(i==0?'上装':'下装'):'本地上传'):'本地上传');+ const src=it?(type=='pose'?A.ath(it.angles[a.ai??it.ai].t):A.thumb(it)):a.url,t=it?A.title(it):(a.name||'自定义图片'),sub=it?(it.type=='pose'?it.line+' · '+it.angles[a.ai??it.ai].zh:it.cat+' · '+it.id):(type=='costume'?(W.garments.length>1?(i==0?'上装':'下装'):'本地上传'):'本地上传');return`<div class="pick ${type}"><img src="${src}" alt="${esc(t)}"><div><b>${esc(t)}</b><small>${esc(sub)}</small></div>${type=='pose'&&it?`<select data-ang="${i}" aria-label="角度">${it.angles.map((x,j)=>`<option value="${j}" ${j==(a.ai??it.ai)?'selected':''}>${x.zh}</option>`).join('')}</select>`:''}<button class="rmx" data-rm="${type}" data-i="${i}" aria-label="移除" title="移除">×</button></div>`}function render(){const G=isGen();$$('[data-mode]').forEach(b=>b.classList.toggle('on',b.dataset.mode==W.mode));$('#stLead').textContent=G?'选模特类型和服装,直接出一张上身图。':'上传照片,选一套衣服,换上看看。';