array( 'Image 2 is the product: a top. Replace only the garment on the upper body with it.', 'Keep the trousers, skirt, shoes and accessories from image 1 unchanged.', 'The top must fit their actual figure the way it really would, including around the stomach, with natural drape and creases.', 'Reproduce the product faithfully: colour, pattern, fabric texture, neckline, sleeves, buttons and length.', ), ProductType::DRESS => array( 'Image 2 is the product: a dress. Replace their clothes with this dress.', 'Keep their shoes and accessories unless the dress covers them.', 'The dress must fit their actual figure the way it really would, including around the stomach and hips, with natural drape and folds.', 'Reproduce the product faithfully: colour, pattern, fabric texture, neckline, sleeves, waistline and length.', ), ProductType::EYEWEAR => array( 'Image 2 is the product: a pair of glasses. Put these glasses on their face, sitting naturally on the nose and ears, sized realistically for their face.', 'Keep their clothes and everything else in image 1 unchanged. If they already wear glasses, replace them with these.', 'Reproduce the frame faithfully: shape, colour, thickness, bridge and lens tint. Keep the eyes visible through clear lenses.', ), ); private const END = 'Photorealistic, same lighting, colours and image quality as image 1. Do not add text, logos or watermarks.'; /** * Prompt text for a product type. * * @param string $type ProductType constant. * @param string $variant Line from VariantText::line(), or ''. * @throws \InvalidArgumentException When the type is unknown. */ public static function build( string $type, string $variant = '' ): string { if ( ! isset( self::PRODUCT[ $type ] ) ) { throw new \InvalidArgumentException( 'Unknown product type.' ); } $lines = array_merge( self::START, self::PRODUCT[ $type ] ); if ( '' !== $variant ) { $lines[] = $variant; } $lines[] = self::END; return implode( "\n", $lines ); } }