Our goal with this project is to create a platform where people can share their stable diffusion models (textual inversions, hypernetworks, aesthetic gradients, VAEs, and any other crazy stuff people do to customize their AI generations), collaborate with others to improve them, and learn from each other's work. The platform allows users to create an account, upload their models, and browse models that have been shared by others. Users can also leave comments and feedback on each other's models to facilitate collaboration and knowledge sharing.
We've built this project using a combination of modern web technologies, including Next.js for the frontend, TRPC for the API, and Prisma + Postgres for the database. By leveraging these tools, we've been able to create a scalable and maintainable platform that is both user-friendly and powerful.
To get a local copy up and running follow these simple example steps.
First, make sure that you have the following installed on your machine:
We recommend you have installed
nvm
in order to set the right node version to run this projectcurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
npm install
in the project directory to install the necessary dependencies.docker-compose up -d
.env
by making a copy of the contents from .env-example
file.
minioadmin
, and then navigate to the "Access Keys" tab. Click "Create Access Key" and copy the generated key and secret into the .env
file.WEBHOOK_TOKEN
to a random string of your choice. This will be used to authenticate requests to the webhook endpoint.CLICKHOUSE_HOST
CLICKHOUSE_USERNAME
CLICKHOUSE_PASSWORD
CLICKHOUSE_TRACKER_URL
EMAIL_USER
EMAIL_PASS
EMAIL_FROM
(Valid email format needed)ORCHESTRATOR_ENDPOINT
url with http://localhostNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
to a random string of your choice. This functions as a bypass as stripe credentials are internalRESOURCE_RECOMMENDER_URL
NOTIFICATION_DB_URL
NOTIFICATION_DB_REPLICA_URL
npm run db:migrate
to run all database migrations.npm run db:generate
to generate the prisma client.npm run dev
.http://localhost:3000/api/webhooks/run-jobs?token=WEBHOOK_TOKEN&run=update-metrics
to start the metrics update job (make sure to substitute WEBHOOK_TOKEN
)docker-compose up -d # Spin up db, redis, maildev, and minio
npm run dev # Start the dev environment
npm run db:migrate -- --name migration-name # Create a database migration with prisma after updating the schema
npm run db:generate # Generates local prisma client
npm run db:ui # Start Prisma Studio to manage the database content
npm run build # Build the NextJS project
Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
If you would like to be more involved, consider joining the Community Development Team! For more information on the team as well as how to join, see Calling All Developers: Join Civitai's Community Development Team.
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
Apache License 2.0 - Please have a look at the LICENSE for more details.