Blog

How a Free AI Headshot Generator Works (With Code)

Unicorn API Team · · 11 min read

Diagram showing how a free AI headshot generator turns one selfie into a grid of studio style headshots through an image API

A free AI headshot generator takes an ordinary photo of a face and returns something that looks like it came out of a studio: even lighting, a neutral background, a shirt that belongs in the room you are pretending to stand in. The results are good enough now that most people cannot tell the difference in a LinkedIn profile circle, which is the only size the photo will ever be displayed at.

The catch is never the quality. It is the second image. Every free tool is built around the same funnel: one or two generations to prove the technology works, then a watermark, a queue, a resolution cap or a paywall. This article covers how these tools work under the hood, how far the genuinely free options get you, and then the alternative that most developers end up at: calling an image model directly and paying a few cents per photo instead of a monthly subscription.

What a free AI headshot generator actually does

Almost every free AI headshot generator shipping today is a thin interface on top of a diffusion model, a type of generative model that learns to reverse a noise process: it starts from random static and removes noise step by step until an image emerges that matches its conditioning. The conditioning is your prompt, and in the headshot case, your photo.

Two modes matter here.

  • Text to image. You describe a person and the model invents one. This is the text-to-image setup, and it is how the famous “100,000 AI-generated faces” datasets were produced with StyleGAN back when generative adversarial networks were the state of the art. Useful for stock portraits. Useless for your headshot, because the face is not yours.
  • Image to image, or reference-conditioned generation. You pass one or more photos of your actual face alongside the prompt, and the model generates a new image that keeps the likeness while changing lighting, background, wardrobe and framing. This is what a free AI headshot generator is doing when it asks you to upload a selfie.

Older headshot services worked differently: they fine-tuned a small adapter on 15 or 20 photos of you, which took 20 minutes and a lot of GPU time, then sampled from that. That is why services from a few years ago demanded a large upload and charged $30. Current reference-image models skip the training step entirely. One clear front-facing photo is usually enough, and the generation finishes in seconds.

Knowing which mode you are in explains most of the odd results people complain about. If a tool is quietly doing text to image with a loose “inspired by your photo” conditioning, the output will look like a sibling of yours. If it is doing proper reference conditioning, the likeness holds and the failures are small: an ear in the wrong place, a collar that does not close, glasses with mismatched arms.

Where free AI headshot generator tools stop being free

Running an image model costs real money in GPU seconds, so the free tier always has an edge. The limits are predictable across tools like Recraft, PixelBin, Cutout.pro, Kapwing and Fotor, which added AI headshot generation to its editor in 2024:

  • Download caps. One or two images free, then a subscription. Headshots are a numbers game, so one image is rarely the one you want.
  • Watermarks and downscaling. The free export is often half resolution with a logo in the corner.
  • Queues. Free requests sit behind paid ones. A generation that takes 8 seconds for a subscriber can take 3 minutes on the free lane.
  • Fixed styles. You pick from a grid of presets. If none of them match your industry, you have no way to adjust the prompt.
  • No batch, no repeatability. You cannot run the same setup for 12 teammates, and you cannot reproduce last month’s style when a new hire joins.
  • Upload terms. Photos of faces are biometric data in several jurisdictions. Read what the tool says it does with your upload before you use a free AI headshot generator for a whole team, and check whether images are retained for model training.

The “no sign up” options that rank well for this keyword are real, and they are the right first stop. Use one to answer a single question: does a generated headshot of my face look acceptable at all? Some faces, lighting conditions and hairstyles come out noticeably worse than others, and you want to know that before you build anything.

Once the answer is yes, the subscription math starts to look strange. A free AI headshot generator that charges $20 a month is asking roughly the price of 500 API generations for a UI with ten preset styles.

Comparison of free headshot tool limits against an image API: watermark, single download, low resolution and queue versus batch generation at full resolution
The free tier limits are all variants of the same constraint: someone has to pay for the GPU time.

Which image models hold a likeness, and what each costs

On Unicorn API the same models these tools are built on are available directly, priced in credits. Credits are $0.01 each on a monthly plan, so credits and cents map one to one. Here is how the relevant image models compare for headshot work:

