Updates README

This commit is contained in:
Manuel E. Urena
2022-11-09 18:40:28 -04:00
parent 76451c5eb6
commit 4fb4a00c89
7 changed files with 93 additions and 26 deletions
+1 -1
View File
@@ -1 +1 @@
16
18
+88 -22
View File
@@ -1,23 +1,47 @@
# Civitai
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
<br />
<div align="center">
<a href="https://civitai.com/">
<img src="media/logo.png" alt="Logo" width="120" height="40">
</a>
</div>
## Table of Content
- [About the Project](#about-the-project)
- [Built with](#built-with)
- [Features](#features)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Important Scripts](#important-scripts)
- [Contributing](#contributing)
- [Sponsors](#sponsors)
- [License](#license)
## About the Project
![Civitai Homepage Screenshot](media/header.png)
Share you models, textual inversions, hypernetworks, aesthetic gradients, and any other crazy stuff people do to customize their AI generations.
## Built with
### Built with
- **DB:** Prisma + Postgres
- **API:** tRPC
- **Front-end + Back-end:** NextJS
- **UI Kit:** [Mantine](https://mantine.dev/)
- **Storage:** Wasabi
- **Storage:** Cloudflare
- **Hosting:** Railway
## Features
- [ ] Browse Models
- [ ] Also through API for SD forks
- [ ] Name, tags, downloads, favorites
- [ ] User accounts
- [ ] oAuth: GitHub, Google, Discord
- [ ] Interacting with Models:
### Features
- Browse Models
- Name, tags, downloads, favorites
- Interacting with Models
- Name
- Trained Words (a list of words that this model knows)
- Description
@@ -29,26 +53,68 @@ Share you models, textual inversions, hypernetworks, aesthetic gradients, and an
- Training Images (optional)
- Training Steps
- Download (Tracked)
- Tag (Completely open, let them tag however)
- [ ] Reviews
- Version? (optionally attached to a specific version)
- Tag (Completely open)
- Reviews
- Version
- Images Attachments
- Text Review
- Rate (Star system 1-5)
## Contributing
## Getting Started
### Getting Started
```bash
npm i # Install all the packages
cp .env-sample .env # Create and populate the .env file
npm run dev # Start building...
To get a local copy up and running follow these simple example steps.
### Prerequisites
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 repo
```sh
git clone https://github.com/civitai/civitai.git
```
1. Install NPM packages
```sh
npm install
```
1. Config your env vars
```sh
cp .env-example .env
```
### Important Scripts
```bash
```sh
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
```
```
## 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 Project
1. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
1. Commit your Changes (`git commit -am 'Add some AmazingFeature'`)
1. Push to the Branch (`git push origin feature/AmazingFeature`)
1. Open a Pull Request
## 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.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

+1 -1
View File
@@ -176,7 +176,7 @@ const MasonryItem = ({
query: nsfw && session?.user?.blurNsfw ? { showNsfw: true } : undefined,
}}
as={`models/${id}`}
// prefetch={false}
// prefetch={false}
>
<Card
ref={ref}
@@ -67,6 +67,7 @@ function ReviewItem({ data: review }: ItemProps) {
const { data: session } = useSession();
const router = useRouter();
const isOwner = session?.user?.id === review.user.id;
const isMod = session?.user?.isModerator ?? false;
const queryUtils = trpc.useContext();
const deleteMutation = trpc.review.delete.useMutation({
@@ -168,7 +169,7 @@ function ReviewItem({ data: review }: ItemProps) {
</ActionIcon>
</Menu.Target>
<Menu.Dropdown>
{isOwner ? (
{isOwner || isMod ? (
<>
<Menu.Item
icon={<IconTrash size={14} stroke={1.5} />}
+1 -1
View File
@@ -1,4 +1,4 @@
import { MetricTimeframe, Prisma } from '@prisma/client';
import { Prisma } from '@prisma/client';
import { imageDetailsSelect, imageSimpleSelect } from '~/server/validators/image/selectors';
export const modelWithDetailsSelect = Prisma.validator<Prisma.ModelSelect>()({