Duck
Tutorials7 min read

How to Build Your Own Free Headshot AI Generator

Samet Turan— Editor··7 min read

Stop paying for AI headshots. This guide shows you how to build your own free headshot AI generator using open-source tools and a simple automation workflow.

The Core Stack You Actually Need

Forget the all-in-one apps. They’re overpriced black boxes. To build a proper headshot generator, you need three things: an image model, a way to teach it your face, and an API to call it. That’s it. The rest is just a user interface.

For the model, we’re using Stable Diffusion. It’s open-source, powerful, and there are thousands of pre-trained styles available. The key isn’t the base model, but how you customize it. This is where most people get stuck.

You teach Stable Diffusion your face using a technique called Low-Rank Adaptation, or LoRA. Think of it as a tiny, hyper-focused training file that sits on top of the main model. It doesn’t change the billion-parameter base model; it just guides it to generate a specific face—yours. This is why you can get consistent results, unlike just trying to describe your face in a Midjourney prompt.

Finally, you need a way to run this without buying a $3,000 GPU. We use a cloud GPU provider with a simple API. My go-to is Replicate. You pay per second of compute time. No subscriptions, no servers to manage. You send an API request with your prompt and your trained LoRA, and you get back an image. This is the core of our no code AI workflow.

What Most Guides Get Wrong About AI Headshots

Most tutorials on this topic are dangerously simplistic. They give you advice that sounds good but falls apart as soon as you try it.

First is the myth of the “perfect prompt.” You cannot accurately describe a unique human face in words. You’ll get a generic, airbrushed person who vaguely resembles you. The only way to get *your* face is to show the model your face. That means training a LoRA. There are no shortcuts.

Second, there’s the idea that you need to be a machine learning engineer with a monster gaming PC. False. Services like Replicate or RunPod let you rent GPU time for pennies. A full LoRA training run might cost you $1.50. Generating 100 headshots might cost another 50 cents. Compare that to the $29/month subscription most headshot apps charge. The pricing is so low it feels like a mistake.

The last bit of bad advice is about training data. People say to upload any 10 selfies from your phone. Garbage in, garbage out. If you train it on blurry, poorly-lit photos from the same angle, you’ll get blurry, poorly-lit AI images from the same angle. You need a curated dataset of 15-20 images with varied lighting, different facial expressions, and multiple angles. Clean backgrounds help a lot. This is the single most important step, and the one most people rush.

Step-by-Step: Training Your Personal Headshot Model

This is where the work happens. It’s not hard, but it requires attention to detail. Do this once, and you can generate thousands of headshots forever.

  1. Curate Your Training Set. Find 15-20 high-resolution photos of yourself. Don’t use photos with sunglasses, hats, or other people. Vary the background, your expression (smiling, neutral), and the angle of your face. Make sure your face is well-lit and in focus. This is your foundation.
  2. Choose a Training Service. You can do this on Replicate directly. They have a pre-built workflow for LoRA training. You upload your images, set a few parameters, and it handles the rest.
  3. Set Your Training Parameters. You’ll need to define two key terms. The instance_prompt is a unique, made-up word that will represent you. Something like a photo of sks man (using your initials is a common trick). The class_prompt is the general category, like a photo of a man. This teaches the model to associate your unique word with your face, distinct from the generic concept of “a man.”
  4. Launch the Training. You’ll upload your zipped folder of images and start the job. It will take anywhere from 20 to 60 minutes. Go get a coffee. The service is provisioning a GPU, running the training script, and saving the resulting LoRA file for you. Once it’s done, you’ll get a model ID. Guard that ID; it’s the key to your personal image generator.

That’s the training process. You now have a custom AI model that knows your face.

Are Cloud GPU Free Tiers Actually Usable?

No. Plain and simple.

This is my biggest gripe with this space. Many platforms offer a “free tier” that is functionally useless. I’ve seen free GPUs with 20-minute cold start times, meaning you send a request and wait 20 minutes for the machine to even turn on before it starts working. More often than not, the request just times out. It’s a marketing gimmick designed to get you on the platform, not a viable tool for doing real work.

Honestly, the free plan is a joke on most of these platforms. They are loss-leaders designed to frustrate you into upgrading.

This is why I love the pure pay-as-you-go model. RunPod is fantastic for this. You can rent a high-end GPU like an A100 for a few dollars an hour, or use their serverless product which is priced per-second like Replicate. I can spin up an instance, run my job, and spin it down. The total cost for an entire project might be less than $5. That’s a fair price. The $199/mo enterprise plans for some of these tools are ridiculous for what you get, especially for a solo operator.

Don’t waste your time chasing free credits or fighting with crippled free tiers. Your time is more valuable than that. Pay the two dollars and get your work done in ten minutes instead of spending three hours in a queue.

Generating Shots: Prompts, Parameters, and Fixing Weird Hands

With your trained LoRA model, generating images is the fun part. You’ll make API calls to your model endpoint, providing a prompt that includes your unique instance prompt.

A good starting prompt structure looks like this:

professional linkedin headshot of sks man, corporate office in the background, wearing a blue suit, sharp focus, dramatic lighting

The key is including your trigger phrase, sks man. The rest of the prompt defines the style, clothing, and environment. You can swap out “linkedin headshot” for “casual outdoor portrait” or “black and white studio photo.”

Beyond the prompt, you’ll want to use a negative_prompt. This tells the model what to avoid. It’s absolutely critical for cleaning up common AI mistakes.

A solid negative prompt is:

(deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers:1.4), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation

This specifically targets issues like mangled hands—the classic tell of AI imagery. You can also adjust parameters like guidance_scale, which controls how strictly the model follows your prompt. A value between 7 and 10 is usually the sweet spot. Experiment. Generate batches of 10 or 20 images at a time and find the one or two great shots. This is the operator playbook: build the system, then iterate to get the quality you need.

How to Debug When It All Goes Sideways

Even with a good process, things break. Your first batch of images might look nothing like you, or they could be a mess of digital artifacts. Here’s how to troubleshoot.

If the face doesn’t look like you: This is almost always a training data problem. Your 15-20 images weren’t varied enough, or they were too low-quality. The model didn’t get a good enough signal to learn your features. The fix is painful but necessary: curate a better dataset and retrain the LoRA. Don’t try to fix a bad model with clever prompting; it won’t work.

If the images are blurry or low quality: Check your generation parameters. You might need to increase the number of inference steps to around 30 or 40. Also, make sure you’re using a good sampler. I find DPM++ 2M Karras gives consistently sharp results. If the quality is still bad, your base model might be the issue. Try a different version of Stable Diffusion, like SDXL.

If you’re getting API errors: This is usually a simple syntax issue. Double-check that your API key is correct and that you’re passing the full model ID (usually `username/model-name:version-hash`). Read the error message carefully—and good luck finding the docs for this sometimes. The error often tells you exactly which parameter it didn’t like. It’s rarely a problem with the service itself; it’s usually a typo on your end.

Building your own systems means you’re also the one who has to fix them. It’s a fundamental part of the ai agent framework.

This entire process, from data collection to final image generation, is a repeatable workflow. You can build it yourself using the steps above to get full control over your professional image.

Adjacent reading: deeper coverage of AI agent platforms.

If you’d rather skip the build and deploy a working version in an afternoon, we’ve packaged this workflow as a 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.