Home

Awesome

Photoshot

Twitter

photobooth-ai.app

An open-source AI avatar generator web app

Photoshot

Try it out at photoshot.app

Stack

Getting Started

Install dependencies:

yarn install

You can use Docker to run a local postgres database and maildev server (accessible at http://localhost:1080):

docker-compose up -d

Create .env.local:

cp .env.example .env.local

Update environment variable values:

Environment VariableExplanation
DATABASE_URLThe connection string for your PostgreSQL database. It will be postgresql://photoshot:photoshot@localhost:5432/photoshot if you are using the provided docket setup.
NEXTAUTH_URLThe URL of your Next.js application, used for authentication purposes with NextAuth.js.
S3_UPLOAD_KEYThe access key for your AWS S3 bucket used for storing pictures.
S3_UPLOAD_SECRETThe secret key for your AWS S3 bucket used for storing pictures.
S3_UPLOAD_BUCKETThe name of your AWS S3 bucket used for storing pictures.
S3_UPLOAD_REGIONThe AWS region where your S3 bucket is located.
REPLICATE_API_TOKENThe API token for Replicate.
REPLICATE_USERNAMEThe username associated with your Replicate account.
REPLICATE_MAX_TRAIN_STEPSThe maximum number of training steps for the Dreambooth AI model. Defaults to 3000.
REPLICATE_NEGATIVE_PROMPTA prompt used for negative training examples in the Replicate AI model. Defualts to cropped face, cover face, cover visage, mutated hands
REPLICATE_HD_VERSION_MODEL_IDThe version of the model for upscaling the generated images. Such models can be browsed here
NEXT_PUBLIC_REPLICATE_INSTANCE_TOKENA unique identifier for the training data. It can be any string. For best results use an identifier containing three Unicode characters, without spaces e.g. cjw
SECRETA random string used for NextAuth.js authentication.
EMAIL_FROMThe email address from which emails will be sent.
EMAIL_SERVERThe SMTP server URL used for sending emails. It will be http://localhost:25 if you are using the provided docker setup,
STRIPE_SECRET_KEYThe API key for your Stripe account.
NEXT_PUBLIC_STRIPE_STUDIO_PRICEThe price of a studio in cents (e.g., 1000 = $10).
NEXT_PUBLIC_STUDIO_SHOT_AMOUNTThe maximum number of shots allowed per studio.
OPENAI_API_KEYThe API key for the OpenAI API, used for the prompt wizard feature.
OPENAI_API_SEED_PROMPTA seed prompt used for generating style prompts using the OpenAI API.

Please note that if you want to use the provided docker-compose setup you have to disable TLS in your .env.local by adding:

NODE_TLS_REJECT_UNAUTHORIZED = "0"

Run migrations

yarn prisma:migrate:dev

Run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.