o
    ฆ@Tjฆ-  ใ                   @   s   d Z dZdZdZdZdZdS )zEPrompt templates for garment analysis and ghost mannequin generation.u  You are a fashion expert AI. Analyze the clothing items worn by the person in this image.

For EACH distinct garment visible, provide:
1. category_main: one of [top, bottom, outer, dress]
2. category_sub: specific type (e.g., t-shirt, jeans, hoodie, blazer)
3. description: A concise Korean description of the item (์์, ์์ฌ, ๋์์ธ ํน์ง ํฌํจ)
4. tags: an object with these fields (all values in English):
   - color: array of colors (e.g., ["black", "white"])
   - pattern: one of [solid, striped, checkered, floral, graphic, logo]
   - material: one of [cotton, denim, polyester, wool, leather, knit, silk, nylon, mixed]
   - style: array from [casual, formal, sporty, streetwear]
   - fit: one of [slim, regular, oversized, cropped]
   - occasion: array from [daily, office, date, workout, travel]
   - brand: detected brand name or "unknown"

You MUST return a JSON object with a single key "garments" containing an array.
Example:
{"garments": [
  {
    "category_main": "top",
    "category_sub": "t-shirt",
    "description": "๋ธ๋ ์ฝํผ ๋ผ์ด๋๋ฅ ๋ฐํ ํฐ์์ธ , ๊ฐ์ด์ ์์ ๋ก๊ณ  ํ๋ฆฐํธ",
    "tags": {
      "color": ["black"],
      "pattern": "logo",
      "material": "cotton",
      "style": ["casual", "streetwear"],
      "fit": "regular",
      "occasion": ["daily"],
      "brand": "unknown"
    }
  }
]}

Important:
- Only include clearly visible garments (exclude bags, accessories, and shoes).
- If a layered garment is mostly hidden (approximately 70% or more covered by other clothing and nearly impossible to identify), do NOT include it. Only analyze garments that are clearly visible and identifiable.
- Return ONLY the JSON object {"garments": [...]}, no markdown fences or extra text.
- description must be in Korean.
- All tag values must be in English.
u  Look at this photo of a person wearing clothes. Extract ONLY the {category_sub} ({category_main}) from this photo.

Instructions:
1. Remove the person completely โ body, skin, face, hair, all other garments.
2. Keep ONLY the {category_sub}, preserving its EXACT original colors, textures, wrinkles, stitching, logos, buttons, and every visual detail from the photo.
3. Shape the garment as if displayed on an invisible ghost mannequin โ maintaining the natural 3D form as worn, but with no visible body inside.
4. Place the garment on a plain, solid, evenly-lit pure white background โ no props, no gradient, no cast shadows on the backdrop, no checkerboard pattern. (The white backdrop is removed in post-processing, so keep it clean and uniform.)
5. Output should look like a professional e-commerce product photo.

CRITICAL: The output garment must be IDENTICAL to what appears in the input photo. Same exact color, same pattern, same fabric texture, same brand markings. Do NOT generate a different or generic version of this garment type.
u0  You are a professional fashion stylist AI. Analyze the overall outfit style in this image.

Evaluate the following categories and provide a score (1-5) and detailed Korean commentary for each:

1. **color_palette** (์์์ ๊ท ํ / Color Palette):
   - How well do the colors of all garments and accessories coordinate?
   - Consider color harmony, contrast, and seasonal appropriateness.

2. **silhouette** (ํ๊ณผ ์ค๋ฃจ์ฃ / Fit & Silhouette):
   - How well do the proportions and fits of the garments work together?
   - Consider body proportions, layering, and overall shape.

3. **detail** (๋ํ์ผ ํฌ์ธํธ / Detail Points):
   - How effectively are details, accessories, and finishing touches used?
   - Consider textures, patterns, accessories, and unique style elements.

Also provide:
4. **overall_score**: Average of the three scores (rounded to nearest 0.5).
5. **overall_comment**: A comprehensive Korean paragraph summarizing the entire outfit style, including strengths, notable features, and styling tips (2-4 sentences).
6. **style_tags**: Array of English style keywords that describe this outfit (e.g., ["casual", "minimal", "streetwear", "layered"]).

You MUST return a JSON object with the following structure:
{
  "color_palette": {
    "score": 5,
    "comment": "๊ฐ์ฅ ์นญ์ฐฌํ๊ณ  ์ถ์ ๋ถ๋ถ์๋๋ค. ์ฐจ๋ถํ ํ์คํ ํค์ ์ค์นด์ด ๋ธ๋ฃจ์..."
  },
  "silhouette": {
    "score": 4,
    "comment": "์์(Slightly Cropped): ๊ณจ๋ฐ ์๋ก ๋จ์ด์ง๋ ์ธ๋ฏธ ํฌ๋กญ ๊ธฐ์ฅ์ด..."
  },
  "detail": {
    "score": 4,
    "comment": "์นด๋๊ฑด ์ด๋์ ์ํฌ์ธํธ ํฐ์์ธ ๋ก ์ด์ง ๋ธ์ถํ์ฌ..."
  },
  "overall_score": 4.5,
  "overall_comment": "์ ์ฒด์ ์ผ๋ก ์ฐจ๋ถํ๋ฉด์๋ ์ธ๋ จ๋ ํ์คํ ์ฝ๋๋ค์ด์์ด ๋๋ณด์๋๋ค...",
  "style_tags": ["casual", "minimal", "pastel", "layered"]
}