ModelReference imagesCredits per imageCost per imageBest for
GPT Image 1.5up to 43 low, 4 medium, 15 high$0.03 to $0.15Cheapest usable headshots, strong prompt adherence
Nano Banana 2 Liteup to 104$0.04Fast 1K edits, many reference photos
Seedream 5.0 Flash Image to Imageinput image URLs4 (3.24 rounded up)$0.04Restyling an existing photo at 1K, 1.5K or 2K
GPT Image 2.5 Flareup to 166 at 1K, 10 at 2K, 16 at 4K$0.06 to $0.16Everyday generation with many refs, print sizes
GPT Image 2.5 Sunburstup to 166 at 1K, 10 at 2K, 16 at 4K$0.06 to $0.16The polished pass: tighter control, slower than Flare
Grok Imagine 2up to 54$0.04Stylised portraits, illustrated avatars

Two more models are worth knowing about for this workflow. Seedream 5.0 Flash Text To Image generates backgrounds from scratch at 4 credits, which is handy when you want a specific office or outdoor scene to composite against. Seedream 5.0 Flash Layer Decomposition splits an image into layers, also 4 credits, which gives you the subject separated from the background so you can swap environments without regenerating the face at all.

Flare and Sunburst are the same price at the same resolution, so the choice between them is purely speed against polish. For a headshot batch, generate drafts on Flare, then re-run your two favourite prompts on Sunburst.

Generating headshots from one selfie: the code

Media models on Unicorn API follow a job pattern. You POST a job, poll it, and read the output URL. Chat models use an OpenAI-compatible endpoint instead, which is not relevant here. Create a key at /keys and export it as UNICORN_API_KEY.

Check the price before you spend anything. The pricing endpoint returns the exact cost of the exact request body you are about to send:

curl -X POST https://api.unicornapi.net/v1/models/price \
  -H "Authorization: Bearer $UNICORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-1.5",
    "input": {
      "prompt": "Professional headshot, neutral grey background",
      "quality": "low",
      "n": 4
    }
  }'

Now the real thing. This script takes a hosted selfie URL and generates one headshot per style with Seedream 5.0 Flash Image to Image, which takes input photos as image_urls:

import os, time, requests

API = "https://api.unicornapi.net"
HEADERS = {
    "Authorization": f"Bearer {os.environ['UNICORN_API_KEY']}",
    "Content-Type": "application/json",
}

SELFIE = "https://example.com/my-selfie.jpg"

STYLES = {
    "studio": (
        "Professional corporate headshot of the same person. Keep the face, age, "
        "hairstyle and skin tone exactly as in the reference photo. Soft studio "
        "key light from the left, subtle fill, plain light grey seamless backdrop, "
        "charcoal blazer over a white shirt, shoulders squared to camera, "
        "sharp eyes, natural skin texture, 85mm lens look, shallow depth of field."
    ),
    "office": (
        "Professional headshot of the same person. Identical face, age and hair. "
        "Standing in a bright modern office, large windows blurred behind, "
        "soft daylight on the face, navy knit sweater, relaxed natural smile, "
        "85mm lens, background softly out of focus."
    ),
    "outdoor": (
        "Professional headshot of the same person. Identical face, age and hair. "
        "Overcast outdoor light, green foliage blurred far behind, light blue "
        "oxford shirt, calm confident expression, natural skin texture, 85mm lens."
    ),
}

NEGATIVES = (
    " Do not change the face shape, do not slim the jaw, do not remove freckles "
    "or moles, no heavy retouching, no plastic skin, no extra jewellery, "
    "no text, no logos."
)


def run_job(body):
    created = requests.post(f"{API}/v1/jobs", headers=HEADERS, json=body)
    created.raise_for_status()
    job_id = created.json()["id"]

    while True:
        job = requests.get(f"{API}/v1/jobs/{job_id}", headers=HEADERS).json()
        status = job["status"]
        if status == "succeeded":
            return job["outputs"][0]["url"]
        if status in ("failed", "canceled"):
            raise RuntimeError(f"job {job_id} {status}: {job}")
        time.sleep(2)


