sushilideaclan01 commited on
Commit
5106651
·
1 Parent(s): a1baa8d
Files changed (1) hide show
  1. services/generator.py +56 -35
services/generator.py CHANGED
@@ -1072,40 +1072,27 @@ CRITICAL TEXT RULES:
1072
  Do NOT include any text on this image. Focus on the visual scene only.
1073
  NO text overlays, decorative elements, borders, banners, or overlays.
1074
  """
1075
-
1076
- prompt = f"""Create a Facebook advertisement image that looks like AUTHENTIC, ORGANIC CONTENT.
1077
-
1078
- {vintage_section}
1079
- {framework_section}
1080
- {text_overlay_section}
1081
-
1082
- === VISUAL SCENE ===
1083
- {image_brief}
1084
-
1085
- {"=== AUTO INSURANCE AD GRAPHIC (rate card / comparison / CTA layout) ===" if is_auto_insurance_ad_format else ""}
1086
- {"Follow the VISUAL SCENE description exactly. Use ONLY these defined formats: official notification, social post card, rate/seniors table, before/after split, coverage tier panels, car brand grid, gift card CTA, savings/urgency. Include headline, prices, rates, and CTA or button text as specified. Do NOT add people, faces, or cars unless the VISUAL SCENE explicitly asks for them. Do NOT create in-car dashboard mockups, screens inside car interiors, or headshots on displays. Do NOT include fake or made-up brand/company names (no gibberish like Alcata, MiCass, etc.); use generic text only (e.g. 'Compare Providers', 'See Rates') or omit brand names. Render as a clean, modern ad graphic with clear typography and layout." if is_auto_insurance_ad_format else ""}
1087
-
1088
- {"=== PEOPLE, FACES, CARS: OPTIONAL ===\nOnly include people, faces, or vehicles if the VISUAL SCENE description specifically mentions them. Most auto insurance ad formats are typography and layout only - no people or cars needed." if is_auto_insurance_ad_format else "=== CRITICAL: PEOPLE AND FACES ===\nIf this image includes people or faces, they MUST look like real, original people with:\n- Photorealistic faces with natural skin texture, visible pores, and realistic skin imperfections\n- Natural facial asymmetry (no perfectly symmetrical faces)\n- Unique, individual facial features (not generic or model-like)\n- Natural expressions with authentic micro-expressions\n- Realistic skin tones with natural variations and undertones\n- Natural hair texture with individual strands\n- Faces that look like real photographs of real people, NOT AI-generated portraits\n- Avoid any faces that look synthetic, fake, or obviously computer-generated"}
1089
-
1090
- {"- For this ad graphic layout, headline and price/rate text are part of the design; include them as specified in VISUAL SCENE." if is_auto_insurance_ad_format else "IMPORTANT: Do NOT display numbers, prices, dollar amounts, or savings figures in the image unless they naturally appear as part of the scene (like on a document someone is holding, or a sign in the background). Focus on the visual scene and people, not numerical information. Numbers should be in the ad copy, not the image."}
1091
-
1092
- === VISUAL SPECIFICATIONS ===
1093
- STYLE: {visual_style} - {"clean modern ad graphic, professional layout" if is_auto_insurance_ad_format else "rendered in vintage documentary aesthetic"}
1094
- MOOD: {visual_mood} - {"trustworthy, clear, high-contrast" if is_auto_insurance_ad_format else "nostalgic, authentic, trustworthy"}
1095
- CAMERA: {camera_angle} - documentary/candid feel
1096
- LIGHTING: {lighting} - natural, not studio-polished
1097
- COMPOSITION: {composition}
1098
-
1099
- {niche_image_guidance}
1100
-
1101
- === OPTIONAL STYLING ELEMENTS ===
1102
- Apply these effects IF they fit the natural aesthetic (not required):
1103
- - Film grain (if vintage style)
1104
- - Faded colors (if appropriate)
1105
- - Natural lighting variations
1106
- - Authentic imperfections (if they occur naturally)
1107
-
1108
- {"=== AUTHENTICITY (only if image includes people/cars per VISUAL SCENE) ===\nIf you included people or vehicles, they should look realistic. Otherwise focus on layout and typography only." if is_auto_insurance_ad_format else """=== AUTHENTICITY REQUIREMENTS ===
1109
  PEOPLE (if present):
1110
  - Real people, NOT models
1111
  - Age appropriate for niche (home insurance: 30-60 relatable homeowners; GLP-1: 30-50; auto insurance: only if format requires, avoid elderly/senior look)
@@ -1138,7 +1125,41 @@ DOCUMENTS (if present):
1138
  - Real-looking bills, statements, cards
1139
  - Visible numbers and text
1140
  - Red circles around key information
1141
- - Slightly crumpled or worn"""}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1142
 
1143
  === NEGATIVE PROMPTS (AVOID) ===
1144
  - NO clean, modern, HD digital look
 
1072
  Do NOT include any text on this image. Focus on the visual scene only.
1073
  NO text overlays, decorative elements, borders, banners, or overlays.
