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.
- 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.
- 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.
- 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.
- 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.