for name, prompt in STYLES.items():
    url = run_job({
        "model": "seedream-5-flash-image-to-image",
        "input": {
            "prompt": prompt + NEGATIVES,
            "image_urls": [SELFIE],
            "aspect_ratio": "1:1",
            "size": "2K",
            "output_format": "png",
        },
    })
    print(name, url)

    image = requests.get(url)
    with open(f"headshot-{name}.png", "wb") as f:
        f.write(image.content)

Three styles, 4 credits each, 12 credits total: 12 cents. If you want multiple variants per style, switch to a model that accepts n and multiply. GPT Image 2.5 Flare takes up to 16 reference images, which is the better choice when you have several photos of the same person and want the model to triangulate the likeness:

const res = await fetch("https://api.unicornapi.net/v1/jobs", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.UNICORN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "gpt-image-2.5-flare",
    input: {
      prompt:
        "Professional corporate headshot of the same person, identical face and " +
        "hairstyle, soft studio lighting, plain grey backdrop, charcoal blazer, " +
        "natural skin texture, 85mm lens",
      ref_images: [
        "https://example.com/selfie-front.jpg",
        "https://example.com/selfie-left.jpg",
        "https://example.com/selfie-smiling.jpg",
      ],
      aspect_ratio: "1:1",
      resolution: "1K",
      n: 4,
    },
  }),
});

const { id } = await res.json();
// then poll GET /v1/jobs/{id} until status === "succeeded"
// and read job.outputs[0].url

That request is 4 images at 6 credits each, so 24 credits, 24 cents. Full endpoint reference lives at /docs, and if you would rather try the prompts before writing any code, the same models run in the browser playground at /studio/image. Working inside Cursor or Claude Code? The MCP server lets an agent run these jobs for you.

Four step pipeline: selfie, POST to the jobs endpoint, polling while the job runs, finished headshot ready to download
Every media request follows the same shape: create a job, poll it, read the output URL.

What a batch of headshots costs in credits

Here is the arithmetic that makes the subscription question easy. Assume a realistic batch: 3 styles, 8 variants each, 24 images, because you will throw most of them away.

SetupCreditsCost (monthly plan, $0.01/credit)
GPT Image 1.5, low quality72$0.72
Nano Banana 2 Lite or Seedream 5.0 Flash96$0.96
GPT Image 2.5 Flare at 1K144$1.44
GPT Image 2.5 Sunburst at 2K240$2.40
GPT Image 1.5, high quality360$3.60

A Starter plan at $25 a month is 2,500 credits, which is roughly 625 images at 4 credits, or about 26 full 24-image batches. For a 40-person company that wants consistent team photos, the whole project costs a few dollars of credits. Top-up credits cost $0.015 each and never expire, which suits the one-off case: buy credits, run the batch, come back next year. Plan details are on /pricing.

The honest comparison: a free AI headshot generator costs nothing for one image and is the fastest path to that one image. The API costs cents and gives you every image, at full resolution, with prompts you control. The crossover point is somewhere around the second photo.

Prompts that produce headshots people actually use

Prompt quality matters more than model choice. The preset grids in a typical free AI headshot generator are just saved prompts, and they are usually vague. Three things make the difference:

  1. Name the light. “Soft key light from camera left, subtle fill, no hard shadow under the nose” beats “professional lighting”. Photographers describe setups, not vibes.
  2. Name the lens. “85mm, shallow depth of field” gives the mild background compression that reads as portrait photography. Without it, models often produce a flat phone-camera look with a suspiciously sharp background.
  3. Lock the identity explicitly. Say “same person, identical face shape, same age, same hairstyle, keep freckles and moles”. Models drift toward their training distribution’s idea of attractive, which usually means younger, slimmer and symmetrical. Telling them not to helps.

Useful wardrobe and background pairs, in rough order of how often people pick them: charcoal blazer on light grey backdrop (finance, law, consulting), navy sweater in a blurred bright office (tech, product), light shirt against out-of-focus greenery (healthcare, education, nonprofit), black top on a dark grey gradient (creative, speaking, press kit).

For aspect ratio, 1:1 is the right default because LinkedIn, Slack, GitHub and most team pages crop to a circle or square. Use 2:3 if the photo also needs to work in a vertical bio card. GPT Image 1.5 supports 1:1, 3:2 and 2:3; the GPT Image 2.5 variants and Nano Banana 2 Lite offer a wider set including 4:3 and 16:9.

