Upload latest code and optimized prompts (v6)

This commit is contained in:
tony
2025-12-14 19:52:54 +08:00
commit f5cb1042ae
42 changed files with 15302 additions and 0 deletions

459
prompts/image-templates.js Normal file
View File

@@ -0,0 +1,459 @@
/**
* 基于真实交付成品的12张图Prompt模板
* 每张图都包含文字排版要求
*/
// ========================================
// 主图6张 (1600x1600px, 1:1)
// ========================================
const MAIN_TEMPLATES = {
// Main_01: 场景首图 + 卖点
// 参考: 幻彩主图冰蓝色 (1).jpg
Main_01: (product, sellingPoints) => `
[AMAZON MAIN IMAGE - LIFESTYLE WITH TEXT OVERLAY]
PRODUCT DESCRIPTION:
${product.goldenDescription}
SCENE:
- Beautiful cat wearing the product
- Warm, cozy home interior background (soft focus)
- Product clearly visible, 60% of frame
- Cat looks comfortable and relaxed
TEXT OVERLAY (MUST INCLUDE):
- CENTER-LEFT AREA: Curved banner in muted blue (#8BB8C4)
- TITLE on banner: "DESIGNED FOR COMFORTABLE RECOVERY" in white, clean sans-serif font
- BOTTOM: 3 feature boxes in rounded rectangles with icons
- Box 1: "LIGHTER THAN AN EGG" with egg icon
- Box 2: "WATERPROOF & EASY WIPE" with water droplet icon
- Box 3: "BREATHABLE COTTON LINING" with cloud icon
STYLE:
- Professional Amazon product photography
- Text is clean, readable, modern sans-serif
- Subtle paw print watermarks in background
- 8K quality, 1:1 aspect ratio
`,
// Main_02: 白底平铺图 (纯产品,无文字)
Main_02: (product) => `
[AMAZON MAIN IMAGE - FLAT LAY WHITE BACKGROUND]
PRODUCT DESCRIPTION:
${product.goldenDescription}
SCENE:
- Product flat lay on PURE WHITE background (#FFFFFF)
- Bird's eye view / top-down angle
- Full C-shaped opening visible
- All petals/segments spread out
- Clean studio lighting, minimal shadows
- Product fills 80% of frame
NO TEXT OVERLAY ON THIS IMAGE.
STYLE:
- Clean Amazon product photography
- 8K quality, 1:1 aspect ratio
`,
// Main_03: 功能特写
Main_03: (product) => `
[AMAZON MAIN IMAGE - FEATURE CLOSE-UP]
PRODUCT DESCRIPTION:
${product.goldenDescription}
SCENE:
- Close-up shot of the product's key feature
- Focus on velcro closure mechanism OR inner lining texture
- Hands may be shown adjusting/demonstrating
STYLE:
- Macro product photography
- Sharp focus on detail area
- Soft blurred background
- 8K quality, 1:1 aspect ratio
`,
// Main_04: 多场景使用 (4宫格)
// 参考: 伊丽莎白A+ (4).jpg
Main_04: (product, sellingPoints) => `
[AMAZON MAIN IMAGE - 4-GRID USAGE SCENARIOS]
PRODUCT DESCRIPTION:
${product.goldenDescription}
LAYOUT: 2x2 grid of 4 scenes, each with text caption below
SCENE 1 (TOP-LEFT): Cat wearing product, standing
CAPTION: "• HYGIENIC & EASY TO CLEAN"
SUB-TEXT: "${sellingPoints[0] || 'WATERPROOF OUTER LAYER REPELS STAINS'}"
SCENE 2 (TOP-RIGHT): Cat eating from bowl while wearing product
CAPTION: "• UNRESTRICTED EATING/DRINKING"
SUB-TEXT: "${sellingPoints[1] || 'SPECIALLY DESIGNED OPENING ALLOWS NATURAL FEEDING'}"
SCENE 3 (BOTTOM-LEFT): Cat stretching or walking with product
CAPTION: "• REVERSIBLE WEAR (4-IN-1 DESIGN)"
SUB-TEXT: "${sellingPoints[2] || 'FLIP-OVER DESIGN FLEXIBLY ADAPTS TO VARIOUS ACTIVITIES'}"
SCENE 4 (BOTTOM-RIGHT): Cat sleeping comfortably with product
CAPTION: "• 360° COMFORT"
SUB-TEXT: "${sellingPoints[3] || 'FREE PLAY, SLEEP, AND MOVEMENT WITHOUT PRESSURE'}"
STYLE:
- Each scene in rounded rectangle frame
- Warm beige background (#F5EDE4) with paw print watermarks
- Text in dark gray, clean sans-serif
- 8K quality, 1:1 aspect ratio
`,
// Main_05: 尺寸图
// 参考: 伊丽莎白A+ (6).jpg
Main_05: (product, sizeChart) => `
[AMAZON MAIN IMAGE - SIZE GUIDE]
PRODUCT DESCRIPTION:
${product.goldenDescription}
LAYOUT:
- TOP: Title "PRODUCT SIZE" in bold dark font
- CENTER: Product image with dimension arrows
- Arrow pointing to neck opening: "NECK"
- Arrow pointing to outer width: "WIDTH"
- BOTTOM: Size chart table
SIZE CHART TABLE:
| SIZE | NECK CIRCUMFERENCE | DEPTH |
|------|-------------------|-------|
| XS | ${sizeChart?.XS?.neck || '5.6-6.8IN'} | ${sizeChart?.XS?.depth || '3.2IN'} |
| S | ${sizeChart?.S?.neck || '7.2-8.4IN'} | ${sizeChart?.S?.depth || '4IN'} |
| M | ${sizeChart?.M?.neck || '8.8-10.4IN'} | ${sizeChart?.M?.depth || '5IN'} |
| L | ${sizeChart?.L?.neck || '10.8-12.4IN'} | ${sizeChart?.L?.depth || '6IN'} |
| XL | ${sizeChart?.XL?.neck || '12.8-14.4IN'} | ${sizeChart?.XL?.depth || '7IN'} |
FOOTER TEXT: "NOTE: MEASUREMENTS ARE HAND-CHECKED. ALWAYS MEASURE YOUR PET'S NECK CIRCUMFERENCE BEFORE SELECTING A SIZE."
STYLE:
- Clean infographic style
- Warm beige background with paw prints
- Table with rounded corners
- 8K quality, 1:1 aspect ratio
`,
// Main_06: 多角度展示
// 参考: 伊丽莎白A+ (5).jpg
Main_06: (product) => `
[AMAZON MAIN IMAGE - MULTIPLE ANGLES]
PRODUCT DESCRIPTION:
${product.goldenDescription}
LAYOUT:
- 2 cats wearing the same product, different angles
- Left: Front view, cat facing camera
- Right: 3/4 side view, cat looking to the side
- Decorative curved line connecting the two images
SCENE:
- Warm home interior background
- Both cats look comfortable
- Product clearly visible on both
STYLE:
- Lifestyle photography
- Soft warm lighting
- No text overlay
- 8K quality, 1:1 aspect ratio
`
};
// ========================================
// A+图6张 (970x600px, 约1.6:1)
// ========================================
const APLUS_TEMPLATES = {
// APlus_01: 品牌横幅
// 参考: 伊丽莎白A+ (1).jpg
APlus_01: (product, brandName, productName) => `
[AMAZON A+ BANNER - BRAND HEADER]
PRODUCT DESCRIPTION:
${product.goldenDescription}
LAYOUT:
- Wide banner, 970x600px aspect ratio
- LEFT 40%: Empty space with decorative paw prints for text overlay
- RIGHT 60%: Cat wearing product in lifestyle scene
TEXT OVERLAY (LEFT SIDE):
- BRAND NAME: "${brandName || 'TOUCHDOG'}" in playful, slightly curved font (coral/salmon color #E8A87C)
- Decorative paw prints around brand name
- PRODUCT NAME: "${productName || 'CAT SOFT CONE COLLAR'}" below in smaller gray text
SCENE (RIGHT SIDE):
- White cat standing on modern furniture
- Wearing the product, looking comfortable
- Warm cozy interior background
STYLE:
- Professional Amazon A+ content
- Warm, inviting color palette
- 8K quality
`,
// APlus_02: 对比图
// 参考: 伊丽莎白A+ (2).jpg
APlus_02: (product, sellingPoints, competitorWeaknesses) => `
[AMAZON A+ COMPARISON IMAGE]
PRODUCT DESCRIPTION:
${product.goldenDescription}
LAYOUT: Split screen, left vs right
LEFT SIDE (OUR PRODUCT - COLORFUL):
- GREEN CHECKMARK icon at top-left
- "OUR" label in white on coral/orange background (#E8876C)
- Cat wearing our product, looking HAPPY
- 3 SELLING POINTS in white text:
• "${sellingPoints[0] || 'CLOUD-LIGHT COMFORT'}"
• "${sellingPoints[1] || 'WIDER & CLEARER'}"
• "${sellingPoints[2] || 'FOLDABLE & PORTABLE'}"
RIGHT SIDE (COMPETITOR - GRAYSCALE):
- RED X-MARK icon at top-right
- "OTHER" label in dark text on gray background
- Cat wearing hard plastic cone, looking SAD/UNCOMFORTABLE
- GRAYSCALE/DESATURATED colors
- 3 WEAKNESSES in gray text:
• "${competitorWeaknesses[0] || 'HEAVY & BULKY'}"
• "${competitorWeaknesses[1] || 'BLOCKS VISION & MOVEMENT'}"
• "${competitorWeaknesses[2] || 'HARD TO STORE'}"
CENTER: Product image showing our soft cone
STYLE:
- Clear visual contrast between sides
- Warm beige background with paw prints
- 8K quality, ~1.6:1 aspect ratio
`,
// APlus_03: 功能细节
// 参考: 伊丽莎白A+ (3).jpg
APlus_03: (product, features) => `
[AMAZON A+ FEATURE DETAILS]
PRODUCT DESCRIPTION:
${product.goldenDescription}
LAYOUT:
- TOP: Large title "ENGINEERED FOR UNCOMPROMISED COMFORT" in bold dark font
- MIDDLE: 3 detail images in rounded rectangles
DETAIL 1 (LEFT):
- Close-up of inner lining/fabric
- CAPTION: "${features[0]?.title || 'STURDY AND BREATHABLE'}"
- SUB-TEXT: "${features[0]?.desc || ', DURABLE AND COMFORTABLE'}"
DETAIL 2 (CENTER):
- Dog/cat wearing product with size annotation line
- Show measurement like "24.5cm"
- CAPTION: "${features[1]?.title || 'EASY TO CLEAN, STYLISH'}"
- SUB-TEXT: "${features[1]?.desc || 'AND ATTRACTIVE'}"
DETAIL 3 (RIGHT):
- Close-up of stitching/material
- CAPTION: "${features[2]?.title || 'REINFORCED STITCHING PROCESS'}"
- SUB-TEXT: "${features[2]?.desc || 'AND DURABLE FABRIC'}"
STYLE:
- Warm beige background (#F5EDE4) with paw print watermarks
- Text in dark gray/brown
- 8K quality, ~1.6:1 aspect ratio
`,
// APlus_04: 多场景 (与Main_04类似但横版)
APlus_04: (product, sellingPoints) => `
[AMAZON A+ MULTI-SCENARIO - HORIZONTAL]
PRODUCT DESCRIPTION:
${product.goldenDescription}
LAYOUT: 4 scenes in horizontal row
SCENE 1: Cat standing wearing product
CAPTION: "• HYGIENIC & EASY TO CLEAN"
SCENE 2: Cat eating from bowl
CAPTION: "• UNRESTRICTED EATING/DRINKING"
SCENE 3: Cat stretching/playing
CAPTION: "• REVERSIBLE WEAR"
SCENE 4: Cat sleeping peacefully
CAPTION: "• 360° COMFORT"
Each scene in rounded rectangle frame with caption below.
STYLE:
- Warm beige background with paw prints
- Clean modern typography
- 8K quality, ~1.6:1 aspect ratio
`,
// APlus_05: 多角度展示
APlus_05: (product) => `
[AMAZON A+ MULTIPLE ANGLES - HORIZONTAL]
PRODUCT DESCRIPTION:
${product.goldenDescription}
LAYOUT:
- 2 cats wearing product, side by side
- Left cat: Front view
- Right cat: Side/3/4 view
- Decorative curved divider between them
SCENE:
- Warm interior background
- Both cats comfortable
- Product clearly visible
STYLE:
- No text overlay
- Lifestyle photography
- 8K quality, ~1.6:1 aspect ratio
`,
// APlus_06: 尺寸表
APlus_06: (product, sizeChart) => `
[AMAZON A+ SIZE CHART - HORIZONTAL]
PRODUCT DESCRIPTION:
${product.goldenDescription}
LAYOUT:
- LEFT 40%: Product image with dimension arrows (NECK, WIDTH labels)
- RIGHT 60%: Size chart table
TITLE: "PRODUCT SIZE" at top
SIZE CHART TABLE:
| SIZE | NECK CIRCUMFERENCE | DEPTH |
|------|-------------------|-------|
| XS | ${sizeChart?.XS?.neck || '5.6-6.8IN'} | ${sizeChart?.XS?.depth || '3.2IN'} |
| S | ${sizeChart?.S?.neck || '7.2-8.4IN'} | ${sizeChart?.S?.depth || '4IN'} |
| M | ${sizeChart?.M?.neck || '8.8-10.4IN'} | ${sizeChart?.M?.depth || '5IN'} |
| L | ${sizeChart?.L?.neck || '10.8-12.4IN'} | ${sizeChart?.L?.depth || '6IN'} |
| XL | ${sizeChart?.XL?.neck || '12.8-14.4IN'} | ${sizeChart?.XL?.depth || '7IN'} |
FOOTER: "NOTE: ALWAYS MEASURE YOUR PET'S NECK BEFORE SELECTING A SIZE"
STYLE:
- Warm beige background with paw prints
- Clean infographic style
- 8K quality, ~1.6:1 aspect ratio
`
};
// ========================================
// 导出
// ========================================
module.exports = {
MAIN_TEMPLATES,
APLUS_TEMPLATES,
// 生成所有12张图的Prompts
generateAllPrompts: (product, skuInfo) => {
const prompts = [];
// 主图6张
prompts.push({
id: 'Main_01',
name: '场景首图+卖点',
aspectRatio: '1:1',
prompt: MAIN_TEMPLATES.Main_01(product, skuInfo.sellingPoints || [])
});
prompts.push({
id: 'Main_02',
name: '白底平铺图',
aspectRatio: '1:1',
prompt: MAIN_TEMPLATES.Main_02(product)
});
prompts.push({
id: 'Main_03',
name: '功能特写',
aspectRatio: '1:1',
prompt: MAIN_TEMPLATES.Main_03(product)
});
prompts.push({
id: 'Main_04',
name: '多场景使用',
aspectRatio: '1:1',
prompt: MAIN_TEMPLATES.Main_04(product, skuInfo.sellingPoints || [])
});
prompts.push({
id: 'Main_05',
name: '尺寸图',
aspectRatio: '1:1',
prompt: MAIN_TEMPLATES.Main_05(product, skuInfo.sizeChart || {})
});
prompts.push({
id: 'Main_06',
name: '多角度展示',
aspectRatio: '1:1',
prompt: MAIN_TEMPLATES.Main_06(product)
});
// A+图6张
prompts.push({
id: 'APlus_01',
name: '品牌横幅',
aspectRatio: '3:2',
prompt: APLUS_TEMPLATES.APlus_01(product, skuInfo.brandName, skuInfo.productName)
});
prompts.push({
id: 'APlus_02',
name: '对比图',
aspectRatio: '3:2',
prompt: APLUS_TEMPLATES.APlus_02(
product,
skuInfo.sellingPoints || [],
skuInfo.competitorWeaknesses || []
)
});
prompts.push({
id: 'APlus_03',
name: '功能细节',
aspectRatio: '3:2',
prompt: APLUS_TEMPLATES.APlus_03(product, skuInfo.features || [])
});
prompts.push({
id: 'APlus_04',
name: '多场景横版',
aspectRatio: '3:2',
prompt: APLUS_TEMPLATES.APlus_04(product, skuInfo.sellingPoints || [])
});
prompts.push({
id: 'APlus_05',
name: '多角度横版',
aspectRatio: '3:2',
prompt: APLUS_TEMPLATES.APlus_05(product)
});
prompts.push({
id: 'APlus_06',
name: '尺寸表横版',
aspectRatio: '3:2',
prompt: APLUS_TEMPLATES.APlus_06(product, skuInfo.sizeChart || {})
});
return prompts;
}
};