Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/civitai/civitai
A repository of models, textual inversions, and more
https://github.com/civitai/civitai
ai social-network stable-diffusion
Last synced: about 15 hours ago
JSON representation
A repository of models, textual inversions, and more
- Host: GitHub
- URL: https://github.com/civitai/civitai
- Owner: civitai
- License: apache-2.0
- Created: 2022-10-11T20:03:20.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T14:33:02.000Z (about 1 month ago)
- Last Synced: 2024-10-29T14:39:12.070Z (about 1 month ago)
- Topics: ai, social-network, stable-diffusion
- Language: TypeScript
- Homepage: https://civitai.com
- Size: 130 MB
- Stars: 6,176
- Watchers: 62
- Forks: 614
- Open Issues: 92
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- stars - civitai/civitai
- awesome-cloudops - Civit.ai - raw/civitai/civitai" alt="Issues"><br><img align="right" src="https://img.shields.io/github/last-commit/civitai/civitai">](https://github.com/civitai/civitai) | | IA, Repository, Stable Diffusion, Models, Embeddings, LoRA | A repository of models, textual inversions, and more | (Tools)
- AiTreasureBox - civitai/civitai - 12-07_6258_0](https://img.shields.io/github/stars/civitai/civitai.svg) | Build a platform where people can share their stable diffusion models | (Repos)
- awesome-language-learning - civitai - A website that contains all kinds of models, optimized for different aesthetics. (Developer Resources / Image generation)
README
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![Apache License 2.0][license-shield]][license-url]
[![Discord][discord-shield]][discord-url]
## Table of Contents
- [About the Project](#about-the-project)
- [Tech Stack](#tech-stack)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Important Scripts](#important-scripts)
- [Contributing](#contributing)
- [Sponsors](#sponsors)
- [License](#license)## About the Project
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.
### Tech Stack
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.
- **DB:** Prisma + Postgres
- **API:** tRPC
- **Front-end + Back-end:** NextJS
- **UI Kit:** [Mantine](https://mantine.dev/)
- **Storage:** Cloudflare## Getting Started
To get a local copy up and running follow these simple example steps.
### Prerequisites
First, make sure that you have the following installed on your machine:
- Node.js (version 18 or later)
- Docker (for running the database)> We recommend you have installed `nvm` in order to set the right node version to run this project
> ```sh
> curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
> ```### Installation
1. Clone the repository to your local machine.
1. Run `npm install` in the project directory to install the necessary dependencies.
1. Spin up required services with `docker-compose up -d`
* Note: In addition to postgres and redis, this will also run maildev for email and minio for s3 storage with all necessary buckets automatically created, minio and maildev are not strictly needed but are preferred for testing and development purposes.
1. Create your `.env` by making a copy of the contents from `.env-example` file.
* Most default values are configured to work with the docker-compose setup, with the exception of the S3 upload key and secret. To generate those, navigate to the minio web interface at [http://localhost:9000](http://localhost:9000) with the default username and password `minioadmin`, and then navigate to the "Access Keys" tab. Click "Create Access Key" and copy the generated key and secret into the `.env` file.
* Set `WEBHOOK_TOKEN` to a random string of your choice. This will be used to authenticate requests to the webhook endpoint.
* Comment out or remove
* `CLICKHOUSE_HOST`
* `CLICKHOUSE_USERNAME`
* `CLICKHOUSE_PASSWORD`
* `CLICKHOUSE_TRACKER_URL`
* Add a random string of your choice to the email properties to allow user registration
* `EMAIL_USER`
* `EMAIL_PASS`
* `EMAIL_FROM` (Valid email format needed)
* Replace `ORCHESTRATOR_ENDPOINT` url with http://localhost
* Set `NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY` to a random string of your choice. This functions as a bypass as stripe credentials are internal
* Add http://localhost as the value to the following fields
* `RESOURCE_RECOMMENDER_URL`
* `NOTIFICATION_DB_URL`
* `NOTIFICATION_DB_REPLICA_URL`
1. Run `npm run db:migrate` to run all database migrations.
1. Run `npm run db:generate` to generate the prisma client.
1. Start the development server by running `npm run dev`.
1. Visit the page `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`)
1. Finally, visit [http://localhost:3000](http://localhost:3000) to see the website.
* Note that account creation will run emails through maildev, which can be accessed at [http://localhost:1080](http://localhost:1080).
* Also note that Cloudflare credentials are necessary in order for image uploads to work.### Important Scripts
```sh
docker-compose up -d # Spin up db, redis, maildev, and minionpm 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
```## Contributing
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!1. Fork the repository to your own GitHub account.
1. Create a new branch for your changes.
1. Make your changes to the code.
1. Commit your changes and push the branch to your forked repository.
1. Open a pull request on our repository.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](https://civitai.com/articles/7782).
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
## License
Apache License 2.0 - Please have a look at the [LICENSE](/LICENSE) for more details.[contributors-shield]: https://img.shields.io/github/contributors/civitai/civitai.svg?style=for-the-badge
[contributors-url]: https://github.com/civitai/civitai/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/civitai/civitai.svg?style=for-the-badge
[forks-url]: https://github.com/civitai/civitai/network/members
[stars-shield]: https://img.shields.io/github/stars/civitai/civitai.svg?style=for-the-badge
[stars-url]: https://github.com/civitai/civitai/stargazers
[issues-shield]: https://img.shields.io/github/issues/civitai/civitai.svg?style=for-the-badge
[issues-url]: https://github.com/civitai/civitai/issues
[license-shield]: https://img.shields.io/github/license/civitai/civitai.svg?style=for-the-badge
[license-url]: https://github.com/civitai/civitai/blob/master/LICENSE
[discord-shield]: https://img.shields.io/discord/1037799583784370196?style=for-the-badge
[discord-url]: https://discord.gg/UwX5wKwm6c