File size: 2,719 Bytes
bf34d04
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from typing import Dict, List, Optional
import logging
import re

logger = logging.getLogger(__name__)

class PromptEnhancer:
    def __init__(self):
        self.context_keywords = {
            # Éléments de design
            "moderne": "modern clean professional design",
            "vintage": "vintage retro classic design",
            "minimaliste": "minimalist clean simple design",
            "luxe": "luxury elegant premium design",
            
            # Types d'ambiance
            "professionnel": "professional corporate business-like",
            "créatif": "creative artistic innovative",
            "dynamique": "dynamic energetic vibrant",
            "élégant": "elegant sophisticated refined",
            
            # Éléments visuels
            "logo": "prominent logo design professional branding",
            "texte": "clear readable text typography",
            "image": "main visual focal point image",
            "photo": "photographic image realistic",
            
            # Caractéristiques techniques
            "haute qualité": "high quality professional grade",
            "détaillé": "highly detailed intricate",
            "net": "sharp crisp clear",
            "flou": "soft focus gentle blur",
            
            # Styles spécifiques
            "3D": "three dimensional depth realistic",
            "plat": "flat design 2D clean",
            "graphique": "graphic design vector-style",
            "illustré": "illustrated hand-drawn artistic"
        }
        
        self.composition_patterns = {
            # Structure de l'affiche
            "haut": "top aligned composition with {element}",
            "bas": "bottom aligned composition with {element}",
            "centre": "centered composition with {element}",
            "gauche": "left aligned composition with {element}",
            "droite": "right aligned composition with {element}",
            
            # Relations spatiales
            "au-dessus": "{element1} positioned above {element2}",
            "en-dessous": "{element1} positioned below {element2}",
            "à côté": "{element1} next to {element2}",
            "autour": "{element1} surrounding {element2}"
        }
        
        self.emphasis_patterns = {
            "important": "(({})),", # Double emphase
            "normal": "({}),",      # Emphase simple
            "subtil": "[{}],"       # Emphase légère
        }
        
        # Expressions courantes à optimiser
        self.common_improvements = {
            "faire": "create",
            "mettre": "place",
            "avec": "featuring",
            "contenant": "containing",
            "il y a": "featuring"