
    iA                        d Z ddlmZ ddlZddlZddlZddlmZ ddlZddl	m
Z
 e
dz  ZdZdZd	Zd
ZdZddZddZddZedk(  r e        yy)u   Venus A-3 Solution 슬라이드 이미지 생성 스크립트.

Meta 광고 캐러셀 A-3 슬라이드: "전환점" 솔루션 공개.
어두운 배경에서 밝은 배경으로 전환되는 중간 지점.
    )annotationsN)Path)WORKSPACE_ROOTz3output/meta-ads/a-group-venus/venus-A3-solution.pngzgemini-3-pro-image-previewzgemini-3.1-flash-image-previewz0https://generativelanguage.googleapis.com/v1betaz3https://www.googleapis.com/auth/generative-languageu  Create a 1080x1080 square Korean Meta advertising image for an insurance sales coaching brand.

BACKGROUND SCENE: Photorealistic transitional atmosphere — dawn light breaking through a modern premium office window. The overall tone is NEITHER fully dark nor fully bright — it is a deliberate turning point. Think: 6am golden hour light streaming through floor-to-ceiling glass, warm golden rays cutting across a minimalist dark room, data visualization elements softly glowing in the background.

LIGHTING: Volumetric god-rays from upper-right. Warm golden-amber light (#C9A84C family) transitioning the scene from deep navy/charcoal at the top to warm cream/gold at the lower half. The gradient should feel natural — like dawn arriving mid-scene. Cinematic depth with slight bokeh on background.

COLOR PALETTE: Upper portion: deep navy #1a1f3a to dark charcoal #2c2c3e. Lower portion: warm gold #C9A84C fading to cream #f5f0e8. The emotional shift from despair to discovery.

KOREAN TEXT OVERLAY (critical — must be large, bold, and accurately rendered):

TOP-LEFT (small brand badge, white text on semi-transparent dark pill background):
"서울대보험쌤"

CENTER-LEFT AREA (large bold headline, white text, 2 lines):
Line 1: "서울대 출신 팀장이"
Line 2: "보험 영업을 다시 설계했다."

BELOW HEADLINE (subheadline, 2 lines):
Line 1: "감각이 아닌 데이터로, 경험이 아닌 시스템으로."
  — the words "데이터" and "시스템" must be in gold color #C9A84C, visually bolder
Line 2: "혼자 뛰지 않아도 되는 구조를 만들었다."
  — this line in slightly lighter white, italic or slightly smaller

BOTTOM-RIGHT corner: "3/5" in small white text

TYPOGRAPHY REQUIREMENTS:
- ALL Korean text must be LARGE and EASILY READABLE on mobile screens
- Brand badge: minimum 40px, white text on dark semi-transparent background
- Headline: minimum 70px, bold white, clear drop shadow for contrast
- Subheadline: minimum 50px, white with gold accent on "데이터" and "시스템"
- Page indicator "3/5": minimum 40px white
- WCAG AAA contrast — all text must be clearly legible

LAYOUT: Left-aligned text composition. The right half of the image shows the background scene (dawn light, data visualization glow). Clean visual hierarchy with generous padding.

MOOD: "This system actually exists?" — the moment of revelation. A turning point from darkness to light. Strategic clarity meeting emotional surprise.

STYLE: Premium Korean advertising. Apple keynote meets Korean financial brand. No stock photo feel. No logos. No icons overlapping text. No watermarks. Photorealistic background with clean text overlay.

IMPORTANT: This is slide 3 of 5 in a carousel. The tone should be noticeably BRIGHTER than slides 1-2 (which were dark/problem-focused) but not as bright as slides 4-5. Transitional dawn.

CAMERA: Phase One IQ4 150MP aesthetic. Cinematic composition. 1:1 square 1080x1080px.c                 l    t        j                  g dddd      } | j                  j                         S )N)gcloudauthzprint-access-tokenz<--scopes=https://www.googleapis.com/auth/generative-languageT)capture_outputtextcheck)
subprocessrunstdoutstrip)results    Y/home/jay/workspace/.worktrees/task-2116-dev1/tools/ai-image-gen/gen_venus_a3_solution.py	get_tokenr   C   s2    ^^	I$dF
 ==      c                    t          d| d}d|  dd}ddt        igigdd	gd
dd}t        j                  |||d      S )Nz/models/z:generateContentzBearer zapplication/json)AuthorizationzContent-Typepartsr
   IMAGETEXTg      ?)responseModalitiestemperature)contentsgenerationConfig   )headersjsontimeout)GEMINI_API_BASEPROMPTrequestspost)tokenmodel_idurlr   payloads        r   call_geminir)   L   sm    XhZ/?
@C"5'**G
  0123#*F"3
G ==gGSIIr   c                    t         j                  j                  dd       t        d       	 t	               } t        dt        |        d       t        d	t         d       t         t              }|j                  d
v r/t        d|j                   dt                t        | t              }|j                  sMt        d|j                   d|j                  d d  t        j                         t        j                  d       |j!                         }|j#                  dg       }|s?t        dt%        |      d d  t        j                         t        j                  d       |d   j#                  di       j#                  dg       }t'        d |D        d       }|Z|D cg c]  }d|v s|j#                  dd       }}t        d|d d  t        j                         t        j                  d       |d   j#                  dd      }	t)        j*                  |d   d         }
t         }|j-                  |
       |j/                         j0                  }t        d|        t        d |d!d"       t        d#|	        y # t        $ r>}t        d| t        j                         t        j                  d       Y d }~d }~ww xY wc c}w )$NT)parentsexist_oku   gcloud 토큰 획득 중...u   토큰 획득 성공 (길이: )u   토큰 획득 실패: )file   u(   이미지 생성 요청 중... (모델: )i  i  u   Pro 모델 접근 실패 (HTTP z). Fallback: u   API 오류: z - i  
candidatesu   candidates 없음: i,  r   contentr   c              3  *   K   | ]  }d |v s|  yw)
inlineDataN ).0ps     r   	<genexpr>zmain.<locals>.<genexpr>y   s     =Q<1+<q=s   	r
    u'   이미지 데이터 없음. 텍스트:    r3   mimeTypez
image/jpegdatau   저장 완료: u   파일 크기: ,z byteszMIME: )OUTPUT_PATHparentmkdirprintr   len	ExceptionsysstderrexitMODEL_IDr)   status_codeFALLBACK_MODEL_IDokr
   r   getstrnextbase64	b64decodewrite_bytesstatst_size)r%   eresponser;   r0   r   
image_partr6   
text_parts	mime_typeimage_bytesoutput_path	file_sizes                r   mainrZ   \   sz   TD9	
'(.s5zl!<=
 
4XJa
@A5(+Hz)/0D0D/E]SdRefgu&78;;X112#hmmDS6I5JKRUR\R\]==?D,+J#CIdsO#45CJJGqMi,00"=E=%=tDJ16FA&A+aeeFB'F
F7
2A7GHszzZ<(,,ZFI"":l#;F#CDK KK(  "**I	OK=
)*	OIa=
/0	F9+
O  &qc*<2 Gs#   "J *	K4K	K3KK__main__)returnrK   )r%   rK   r&   rK   r\   zrequests.Response)r\   None)__doc__
__future__r   rM   r   rC   pathlibr   r#   
gen_configr   r=   rF   rH   r!   GEMINI_SCOPEr"   r   r)   rZ   __name__r4   r   r   <module>rd      so    #   
   %TT'4 DD)
YX!J . b zF r   