From ceacd5615bb4bd90835a6c40a0eb084004d915f3 Mon Sep 17 00:00:00 2001 From: Mina Choi Date: Tue, 27 Oct 2026 09:36:09 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B7=B8=EB=82=A0=20=EC=BD=94=EB=94=94?= =?UTF-8?q?=20=EC=98=B7=EC=9D=80=20=EC=8A=A4=EB=83=85=EC=97=90=20=ED=83=9C?= =?UTF-8?q?=EA=B7=B8=EB=90=9C=20=EB=AC=B4=EC=8B=A0=EC=82=AC=20=EC=83=81?= =?UTF-8?q?=ED=92=88=EB=A7=8C,=20=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=8A=A4?= =?UTF-8?q?=EB=83=85=EC=9D=84=20=EB=8D=94=20=EB=B0=9B=EC=95=84=20=EC=98=A4?= =?UTF-8?q?=EA=B3=A0=20=ED=9B=84=EB=B3=B4=2060=EA=B0=9C=EA=B9=8C=EC=A7=80?= =?UTF-8?q?=20=EB=B4=84(=EC=97=AC=EC=84=B1=20=EC=8A=A4=ED=8A=B8=EB=A6=BF?= =?UTF-8?q?=20=EC=8A=A4=EB=83=85=20=EB=B6=80=EC=A1=B1),=20buildPrompt=20?= =?UTF-8?q?=EB=82=B4=EB=B3=B4=EB=83=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/scripts/daily-ootd.mjs | 2 +- admin/scripts/outfit.mjs | 5 +++-- admin/scripts/snap.mjs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/admin/scripts/daily-ootd.mjs b/admin/scripts/daily-ootd.mjs index bd6648f..b46f47c 100644 --- a/admin/scripts/daily-ootd.mjs +++ b/admin/scripts/daily-ootd.mjs @@ -38,7 +38,7 @@ function layoutFor(slots) { return `top row: ${topRow}; bottom row: ${bottomRow}. Clearly separate spots, nothing else in between.` } -function buildPrompt(persona, outfit, weather) { +export function buildPrompt(persona, outfit, weather) { const by = Object.fromEntries(outfit.items.map((it) => [it.slot, it])) const drawn = DRAW_ORDER.filter((s) => by[s]) const items = drawn.map((s, i) => `(${i + 1}) ${by[s].prompt}${s === 'outer' ? ' as the outer layer' : ''}`).join(', ') diff --git a/admin/scripts/outfit.mjs b/admin/scripts/outfit.mjs index aead07e..9e5ad30 100644 --- a/admin/scripts/outfit.mjs +++ b/admin/scripts/outfit.mjs @@ -43,9 +43,10 @@ function buildPrompt(pick, persona, weather) { goods, '', '규칙:', - '- 자리(slot)는 top·bottom·shoes 는 반드시, 사진에서 겉옷(outer)을 입거나 걸쳤으면 outer 도, 가방이 있으면 bag 도 넣는다. 최대 5개, 자리마다 하나.', + '- 태그된 상품에 있는 옷만 넣는다. 사진에 보여도 상품 목록에 없는 옷·가방은 넣지 않는다.', + '- 자리(slot)는 top·bottom·shoes 는 반드시, 상품 목록에 겉옷이 있으면 outer 도, 가방이 있으면 bag 도 넣는다. 최대 5개, 자리마다 하나.', '- 원피스면 top 으로 넣고 bottom 은 생략하지 말고 같은 원피스를 bottom 에 다시 넣지 않는다 → 원피스는 top, bottom 자리에는 사진의 다른 하의가 없으면 shoes·bag 으로 4개를 채운다.', - '- 상품 목록에 있는 옷은 그 상품명 기준으로, 없는 옷은 사진에서 보이는 대로. 색은 사진 기준.', + '- 옷 이름은 상품명 기준, 색은 사진 기준.', '- label 은 카드 이름표라 짧고 쉬운 한글(브랜드·영어 금지). prompt 는 영어 한 구절, 색은 대문자.', '- style 은 코디 분위기 한 단어.', 'JSON 으로만 답한다.', diff --git a/admin/scripts/snap.mjs b/admin/scripts/snap.mjs index 771b0bb..50f16f8 100644 --- a/admin/scripts/snap.mjs +++ b/admin/scripts/snap.mjs @@ -170,7 +170,7 @@ export async function pickSnaps({ band, style, outDir, pages = 2, log = console. const styleTags = STYLE_TAGS[style] ?? [] const pool = new Map() const add = (list) => list.forEach((s) => s.goodsNos.length >= 3 && !pool.has(s.id) && pool.set(s.id, s)) - for (const tag of styleTags) add(await listSnaps({ tags: tag }, pages)) + for (const tag of styleTags) add(await listSnaps({ tags: tag }, pages * 3)) for (const tag of rule.tags) add(await listSnaps({ tags: tag }, pages)) for (const gender of ['WOMEN', 'MEN']) for (const kw of MATURE_KEYWORDS[gender]) add(await listSnaps({ keyword: kw }, 1)) const hasStyle = (s) => styleTags.length === 0 || s.tags.some((t) => styleTags.some((st) => t.includes(st))) @@ -186,7 +186,7 @@ export async function pickSnaps({ band, style, outDir, pages = 2, log = console. const candidates = [...pool.values()] .filter((s) => s.gender === gender && !used.has(s.id)) .sort((a, b) => Number(hasStyle(b)) - Number(hasStyle(a)) || score(b, persona) - score(a, persona)) - .slice(0, 25) + .slice(0, 60) let best = null for (const c of candidates) { const full = c.goods ? c : await withGoods(c)