Important:
- All comments and overall_comment MUST be in Korean.
- style_tags MUST be in English.
- Scores are integers from 1 to 5.
- overall_score can be a float (e.g., 4.5).
- Return ONLY the JSON object, no markdown fences or extra text.
uf  You are a professional photo retoucher producing PHOTOREALISTIC virtual try-on images. The output must be indistinguishable from a real photograph taken with the SAME camera in the SAME scene as the input person photo.

You are given:
- 1 PERSON photo (the FIRST image).
- {garment_count} isolated GARMENT images on transparent backgrounds (the remaining images, in order).

Each garment's category (parallel to image order) is: {catalog}
For example "#1=top, #2=bottom" means image #1 is a top and image #2 is pants/skirt.

Your task:
1. Composite each APPLICABLE garment onto the person, replacing whatever they are currently wearing in the same body region.
2. PRESERVE the person's face, hair, skin tone, pose, body proportions, background, and identity EXACTLY. Do not alter the face or identity in any way.
3. PRESERVE each garment's hue, pattern, logos, and overall shape from the supplied garment image. You MAY (and should) adjust the garment's exposure, brightness, and white balance to match the lighting of the PERSON photo โ do NOT carry over the clean studio tone of the ghost cutout.
4. If the PERSON photo is an UPPER-BODY CROP (legs / lower body are NOT visible in the frame), SKIP any garment whose category is "bottom" (pants, skirt, shorts). Do NOT extend the frame, do NOT invent legs, do NOT try to render the lower garment. Simply leave the bottom garment OUT of the composition.
5. If multiple tops/outers are provided, layer them naturally (outer on top of inner top).
6. PHOTOREALISM (apply to every garment you composite):
   - Lighting match: analyze the direction, color temperature, intensity, and hard/soft quality of the light in the PERSON photo. The garment's highlights and shadows MUST follow that same lighting. If the scene is lit by overhead fluorescents, the garment must show overhead-lit shading; if by a window from the side, side-lit shading; etc.
   - Natural fabric behavior: render realistic folds, pulls, and drape at the shoulders, inside the elbows, around the waist, at the cuffs, and at the hem, following the person's pose and gravity. Do NOT render fabric as a flat, perfectly smooth surface.
   - Contact shadows: add subtle shadows where the garment meets the body or other garments (neckline, inside the sleeves, hem against pants, layer seams) so the garment does not look like it is floating or pasted on.
   - Edge integration: keep the garment's silhouette as soft as the rest of the photo. Match the focus and lens characteristics of the PERSON photo โ do NOT leave razor-sharp cutout edges in an otherwise softer image.
   - Camera & color matching: match the saturation, contrast, and white balance of the PERSON photo. If the input photo has visible noise or grain, the garment surface must carry equivalent noise/grain. The garment must not look "cleaner" or "sharper" than the surrounding pixels.
   - Perspective & wrap: the garment must wrap around the person's body contours (shoulder slope, chest, torso, legs) following their pose. Do NOT render the garment as a flat front-facing projection.
7. Return exactly ONE composited image matching the original person photo's framing and aspect ratio.

CRITICAL:
- The person's face MUST be identical to the input photo. No face edits, no identity changes.
- Do NOT invent garments that were not provided.
- Do NOT change garment hue, pattern, or print (exposure / white-balance adjustments to match the scene are required and do not count as a change).
- Do NOT make the result look like a 3D render, CG composite, sticker, or studio cutout pasted onto the person. The garment must look as if the person actually wore it and was photographed โ not added in post.
- If you cannot achieve photorealistic integration for a garment, still composite it but prioritize believability over saturation/sharpness of the garment.
- If a garment clearly cannot fit the visible body region, SKIP it rather than distorting the image.
u	  You are a professional fashion stylist AI. Analyze the overall outfit style in this image.

Use the following context for your analysis:
- ํ์ฌ ์๊ฐ๋: ์ถ๊ทผ ์๊ฐ (์์นจ)
- ์ค๋ ์ผ์ : ์ผํฐ์ฅ๋๊ป ๋ณด๊ณ ๊ฐ ์์ ๋์ด ์์
- ์ค๋ ๋ ์จ: ํ์ฐฝํจ

Provide analysis in exactly 5 sections. Each section MUST be 1 sentence in Korean.
Each section MUST be between 70 and 75 characters long (including spaces).
Each section MUST start with the specified opening phrase.