Mistakes people make with a free AI headshot generator

  1. Judging the output at thumbnail size. Everything looks fine at 128 pixels. Open each candidate at full size and check ears, teeth, glasses arms, collar seams and the hairline. These are where diffusion models still fail.
  2. Feeding in a bad reference. A dark, low-resolution, heavily filtered photo with sunglasses gives the model nothing to work with. One well-lit, front-facing, unfiltered photo at reasonable resolution outperforms ten bad ones.
  3. Asking for a pose change. The more you change relative to the reference, the more the model invents, and invented geometry is where likeness goes. Change the lighting, background and clothing. Keep the head angle.
  4. Buying 4K. A 4K generation costs 16 credits against 6 at 1K, and your profile photo will be displayed at 400 pixels. Generate at 1K unless you are printing.
  5. Generating one image and giving up. Professional photographers shoot hundreds of frames to deliver three. Generate 8 per style and expect to keep one or two.
  6. Running a team batch with inconsistent prompts. If everyone’s headshot uses a different background, the team page looks like a collage. Fix one prompt, store it, and reuse it for every person and every new hire.
  7. Uploading colleagues’ photos without asking. Get consent before you put someone’s face through any generator, free or paid, and tell them which service you used.

When to stay on a free tool and when to call the API

Stay on a free AI headshot generator if you need exactly one photo today, you do not write code, and you are happy with the preset styles. That is a genuinely good fit, and nothing below improves on it.

Move to the API when any of these are true: you need more than a couple of images, you are generating for multiple people, you want the same style reproducible six months from now, you need full resolution without a watermark, or you want to put headshot generation inside your own product, onboarding flow or internal tool. At 3 to 6 credits per image, the cost of experimenting is low enough that you can afford to be fussy, which is the actual reason API output tends to beat free-tier output: not a better model, just more attempts.

The same job pattern covers the rest of the catalog, so once this works you can extend the pipeline. Turning a finished portrait into a short clip uses the identical create-and-poll flow with a video model, covered in using a free AI image to video generator.

Frequently asked questions

Is there a free AI headshot generator with no sign up?

Several web tools let you generate one or two headshots without an account, usually at reduced resolution and often with a watermark. They are useful for checking whether AI headshots suit your face at all. Once you want multiple styles, full resolution files or repeatable results, every tool asks for either an account or payment, because each image costs the provider GPU time.

Do AI headshots look professional enough for LinkedIn?

Current image models produce portraits that pass for studio photography in a small profile circle, which is how LinkedIn displays them. Problems show up at full size: slightly plastic skin, mismatched ears or glasses, and collars that do not close properly. Generate four to eight variants, inspect each at 100 percent zoom, and keep only the ones with clean hands, ears and eyewear.

How many photos do you need for an AI headshot?

Modern image-to-image models need one clear, front-facing photo. Older fine-tuning services asked for 10 to 20 because they trained a small model on your face. If you can supply three or four reference photos from different angles with consistent lighting, likeness accuracy improves noticeably, especially around the jawline and hair.

Why does my face change in AI headshots?

The model is not editing your photo pixel by pixel, it is generating a new image conditioned on your photo. The further your prompt pushes away from the input, in pose, lens or age, the more the model invents. Keep the prompt focused on lighting, background and wardrobe, say "same face, same age, same hairstyle", and avoid asking for a different head angle.

What does it cost to generate headshots through an API?

On Unicorn API, image models used for headshots run from 3 credits (GPT Image 1.5 at low quality) to 6 credits (GPT Image 2.5 Flare at 1K). Credits on a monthly plan cost $0.01 each, so a 24 image batch across three styles lands between $0.72 and $1.44. You can check the exact price of a request before running it with POST /v1/models/price.

What resolution should a headshot be?

A 1K square image is enough for LinkedIn, Slack, conference bios and most team pages, which all downscale to a few hundred pixels. Step up to 2K only for print, a large website hero or a press kit. Paying for 4K generation on a photo that will be displayed at 400 pixels wastes credits and makes skin texture artifacts more visible, not less.

Sources

  1. Diffusion model — Wikipedia
  2. Text-to-image model — Wikipedia
  3. StyleGAN — Wikipedia
  4. Fotor — Wikipedia