1074
  """
1075
+ # Build people/faces section outside f-string (f-string expression cannot contain backslash)
1076
+ if is_auto_insurance_ad_format:
1077
+ people_faces_section = """=== PEOPLE, FACES, CARS: OPTIONAL ===
1078
+ Only include people, faces, or vehicles if the VISUAL SCENE description specifically mentions them. Most auto insurance ad formats are typography and layout only - no people or cars needed."""
1079
+ else:
1080
+ people_faces_section = """=== CRITICAL: PEOPLE AND FACES ===
1081
+ If this image includes people or faces, they MUST look like real, original people with:
1082
+ - Photorealistic faces with natural skin texture, visible pores, and realistic skin imperfections
1083
+ - Natural facial asymmetry (no perfectly symmetrical faces)
1084
+ - Unique, individual facial features (not generic or model-like)
1085
+ - Natural expressions with authentic micro-expressions
1086
+ - Realistic skin tones with natural variations and undertones
1087
+ - Natural hair texture with individual strands
1088
+ - Faces that look like real photographs of real people, NOT AI-generated portraits
1089
+ - Avoid any faces that look synthetic, fake, or obviously computer-generated"""
1090
+ # Build authenticity section outside f-string (f-string expression cannot contain backslash)
1091
+ if is_auto_insurance_ad_format:
1092
+ authenticity_section = """=== AUTHENTICITY (only if image includes people/cars per VISUAL SCENE) ===
1093
+ If you included people or vehicles, they should look realistic. Otherwise focus on layout and typography only."""
1094
+ else:
1095
+ authenticity_section = """=== AUTHENTICITY REQUIREMENTS ===
 
 
 
 
 
 
 
 
 
 
 
 
 
1096
  PEOPLE (if present):
1097
  - Real people, NOT models
1098
  - Age appropriate for niche (home insurance: 30-60 relatable homeowners; GLP-1: 30-50; auto insurance: only if format requires, avoid elderly/senior look)
 
1125
  - Real-looking bills, statements, cards
1126
  - Visible numbers and text
1127
  - Red circles around key information
1128
+ - Slightly crumpled or worn"""
1129
+
1130
+ prompt = f"""Create a Facebook advertisement image that looks like AUTHENTIC, ORGANIC CONTENT.
1131
+
1132
+ {vintage_section}
1133
+ {framework_section}
1134
+ {text_overlay_section}
1135
+
1136
+ === VISUAL SCENE ===
1137
+ {image_brief}
1138
+
1139
+ {"=== AUTO INSURANCE AD GRAPHIC (rate card / comparison / CTA layout) ===" if is_auto_insurance_ad_format else ""}
1140
+ {"Follow the VISUAL SCENE description exactly. Use ONLY these defined formats: official notification, social post card, rate/seniors table, before/after split, coverage tier panels, car brand grid, gift card CTA, savings/urgency. Include headline, prices, rates, and CTA or button text as specified. Do NOT add people, faces, or cars unless the VISUAL SCENE explicitly asks for them. Do NOT create in-car dashboard mockups, screens inside car interiors, or headshots on displays. Do NOT include fake or made-up brand/company names (no gibberish like Alcata, MiCass, etc.); use generic text only (e.g. 'Compare Providers', 'See Rates') or omit brand names. Render as a clean, modern ad graphic with clear typography and layout." if is_auto_insurance_ad_format else ""}
1141
+
1142
+ {people_faces_section}
1143
+
1144
+ {"- For this ad graphic layout, headline and price/rate text are part of the design; include them as specified in VISUAL SCENE." if is_auto_insurance_ad_format else "IMPORTANT: Do NOT display numbers, prices, dollar amounts, or savings figures in the image unless they naturally appear as part of the scene (like on a document someone is holding, or a sign in the background). Focus on the visual scene and people, not numerical information. Numbers should be in the ad copy, not the image."}
1145
+
1146
+ === VISUAL SPECIFICATIONS ===
1147
+ STYLE: {visual_style} - {"clean modern ad graphic, professional layout" if is_auto_insurance_ad_format else "rendered in vintage documentary aesthetic"}
1148
+ MOOD: {visual_mood} - {"trustworthy, clear, high-contrast" if is_auto_insurance_ad_format else "nostalgic, authentic, trustworthy"}
1149
+ CAMERA: {camera_angle} - documentary/candid feel
1150
+ LIGHTING: {lighting} - natural, not studio-polished
1151
+ COMPOSITION: {composition}
1152
+
1153
+ {niche_image_guidance}
1154
+
1155
+ === OPTIONAL STYLING ELEMENTS ===
1156
+ Apply these effects IF they fit the natural aesthetic (not required):
1157
+ - Film grain (if vintage style)
1158
+ - Faded colors (if appropriate)
1159
+ - Natural lighting variations
1160
+ - Authentic imperfections (if they occur naturally)
1161
+
1162
+ {authenticity_section}
1163
 
1164
  === NEGATIVE PROMPTS (AVOID) ===
1165
  - NO clean, modern, HD digital look