File size: 10,323 Bytes
f201243 26e8ad9 f201243 26e8ad9 |
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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
"""
Visual Elements - Colors, typography, styles, and image generation guidance.
"""
from typing import Dict, Any, List, Optional
import random
COLOR_PALETTES: Dict[str, Dict[str, Any]] = {
"urgency": {"primary": "#FF0000", "secondary": "#FF4500", "accent": "#FFD700", "background": "#000000", "text": "#FFFFFF"},
"trust": {"primary": "#1976D2", "secondary": "#0D47A1", "accent": "#4CAF50", "background": "#FFFFFF", "text": "#212121"},
"savings": {"primary": "#4CAF50", "secondary": "#2E7D32", "accent": "#FFD700", "background": "#FFFFFF", "text": "#212121"},
"energy": {"primary": "#FF9800", "secondary": "#F57C00", "accent": "#FFEB3B", "background": "#FFFFFF", "text": "#212121"},
"premium": {"primary": "#212121", "secondary": "#424242", "accent": "#FFD700", "background": "#FFFFFF", "text": "#212121"},
"calm": {"primary": "#00BCD4", "secondary": "#0097A7", "accent": "#B2EBF2", "background": "#FFFFFF", "text": "#212121"},
"health": {"primary": "#4CAF50", "secondary": "#81C784", "accent": "#2196F3", "background": "#E8F5E9", "text": "#212121"},
"warning": {"primary": "#F44336", "secondary": "#D32F2F", "accent": "#FFEB3B", "background": "#FFF3E0", "text": "#212121"},
}
TYPOGRAPHY_STYLES: Dict[str, Dict[str, Any]] = {
"system": {"name": "System/Native", "fonts": ["Arial", "Helvetica", "San Francisco", "Roboto"], "best_for": ["notifications", "system alerts"]},
"bold_impact": {"name": "Bold Impact", "fonts": ["Impact", "Arial Black", "Bebas Neue", "Anton"], "best_for": ["headlines", "breaking news"]},
"modern_clean": {"name": "Modern Clean", "fonts": ["Montserrat", "Lato", "Open Sans", "Poppins"], "best_for": ["professional ads", "lifestyle"]},
"handwritten": {"name": "Handwritten", "fonts": ["Indie Flower", "Dancing Script", "Pacifico", "Caveat"], "best_for": ["testimonials", "personal notes"]},
"typewriter": {"name": "Typewriter", "fonts": ["Courier", "Courier New", "American Typewriter"], "best_for": ["memos", "documents"]},
"newspaper": {"name": "Newspaper", "fonts": ["Times New Roman", "Georgia", "Playfair Display"], "best_for": ["news style", "editorial"]},
}
VISUAL_STYLES: List[Dict[str, Any]] = [
{"key": "ugc_authentic", "name": "UGC Authentic", "prompt_guidance": "Casual phone camera snapshot, authentic feel, slightly imperfect, natural lighting"},
{"key": "clean_minimal", "name": "Clean Minimal", "prompt_guidance": "Clean minimal design, white space, simple composition, modern aesthetic"},
{"key": "bold_graphic", "name": "Bold Graphic", "prompt_guidance": "Bold graphic design, high contrast, strong colors, impactful visual"},
{"key": "lifestyle_aspirational", "name": "Lifestyle Aspirational", "prompt_guidance": "Aspirational lifestyle photography, happy people, warm lighting"},
{"key": "documentary_real", "name": "Documentary Real", "prompt_guidance": "Documentary style, candid shots, real moments, natural light"},
{"key": "screenshot_native", "name": "Screenshot Native", "prompt_guidance": "Mobile app screenshot, native UI elements, authentic interface"},
{"key": "news_editorial", "name": "News Editorial", "prompt_guidance": "News publication style, editorial photography, professional"},
{"key": "retro_nostalgic", "name": "Retro Nostalgic", "prompt_guidance": "Retro aesthetic, vintage colors, nostalgic feel"},
{"key": "dark_dramatic", "name": "Dark Dramatic", "prompt_guidance": "Dark dramatic lighting, moody atmosphere, cinematic"},
{"key": "bright_optimistic", "name": "Bright Optimistic", "prompt_guidance": "Bright cheerful photography, optimistic feel, positive energy"},
{"key": "corporate_professional", "name": "Corporate Professional", "prompt_guidance": "Corporate photography, business setting, professional attire, clean office environment"},
{"key": "street_style", "name": "Street Style", "prompt_guidance": "Urban street photography, candid moments, city backdrop, authentic urban feel"},
{"key": "studio_clean", "name": "Studio Clean", "prompt_guidance": "Studio photography, controlled lighting, clean background, product-focused"},
{"key": "cinematic_epic", "name": "Cinematic Epic", "prompt_guidance": "Cinematic wide shots, epic scale, dramatic composition, film-like quality"},
{"key": "handheld_casual", "name": "Handheld Casual", "prompt_guidance": "Handheld camera feel, slight motion blur, casual framing, everyday moments"},
]
CAMERA_ANGLES: List[str] = [
"eye level shot", "slightly low angle (empowering)", "slightly high angle (overview)", "close-up portrait",
"medium shot", "wide establishing shot", "over-the-shoulder shot", "POV first-person perspective", "candid angle",
"dutch angle (tilted)", "bird's eye view", "worm's eye view", "extreme close-up", "two-shot (two people)",
"group shot", "profile shot", "three-quarter angle", "top-down view", "oblique angle",
]
LIGHTING_STYLES: List[str] = [
"natural daylight", "golden hour warm light", "soft diffused light", "harsh direct sunlight",
"indoor ambient lighting", "dramatic side lighting", "backlit silhouette", "overcast soft light",
"rim lighting", "softbox lighting", "window light", "neon lighting", "candlelight warm",
"studio lighting", "natural window light", "dramatic chiaroscuro", "soft ambient glow",
]
COMPOSITIONS: List[str] = [
"rule of thirds", "centered subject", "leading lines to subject", "frame within frame",
"negative space emphasis", "symmetrical balance", "asymmetrical dynamic", "diagonal composition",
"golden ratio", "triangular composition", "circular composition", "layered depth",
"foreground/background separation", "depth of field focus", "repetitive patterns", "contrasting elements",
]
# Visual Layouts/Formats - How content is structured in the image
VISUAL_LAYOUTS: List[Dict[str, Any]] = [
{"key": "before_after", "name": "Before vs After", "prompt_guidance": "Split-screen transformation, left side shows problem/pain state, right side shows solution/improved state"},
{"key": "split_screen", "name": "Split Screen", "prompt_guidance": "Two halves comparison, vertical or horizontal split dividing the image"},
{"key": "checklist", "name": "Checklist Layout", "prompt_guidance": "List format with checkmarks, clean organized list with prominent check marks"},
{"key": "bold_headline", "name": "Bold Headline", "prompt_guidance": "Large bold typography dominates the image, headline is the primary visual element"},
{"key": "text_first", "name": "Text-First", "prompt_guidance": "Text is primary element, image secondary, clear typography hierarchy"},
{"key": "minimalist", "name": "Minimalist", "prompt_guidance": "Abundant white space, minimal elements, clean lines, focused composition"},
{"key": "big_numbers", "name": "Big Numbers", "prompt_guidance": "Large numbers dominate the visual, huge bold typography for statistics or prices"},
{"key": "highlight_circle", "name": "Highlight Circle", "prompt_guidance": "Red circle or arrow highlighting key element, drawing attention to specific area"},
{"key": "step_by_step", "name": "Step-by-Step", "prompt_guidance": "Numbered steps flow (1→2→3), clear visual progression"},
{"key": "grid_layout", "name": "Grid Layout", "prompt_guidance": "Organized grid format, easy to scan, multiple elements arranged systematically"},
{"key": "timeline", "name": "Timeline", "prompt_guidance": "Time-based progression, clear timeline flow showing sequence of events"},
{"key": "infographic", "name": "Infographic", "prompt_guidance": "Information graphics, data visualization, charts and visual data representation"},
{"key": "comparison_table", "name": "Comparison Table", "prompt_guidance": "Side-by-side table format with checkmarks and crosses for comparison"},
{"key": "quote_card", "name": "Quote Card", "prompt_guidance": "Quote as main visual element, clear readable testimonial or statement"},
{"key": "screenshot_style", "name": "Screenshot Style", "prompt_guidance": "Device screenshot format, realistic phone or computer interface"},
]
VISUAL_MOODS: List[str] = [
"urgent and alarming", "calm and reassuring", "exciting and energetic", "trustworthy and professional",
"warm and friendly", "bold and confident", "subtle and sophisticated", "raw and authentic",
"hopeful and optimistic", "serious and authoritative", "playful and fun", "mysterious and intriguing",
"inspiring and motivational", "comfortable and cozy", "dynamic and action-packed", "peaceful and serene",
]
NEGATIVE_PROMPTS: List[str] = [
"no watermarks", "no logos", "no brand marks", "no stock photo aesthetic", "no overly polished professional photography",
"no perfect studio lighting", "no corporate photography style", "no artificial perfection", "no text errors",
"no distorted faces", "no extra limbs", "no AI artifacts", "no blurry main subjects", "no over-processed HDR look",
]
def get_color_palette(trigger: str) -> Dict[str, str]:
return COLOR_PALETTES.get(trigger, COLOR_PALETTES["trust"])
def get_random_visual_style() -> Dict[str, Any]:
return random.choice(VISUAL_STYLES)
def get_random_camera_angle() -> str:
return random.choice(CAMERA_ANGLES)
def get_random_lighting() -> str:
return random.choice(LIGHTING_STYLES)
def get_random_composition() -> str:
return random.choice(COMPOSITIONS)
def get_random_mood() -> str:
return random.choice(VISUAL_MOODS)
def build_negative_prompt() -> str:
return ", ".join(NEGATIVE_PROMPTS)
def get_random_visual_elements() -> Dict[str, Any]:
return {
"style": get_random_visual_style(),
"camera_angle": get_random_camera_angle(),
"lighting": get_random_lighting(),
"composition": get_random_composition(),
"mood": get_random_mood(),
}
def get_random_visual_layout() -> Dict[str, Any]:
"""Get a random visual layout/format."""
return random.choice(VISUAL_LAYOUTS)
def get_visual_layout_by_key(key: str) -> Optional[Dict[str, Any]]:
"""Get a specific visual layout by key."""
for layout in VISUAL_LAYOUTS:
if layout["key"] == key:
return layout
return None
def get_all_visual_layouts() -> List[Dict[str, Any]]:
"""Get all visual layouts."""
return VISUAL_LAYOUTS.copy()
|