|
from typing import Dict, List, Optional |
|
import logging |
|
import re |
|
|
|
logger = logging.getLogger(__name__) |
|
|
|
class PromptEnhancer: |
|
def __init__(self): |
|
self.context_keywords = { |
|
|
|
"moderne": "modern clean professional design", |
|
"vintage": "vintage retro classic design", |
|
"minimaliste": "minimalist clean simple design", |
|
"luxe": "luxury elegant premium design", |
|
|
|
|
|
"professionnel": "professional corporate business-like", |
|
"créatif": "creative artistic innovative", |
|
"dynamique": "dynamic energetic vibrant", |
|
"élégant": "elegant sophisticated refined", |
|
|
|
|
|
"logo": "prominent logo design professional branding", |
|
"texte": "clear readable text typography", |
|
"image": "main visual focal point image", |
|
"photo": "photographic image realistic", |
|
|
|
|
|
"haute qualité": "high quality professional grade", |
|
"détaillé": "highly detailed intricate", |
|
"net": "sharp crisp clear", |
|
"flou": "soft focus gentle blur", |
|
|
|
|
|
"3D": "three dimensional depth realistic", |
|
"plat": "flat design 2D clean", |
|
"graphique": "graphic design vector-style", |
|
"illustré": "illustrated hand-drawn artistic" |
|
} |
|
|
|
self.composition_patterns = { |
|
|
|
"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}", |
|
|
|
|
|
"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": "(({})),", |
|
"normal": "({}),", |
|
"subtil": "[{}]," |
|
} |
|
|
|
|
|
self.common_improvements = { |
|
"faire": "create", |
|
"mettre": "place", |
|
"avec": "featuring", |
|
"contenant": "containing", |
|
"il y a": "featuring" |