Git Product home page Git Product logo

headshots-starter's Introduction

👨‍💼 Headshot AI - Professional Headshots with AI

Introducing Headshot AI, an open-source project from Leap AI that generates Professional AI Headshots in minutes.

Deploy with Vercel

Headshot AI Demo

How It Works

The app is powered by:

Just add Stripe and you have a Headshot AI SaaS in a box.

Headshot AI Explainer

Running Locally

To create your own Headshot AI app, follow these steps:

  1. Clone the repository:
git clone https://github.com/leap-ai/headshots-starter.git
  1. Enter the headshots-starter directory:
cd headshots-starter
  1. Install dependencies:

    For npm:

    npm install

    For yarn:

    yarn
  2. Create a new Supabase project and create the tables required for the app:

    For this starter repo we disabled Row level permissions, you can enable them as needed for your own security, in the supasbase table settings

    Visualized Schemas

    This code block defines the schema for three tables: images, models, and samples.

    For any table column with foreign_key, make sure to link it while creating the column in Supabase.

    [images]

    • id (int8)
    • modelId (int8) (foreign_key)*
    • uri (text)
    • created_at (timestamptz)

    [models] - (Make sure to enable realtime on this table)

    • id (int8)
    • name (text)
    • type (text)
    • created_at (timestamptz)
    • user_id (uuid) (foreign_key)*
    • status (text)
    • modelId (text)

    [samples]

    • id (int8)
    • uri (text)
    • modelId (int8) (foreign_key)*
  3. Create a Leap AI account

    In your .env.local file:

    • Fill in your_api_key with your Leap API key
    • Fill in your-hosted-url/leap/train-webhook with https://{your-hosted-url}/leap/train-webhook
    • Fill in your-hosted-url/leap/image-webhook with https://{your-hosted-url}/leap/image-webhook
    • Fill in your-webhook-secret with any arbitrary URL friendly string eg.shadf892yr398hq23h

    Note - on your first deploy you can use https://headshots-starter.vercel.app as a placeholder for your-hosted-url. Once you deploy your own app, swap the url in.

  4. Create a Resend account

    • Fill in your-resend-api-key with your Resend API Key
  5. Start the development server:

    For npm:

    npm run dev

    For yarn:

    yarn dev
  6. Visit http://localhost:3000 in your browser to see the running app.

One-Click Deploy

Deploy the example using Vercel:

Deploy with Vercel

Or fork the repo and Deploy using Replit.

How To Get Good Results

Good results Demo

The image samples used to teach the model what your face looks like are critical. Garbage in = garbage out.

  • Enforce close-ups of faces and consider cropping so that the face is centered.
  • Enforce images with only one person in the frame.
  • Avoid accessories in samples like sunglasses and hats.
  • Ensure the face is clearly visible. (For face detection, consider using tools like Cloudinary API).

Avoid mutiple faces

If you get distorted results with multiple faces, repeated subjects, multiple limbs, etc, make sure to follow these steps and minimize the chance of this happening:

  • Make sure any samples uploaded are the same 1:1 height / width aspect ratio, for example 512x512, 1024x1024, etc.
  • Avoid mutiple people in the samples uploaded.
  • Add "double torso, totem pole" to the negative prompt when generating.
  • Make sure your dimensions when generating are also 1:1 with the same height / width ratios of the samples.

For more information on how to improve quality, read the blog here.

Additional Use-Cases

Headshot AI can be easily adapted to support many other use-cases on Leap AI including:

Anime AI Demo

  • Pet Portraits

Pet AI Demo

  • Product Shots
  • Food Photography

Product AI Demo

Icons AI Demo

& more!

Contributing

We welcome collaboration and appreciate your contribution to Headshot AI. If you have suggestions for improvement or significant changes in mind, feel free to open an issue!

Resources and Support

License

Headshot AI is released under the MIT License.

headshots-starter's People

Contributors

marfuen avatar claudfuen avatar alexschachne avatar timelf123 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.