1. **time_context** (์๊ฐ ๊ด๋ จ): "์ถ๊ทผ๋ฃฉ์ผ๋ก๋ "์ผ๋ก ์์. ์ถ๊ทผ๋ฃฉ์ผ๋ก ์ด ์ท์ฐจ๋ฆผ์ด ์ผ๋ง๋ ์ ์ ํ์ง ํ๊ฐ.
2. **occasion_context** (์ผ์  ๊ด๋ จ): "์ค๋ ์ผ์ ์ "์ผ๋ก ์์. ์ผํฐ์ฅ๋ ๋ณด๊ณ ์ ์์ด ์ด ์ท์ฐจ๋ฆผ์ด ์ผ๋ง๋ ์ ์ ํ์ง ํ๊ฐ.
3. **weather_context** (๋ ์จ ๊ด๋ จ): "์ค๋ ๋ ์จ๋ "์ผ๋ก ์์. ํ์ฐฝํ ๋ ์จ์ ์ด ์ท์ฐจ๋ฆผ์ด ์ ํฉํ์ง ํ๊ฐ.
4. **color_harmony** (๋ฐฐ์ ๊ด๋ จ): "์ ์ฒด์ ์ธ ๋ฐฐ์์ "์ผ๋ก ์์. ์ํ์ ๋ฐ ์ ์ฒด ๋ฐฐ์์ ์กฐํ๋ฅผ ํ๊ฐ.
5. **improvement_tips** (๋ณด์์ ): "๋ ์๋ฒฝํ ์ฝ๋๋ฅผ ์ํด"๋ก ์์. ์ค๋ ์ํฉ์ ๋ง๊ฒ ์คํ์ผ์ ๋ณด์ํ  ๊ตฌ์ฒด์  ํ ์ ์.

You MUST return a JSON object with the following structure:
{
  "time_context": "์ถ๊ทผ๋ฃฉ์ผ๋ก๋ ๋จ์ ํ ์์ธ ์ ์ฐจ๋ถํ ํค์ ์์ฐํฐ ์กฐํฉ์ด๋ผ ๋ฌด๋ํ์ง๋ง, ๋ค์ ์บ์ฃผ์ผํด ๋ณด์ฌ ์์นจ ์ถ๊ทผ์ฉ์ผ๋ก๋ ์ฝ๊ฐ ๋ณด์ํ๋ฉด ๋ ์ข์ต๋๋ค.",
  "occasion_context": "์ค๋ ์ผ์ ์ ์ผํฐ์ฅ๋๊ป ๋ณด๊ณ ๊ฐ ์์ ๋์ด ์์ผ๋ฏ๋ก, ๊ฒฉ์ ์๋ ์ฌํท๊ณผ ๋จ์ ํ ๊ตฌ๋๋ฅผ ๋งค์นํ๋ฉด ์ ๋ขฐ๊ฐ ์๋ ์ธ์์ ์ค ์ ์์ต๋๋ค.",
  "weather_context": "์ค๋ ๋ ์จ๋ ํ์ฐฝํ์ฌ ๋ฐ์ ๋ฒ ์ด์ง ์์๊ฐ ์ ์ฒด ๋ถ์๊ธฐ๋ฅผ ํ์ธต ๋ถ๋๋ฝ๊ณ  ์ฐ๋ปํ๊ฒ ๋ง๋ค์ด์ฃผ๋ฉฐ, ๊ฐ๋ฒผ์ด ์์ฌ๋ผ ์พ์ ํฉ๋๋ค.",
  "color_harmony": "์ ์ฒด์ ์ธ ๋ฐฐ์์ ๋ฒ ์ด์ง์ ๋ธ๋์ ํด๋์ํ ์กฐํฉ์ผ๋ก ์์ ๊ฐ ์๊ณ  ๊ณ ๊ธ์ค๋ฌ์ด ๋๋์ ์ ์ด๋ฆฌ๋ฉด์๋ ์ธ๋ จ๋ ์ธ์์ ์ค๋๋ค.",
  "improvement_tips": "๋ ์๋ฒฝํ ์ฝ๋๋ฅผ ์ํด์๋ ์์ ๋ธ๋ ์ด์ ๋ ์ฌํํ ๊ฐ์ฃฝ ์๊ณ๋ฅผ ๋ํด ํฌ๋ฉํ ์์ฑ๋์ ๋ํ์ผ์ ๋์ฌ์ฃผ๋ ๊ฒ์ ์ถ์ฒํฉ๋๋ค."
}

Important:
- All text MUST be in Korean.
- Each section value MUST be between 70 and 75 characters long (including spaces). This is critical.
- Return ONLY the JSON object, no markdown fences or extra text.
N)ฺ__doc__ฺGARMENT_ANALYSIS_PROMPTฺGHOST_MANNEQUIN_EDIT_PROMPTฺSTYLE_ANALYSIS_PROMPTฺVTON_PROMPTฺSTYLE_ANALYSIS_TEMPฉ r   r   ๚8/home/ubuntu/htdocs/ootd-api/app/services/llm/prompts.pyฺ<module>   s    -3G