{
  "id": 2139381,
  "title": "How AI headshot generators actually work: LoRA, 15 selfies, and the overfitting problem",
  "url": "https://urgent.news/2026/08/20/how-ai-headshot-generators-actually-work-lora-15-selfies-and-the",
  "topic": "ai",
  "section": "AI",
  "published": "2026-08-20T13:04:01.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/miriam_alonso_01/how-ai-headshot-generators-actually-work-lora-15-selfies-and-the-overfitting-problem-43p"
  },
  "original_language": "en",
  "account": "Each AI headshot generator operates using similar processes, and once you understand the core mechanism, many unexpected results become less confusing. When you upload 10 to 20 selfies, it typically takes around 20 minutes to receive 100 portraits. Some look identical to you, while others resemble your cousin or an image with an outfit or setting you've never seen. This occurs during the following four stages: face detection and cropping, captioning, fine-tuning, and generation.\n\nFirst, the system runs face detection and crops the uploaded images into squares, aligns the eyes horizontally, and resizes them. Any image that fails the detector or contains multiple faces is discarded. Next, each image is given a text caption, often generated automatically, containing trigger tokens such as \"skys person, wearing a blue shirt, indoor lighting.\"\n\nThe fine-tuning stage involves training a small adapter on top of a frozen base model, allowing the trigger token to represent your face. The generation phase loads the adapter and runs a prompt library against it, creating 100 portraits with different seeds.\n\nThe LoRA (Low-Rank Adaptation) plays a crucial role in this process. Instead of updating a large weight matrix W, LoRA learns two skinny matrices A and B, whose product has the same shape as W. If W is 1024x1024 and the rank is set to 16, then A is 16x1024 and B is 1024x16, resulting in about 3% of the trained numbers required (1,048,576). These adapters are injected into the attention layers, where the model decides what a thing looks like rather than where it goes. By training for a few hundred steps and compressing the adapter into a few megabytes, the generator can load it in milliseconds.\n\nThe number of photos you upload significantly impacts the outcome. Fifteen photos are ideal, ideally taken on different days, in various settings, and wearing different outfits. Using more than 15 photos can lead to \"overfitting,\" where the generated images look consistent but are variations of the same photo, lacking diversity. Conversely, using fewer than 15 photos can cause \"identity drift,\" where the system fails to generate unique images and instead repeats the same image with slight variations.\n\nTo avoid the identity drift problem, include backgrounds that differ from the original photos, wear multiple tops in your input photos, and refrain from using heavy filters. Generally, uploading 15 photos taken on different occasions will yield better results than 100 near-duplicate images. Testing the system with a free tier can help you understand the process better before committing to a paid version.",
  "summary": "Every AI headshot product works roughly the same way under the hood, and once you know the shape of it, most of the weird results stop being weird. You upload 10 to 20 selfies. Twenty minutes later you get 100 portraits back. Some look exactly like you. Some look like your cousin. One looks like you wearing a jacket you've never owned, in an office you've never been to, and that one is usually…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}