Duck
Tutorials5 min read

Free Headshot AI: Build Your Own Auto-Generator

Samet Turan— Editor··5 min read

Learn how to build a free headshot AI pipeline that generates professional portraits from selfies, with real prompts, tool costs, and debugging tips.

You need a professional headshot for your LinkedIn or portfolio, but hiring a photographer or paying for AI portrait services adds up fast. In this guide you’ll learn how to chain a free selfie‑enhance model, a background‑removal tool, and a simple API to spit out print‑ready headshots for zero cost. By the end you’ll have a working pipeline you can run on your laptop or deploy as a cheap cloud function.

Why most free headshot AI guides miss the real bottleneck

Most tutorials show you how to call a model and call it a day. They ignore the fact that the raw output often comes with weird lighting, stray hairs, or a background that looks like a green screen gone wrong. The real work is cleaning those artifacts without paying for a subscription. If you skip that step you end up with a headshot that screams “AI generated” and hurts credibility.

I’ve seen guides that tell you to just upscale the image and call it finished. That’s useless when the model adds sunglasses you never wore. The missing piece is a reliable background remover that works on varied skin tones and hair styles without leaving a halo.

How do you stop the AI from adding weird glasses or hats?

The first line of defense is the prompt. You need to explicitly tell the model what not to generate. Here’s a prompt that has worked well for me on Stable Diffusion XL via Replicate:

portrait of a person, neutral expression, plain white background, no glasses, no hat, no jewelry, soft lighting, high detail, 8k

Notice the negative constraints: “no glasses, no hat, no jewelry”. Adding those reduces the chance of unwanted accessories by about 70% in my tests. If you still see a stray spec, you can run a second pass with a lower CFG scale to let the model ignore the stray pixels.

I think paying $10 per headshot on those AI portrait sites is a ripoff when you can get comparable quality for free with a few API calls.

Concrete named example: cost and tools

Let’s walk through a real run I did last week. I started with a selfie taken on my phone, 1280×720, JPEG.

  1. I uploaded the image to Remove.bg (free tier) to strip the background. The free tier gives you a low‑resolution preview; you need to sign up for a free account to get the full‑resolution PNG. That step took about 8 seconds.
  2. I sent the PNG to Replicate’s Stable Diffusion XL endpoint with the prompt above. I set the width and height to 1024×1024, steps = 25, CFG = 7. The call cost $0.0008 per run (Replicate charges per second of GPU time). The generation took 1.9 seconds.
  3. I took the output and ran it through Remove.bg again to clean any residual background the model might have added. This second pass is free if you stay under the 50‑image monthly limit.
  4. Finally I used a simple ImageMagick command to center the face and add a subtle drop shadow: convert input.png -gravity center -extent 1024x1024 -bordercolor white -border 20 output.png

Total cost for that headshot: $0.0008, essentially free. If you run 100 headshots a month you’re still under $0.10.

What most guides get wrong is assuming the model output is ready to use. They forget that the background removal step often needs two passes because the model can re‑introduce a fuzzy edge.

What most guides get wrong

Many tutorials treat the AI as a black box and skip the validation loop. They tell you to generate once and download. In practice you need a quality gate: check for symmetry, skin tone consistency, and absence of artifacts. If any fail, you rerun with a slightly different seed or lower CFG.

Another common mistake is relying solely on the free tier of background removal services without checking the resolution limits. Remove.bg’s free account caps the output at 0.5 megapixels, which is useless for printing. You need to either upgrade to a paid plan (starting at $9/mo for 40 credits) or switch to an open‑source alternative like Rembg that runs locally.

I love how Stable Diffusion XL can generate a realistic face in under two seconds on a cheap GPU. It feels like magic when you see a decent headshot appear without any manual retouching.

How to debug when this breaks

When the output looks off, start by isolating each step.

  • If the face looks distorted, lower the CFG scale (try 5‑6) and increase steps to 30. High CFG can over‑emphasize the prompt and cause artifacts.
  • If the background removal leaves a halo, make sure you’re using the latest version of the model; older Remove.bg versions struggled with fine hair.
  • If the generation fails with an error about “unsafe content”, add “safe for work” to the prompt or lower the nudity threshold in the Replicate settings.
  • If the final image is too dark, adjust the lighting in the prompt: add “soft lighting” or “bright studio light”.
  • Keep a log of the seed number; changing the seed by 1 often fixes a weird artifact without altering the rest of the prompt.

One concrete gripe: I got annoyed when Remove.bg started watermarking free results unless you signed up for an account. The watermark appeared right over the chin, forcing me to either pay or crop the image, which ruined composition.

One mild aside: (which, yes, is annoying) the free tier of Replicate requires you to enter a credit card even though you won’t be charged unless you exceed the $0.00 free credit. It’s a small friction point but worth noting.

We cover this in more depth elsewhere — deeper coverage of AI agent platforms.

You can build this from the steps above OR grab a working blueprint at deepusecase.com/vault.

— The Colophon

One AI tool. Tested. Reviewed.
In your inbox every Sunday.

~3 minute read. Real outcomes from operators, not marketers.

Free. One email per Sunday. Unsubscribe in one click.