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)