forked from admin/zeropost-engine
feat: multi-style support in covers.js and postImages.js
covers.js: image_style CSV → random pick per generation postImages.js: image_style CSV → random pick per generation
This commit is contained in:
@@ -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] || '';
|
||||
|
||||
Reference in New Issue
Block a user