mirror of
https://github.com/civitai/civitai.git
synced 2026-09-20 22:08:18 +08:00
adjusting the readme
This commit is contained in:
@@ -5,3 +5,9 @@ indent_size = 2
|
|||||||
indent_style = space
|
indent_style = space
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.{md,txt}]
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[Makefile]
|
||||||
|
indent_style = tab
|
||||||
@@ -13,23 +13,30 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
- [About the Project](#about-the-project)
|
- [About the Project](#about-the-project)
|
||||||
- [Tech Stack](#tech-stack)
|
- [Tech Stack](#tech-stack)
|
||||||
- [Getting Started](#getting-started)
|
- [Getting Started](#getting-started)
|
||||||
- [Prerequisites](#prerequisites)
|
- [Prerequisites](#prerequisites)
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
- [Important Scripts](#important-scripts)
|
- [Altering your user](#altering-your-user)
|
||||||
|
- [Known limitations](#known-limitations)
|
||||||
- [Contributing](#contributing)
|
- [Contributing](#contributing)
|
||||||
|
- [Data Migrations](#data-migrations)
|
||||||
- [Sponsors](#sponsors)
|
- [Sponsors](#sponsors)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
|
|
||||||
## About the Project
|
## 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.
|
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
|
### 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.
|
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
|
- **DB:** Prisma + Postgres
|
||||||
- **API:** tRPC
|
- **API:** tRPC
|
||||||
@@ -45,63 +52,77 @@ We've built this project using a combination of modern web technologies, includi
|
|||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
First, make sure that you have the following installed on your machine:
|
First, make sure that you have the following installed on your machine:
|
||||||
- Node.js (version 20 or later)
|
|
||||||
- Docker (for running the database and services)
|
|
||||||
- Make (optional, for easier initial setup)
|
|
||||||
|
|
||||||
> We recommend you have installed `nvm` in order to set the right node version to run this project
|
- [Docker](https://www.docker.com/) (for running the database and services)
|
||||||
> ```sh
|
- If using devcontainers
|
||||||
> curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
- An IDE that supports them (VS Code with devcontainers extension, Jetbrains, etc.)
|
||||||
> ```
|
- If running directly
|
||||||
|
- Node.js (version 20 or later)
|
||||||
|
- 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.40.1/install.sh | bash
|
||||||
|
```
|
||||||
|
- Make (optional, for easier initial setup)
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
1. Clone the repository to your local machine.
|
1. Follow the [Prerequisites](#prerequisites) steps above
|
||||||
2. Choose one:
|
2. Clone the repository to your local machine
|
||||||
* Run `make init`
|
3. Choose one:
|
||||||
* This command will do a few things:
|
- Use devcontainers
|
||||||
* Creates a starter `env` file
|
- Open the directory up in your IDE of choice
|
||||||
* Installs npm packages
|
- VS Code should prompt you to "Open in container"
|
||||||
* Spins up docker containers
|
- For other IDEs, you may need to open the `.devcontainer/devcontainer.json` file, and click "Create devcontainer and mount sources"
|
||||||
* Runs any additional database migrations
|
- Run `make init`
|
||||||
* Creates some dummy seed data
|
- This command will do a few things:
|
||||||
* Populates metrics and meilisearch
|
- Creates a starter `env` file
|
||||||
* Initializes prisma
|
- Installs npm packages
|
||||||
* Runs the server
|
- Spins up docker containers
|
||||||
* Please report any issues with these commands to us on [discord][discord-url]
|
- Runs any additional database migrations
|
||||||
* If you see an error about `cross-env` not being found, make sure `node_modules/.bin` is added to your path:
|
- Creates some dummy seed data
|
||||||
* `export PATH="$PATH:$(realpath node_modules/.bin)"`
|
- Populates metrics and meilisearch
|
||||||
* Use dev-containers
|
- Initializes prisma
|
||||||
* TODO: instructions here
|
- Runs the server
|
||||||
3. Edit the `.env.development` file
|
- If you see an error about `cross-env` not being found, make sure `node_modules/.bin` is added to your path:
|
||||||
* Most default values are configured to work out of the box, 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.
|
- `export PATH="$PATH:$(realpath node_modules/.bin)"`
|
||||||
* Set `WEBHOOK_TOKEN` to a random string of your choice. This will be used to authenticate requests to the webhook endpoint.
|
- Please report any issues with these commands to us on [discord][discord-url]
|
||||||
* Add a random string of your choice to the email properties to allow user registration
|
4. Edit the `.env.development` file
|
||||||
* `EMAIL_USER`
|
- Most default values are configured to work out of the box, except the S3 upload key and secret. To generate those, navigate to
|
||||||
* `EMAIL_PASS`
|
the minio web interface at [http://localhost:9000](http://localhost:9000) with the default username and password `minioadmin`, and then navigate
|
||||||
* `EMAIL_FROM` (Valid email format needed)
|
to the "Access Keys" tab. Click "Create Access Key" and copy the generated key and secret into the `.env` file.
|
||||||
4. Finally, visit [http://localhost:3000](http://localhost:3000) to see the website.
|
- Set `WEBHOOK_TOKEN` to a random string of your choice. This will be used to authenticate requests to the webhook endpoint.
|
||||||
* Note that account creation will run emails through maildev, which can be accessed at [http://localhost:1080](http://localhost:1080).
|
- 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)
|
||||||
|
5. 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)._
|
||||||
|
|
||||||
### Altering your user
|
### Altering your user
|
||||||
|
|
||||||
- First, create an account for yourself as you normally would through the UI.
|
- First, create an account for yourself as you normally would through the UI.
|
||||||
- You may wish to set yourself up as a moderator. To do so:
|
- You may wish to set yourself up as a moderator. To do so:
|
||||||
- Use a database editor (like [DataGrip](https://www.jetbrains.com/datagrip/)) or connect directly to the DB (`PGPASSWORD=postgres psql -h localhost -p 15432 -U postgres civitai`)
|
- Use a database editor (like [DataGrip](https://www.jetbrains.com/datagrip/)) or connect directly to the
|
||||||
- Find your user (by email or username), and change `isModerator` to `true`
|
DB (`PGPASSWORD=postgres psql -h localhost -p 15432 -U postgres civitai`)
|
||||||
|
- Find your user (by email or username), and change `isModerator` to `true`
|
||||||
|
|
||||||
### Known limitations
|
### Known limitations
|
||||||
|
|
||||||
Services that require external input will currently not work locally. These include:
|
Services that require external input will currently not work locally. These include:
|
||||||
- Orchestration (Generation, Training)
|
|
||||||
- Signals (Chat, Notifications, other real-time updates)
|
- Orchestration (Generation, Training)
|
||||||
- Buzz
|
- Signals (Chat, Notifications, other real-time updates)
|
||||||
|
- Buzz
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Any contributions you make are **greatly appreciated**.
|
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".
|
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!
|
Don't forget to give the project a star! Thanks again!
|
||||||
|
|
||||||
1. Fork the repository to your own GitHub account.
|
1. Fork the repository to your own GitHub account.
|
||||||
@@ -110,7 +131,8 @@ Don't forget to give the project a star! Thanks again!
|
|||||||
4. Commit your changes and push the branch to your forked repository.
|
4. Commit your changes and push the branch to your forked repository.
|
||||||
5. Open a pull request on our repository.
|
5. 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).
|
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).
|
||||||
|
|
||||||
### Data Migrations
|
### Data Migrations
|
||||||
|
|
||||||
@@ -120,7 +142,7 @@ Over the course of development, you may need to change the structure of the data
|
|||||||
2. Create a folder in the `prisma/migrations folder` named with the convention `YYYYMMDDHHmmss_brief_description_here`
|
2. Create a folder in the `prisma/migrations folder` named with the convention `YYYYMMDDHHmmss_brief_description_here`
|
||||||
3. In this folder, create a file called `migration.sql`
|
3. In this folder, create a file called `migration.sql`
|
||||||
4. In that file, put your sql changes
|
4. In that file, put your sql changes
|
||||||
* These are usually simple sql commands like `ALTER TABLE ...`
|
- These are usually simple sql commands like `ALTER TABLE ...`
|
||||||
5. Run `make run-migrations`
|
5. Run `make run-migrations`
|
||||||
6. If you are adding/changing a column or table, please try to keep the `gen_seed.ts` file up to date with these changes
|
6. If you are adding/changing a column or table, please try to keep the `gen_seed.ts` file up to date with these changes
|
||||||
|
|
||||||
@@ -129,18 +151,30 @@ Over the course of development, you may need to change the structure of the data
|
|||||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
|
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Apache License 2.0 - Please have a look at the [LICENSE](/LICENSE) for more details.
|
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-shield]: https://img.shields.io/github/contributors/civitai/civitai.svg?style=for-the-badge
|
||||||
|
|
||||||
[contributors-url]: https://github.com/civitai/civitai/graphs/contributors
|
[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-shield]: https://img.shields.io/github/forks/civitai/civitai.svg?style=for-the-badge
|
||||||
|
|
||||||
[forks-url]: https://github.com/civitai/civitai/network/members
|
[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-shield]: https://img.shields.io/github/stars/civitai/civitai.svg?style=for-the-badge
|
||||||
|
|
||||||
[stars-url]: https://github.com/civitai/civitai/stargazers
|
[stars-url]: https://github.com/civitai/civitai/stargazers
|
||||||
|
|
||||||
[issues-shield]: https://img.shields.io/github/issues/civitai/civitai.svg?style=for-the-badge
|
[issues-shield]: https://img.shields.io/github/issues/civitai/civitai.svg?style=for-the-badge
|
||||||
|
|
||||||
[issues-url]: https://github.com/civitai/civitai/issues
|
[issues-url]: https://github.com/civitai/civitai/issues
|
||||||
|
|
||||||
[license-shield]: https://img.shields.io/github/license/civitai/civitai.svg?style=for-the-badge
|
[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
|
[license-url]: https://github.com/civitai/civitai/blob/master/LICENSE
|
||||||
|
|
||||||
[discord-shield]: https://img.shields.io/discord/1037799583784370196?style=for-the-badge
|
[discord-shield]: https://img.shields.io/discord/1037799583784370196?style=for-the-badge
|
||||||
|
|
||||||
[discord-url]: https://discord.gg/UwX5wKwm6c
|
[discord-url]: https://discord.gg/UwX5wKwm6c
|
||||||
|
|||||||
Reference in New Issue
Block a user