• Stars
    star
    3,526
  • Rank 12,611 (Top 0.3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 2 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An open-source AI avatar generator web app - https://photoshot.app

Photoshot

Twitter

An open-source AI avatar generator web app

demo-final.mp4

Try it out at photoshot.app

Stack

  • β–² Next.js for webapp
  • πŸ–Ό Chakra UI for UI components
  • πŸ“¦ Prisma for database
  • 🧠 Replicate, a platform for running machine learning models in the cloud
  • πŸ’° Stripe for payments
  • πŸ‘©β€πŸŽ¨ Stable Diffusion an open-source text-to-image generation model

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:

// Database connection string of your database (postgresql here)
DATABASE_URL=postgresql://photoshot:photoshot@localhost:5432/photoshot
// https://next-auth.js.org/configuration/options#nextauth_url
NEXTAUTH_URL=http://localhost:3000

// AWS S3 bucket info (for storing pictures)
S3_UPLOAD_KEY=
S3_UPLOAD_SECRET=
S3_UPLOAD_BUCKET=
S3_UPLOAD_REGION=

// Replicate API token / username
REPLICATE_API_TOKEN=
REPLICATE_USERNAME=
REPLICATE_MAX_TRAIN_STEPS=3000
REPLICATE_NEGATIVE_PROMPT=
REPLICATE_HD_VERSION_MODEL_ID=

// Replicate instance token (should be rare)
NEXT_PUBLIC_REPLICATE_INSTANCE_TOKEN=

// Random secret for NextAuth
SECRET=

// SMTP server and email address to send emails from
EMAIL_FROM=
EMAIL_SERVER=smtp://localhost:25

// Stripe API key
STRIPE_SECRET_KEY=

// Price of a studio in cents (ie: 1000 = $10)
NEXT_PUBLIC_STRIPE_STUDIO_PRICE=

// Amount of allowed shots per studio
NEXT_PUBLIC_STUDIO_SHOT_AMOUNT=

// Prompt wizard
OPENAI_API_KEY=
OPENAI_API_SEED_PROMPT=

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.