diff --git a/src/services/covers.js b/src/services/covers.js index 621457c..697424a 100644 --- a/src/services/covers.js +++ b/src/services/covers.js @@ -100,7 +100,12 @@ Wide 16:9 format. No text, no letters, no logos, no identifiable real human face let styleDesc, paletteDesc, moodDesc, compositionDesc; - const csStyle = channelStyle?.image_style; + // Если задано несколько стилей через запятую — берём случайный из них + const rawStyle = channelStyle?.image_style || ''; + const styleList = rawStyle.split(',').map(s => s.trim()).filter(s => s && s !== 'auto'); + const csStyle = styleList.length > 0 + ? styleList[Math.floor(Math.random() * styleList.length)] + : null; const STYLE_MAP = { 'realistic-photo': { style: 'photorealistic, high-quality photography, natural lighting, sharp focus, realistic textures', mood: 'professional, realistic', comp: 'rule of thirds, natural depth of field' }, 'flat-illustration': { style: 'flat vector illustration, clean geometric shapes, modern editorial style, smooth gradients, minimal', mood: 'clean, modern', comp: 'balanced, centered focal point' }, diff --git a/src/services/postImages.js b/src/services/postImages.js index cef44d2..c3220ad 100644 --- a/src/services/postImages.js +++ b/src/services/postImages.js @@ -63,7 +63,11 @@ const IMAGE_PALETTES = { * Генерирует картинку к посту через GPT-5 /v1/responses + image_generation. */ async function generatePostImage({ post, channel, style = {} }) { - const imageStyle = IMAGE_STYLES[style.image_style] || IMAGE_STYLES['flat-illustration']; + // Если задано несколько стилей через запятую — случайно выбираем один + const styleList = (style.image_style || 'flat-illustration') + .split(',').map(s => s.trim()).filter(s => s && s !== 'auto'); + const pickedStyle = styleList[Math.floor(Math.random() * styleList.length)] || 'flat-illustration'; + const imageStyle = IMAGE_STYLES[pickedStyle] || IMAGE_STYLES['flat-illustration']; const palette = style.image_custom_colors ? `custom brand palette: ${style.image_custom_colors}` : IMAGE_PALETTES[style.image_palette] || '';