# Aesthetic Postop Sim

> Simulate post-operative aesthetic medicine outcomes (rhinoplasty, double eyelid, lip filler, jawline, cheek/chin contour) from patient photos. Use when the user mentions 医美, 术后模拟, 隆鼻, 双眼皮, 填充, 下颌线, cosmetic surgery preview, or aesthetic procedure visualization.

- Skill: `freakyglorian-create/aesthetic-postop-sim` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add freakyglorian-create/aesthetic-postop-sim`
- Raw SKILL.md: https://api.skillmd.com/api/skills/freakyglorian-create/aesthetic-postop-sim/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: freakyglorian-create (https://skillmd.com/u/freakyglorian-create)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/freakyglorian-create/aesthetic-postop-sim

---


# Aesthetic Post-Op Simulation

Core workflow for generating believable **术后效果预览** from a single frontal or 45° photo.

## Procedure Map

| Procedure | Primary warp region | Key parameters |
|-----------|-------------------|----------------|
| 隆鼻 Rhinoplasty | Nose bridge, tip, nostril width | bridge height, tip rotation, alar width |
| 双眼皮 Blepharoplasty | Upper eyelid crease | crease height, fold depth, eye openness |
| 唇填充 Lip filler | Upper/lower lip volume | volume %, cupid's bow definition |
| 下颌线 Jawline | Mandible contour | angle sharpness, chin projection |
| 苹果肌 Cheek filler | Malar region | projection, lateral fullness |
| 下巴 Chin implant | Chin tip | forward/down projection |

## Workflow

```
- [ ] Normalize lighting (see lighting-normalize skill if before/after compare)
- [ ] Detect 468 face landmarks (MediaPipe Face Mesh)
- [ ] Analyze proportions (optional: facial-proportion-analysis skill)
- [ ] Apply region-specific warp (TPS or piecewise affine)
- [ ] Preserve skin texture (realistic-skin-blend skill)
- [ ] Export still + optional morph video (before-after-morph skill)
- [ ] Add disclaimer watermark for consultation use
```

## Implementation Stack

**Default (local, no API)**:
1. MediaPipe Face Mesh → landmarks
2. OpenCV `warpAffine` / custom TPS on ROI masks
3. Poisson seamless clone for texture preservation

**Enhanced (when quality matters)**:
- Stable Diffusion inpainting with face mask + low denoise (0.25–0.35)
- ControlNet depth + canny to lock identity
- Always compare against landmark-warp baseline to avoid identity drift

## Region Warp Template

```python
import cv2
import mediapipe as mp
import numpy as np

mp_face = mp.solutions.face_mesh
NOSE_TIP = 1
NOSE_BRIDGE = 6

def simulate_nose_bridge(img, lift_px=8):
    with mp_face.FaceMesh(static_image_mode=True) as mesh:
        rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
        result = mesh.process(rgb)
        if not result.multi_face_landmarks:
            raise ValueError("No face detected")
        lm = result.multi_face_landmarks[0].landmark
        h, w = img.shape[:2]
        pts = np.array([[lm[i].x * w, lm[i].y * h] for i in [6, 168, 197, 195, 5]], np.float32)
        # Shift bridge points upward, TPS warp nose ROI — see scripts/nose_lift.py
        return img  # placeholder; agent implements full TPS
```

## Quality Rules

- **Identity lock**: eye spacing, ear position unchanged
- **Subtle by default**: consult preview ≠ marketing exaggeration
- **Side-by-side**: always export before | after with same crop
- **No race morphing**: respect ethnic features; adjust within anatomical norms
- **Watermark**: `SIMULATION ONLY · 效果模拟 · 非手术保证`

## Output Format

Deliver to user:
1. Annotated landmark overlay (optional, for doctor review)
2. High-res still comparison (PNG)
3. Parameter JSON `{procedure, params, landmark_version}`
4. One-line clinical caveat in Chinese + English

## Scripts

```bash
python scripts/detect_landmarks.py input.jpg --output landmarks.json
python scripts/nose_lift.py input.jpg --lift 8 --output simulated.jpg
```

See [procedures.md](procedures.md) for per-procedure landmark indices and warp strategies.

