[![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 Table of Contents About the Project - Tech Stack Getting Started - Prerequisites - Installation - Altering your user…
[![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
- [Table of Contents](#table-of-contents)
- [About the Project](#about-the-project)
- [Getting Started](#getting-started)
- [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
- Storage: Cloudflare
Getting Started
To get a local copy up and running, follow these steps.
Prerequisites
First, make sure that you have the following installed on your machine:
- Docker (for running the database and services)
- If using devcontainers
- If running directly
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
1. Follow the [Prerequisites](#prerequisites) steps above
2. Clone the repository to your local machine
3. Choose one method:
- a) Use devcontainers
> ⚠️ Important Warning for Windows Users: Either clone this repo onto a WSL volume, or use the "clone repository in named container volume"
command. Otherwise, you will see performance issues.
- Open the directory up in your IDE of choice
- VS Code should prompt you to "Open in container"
- If not, you may need to manually run Dev Containers: Open Folder in Container
- For other IDEs, you may need to open the .devcontainer/devcontainer.json file, and click "Create devcontainer and mount sources"
- _Note: this may take some time to run initially_
- Run make run or npm run dev
- b) Run make init
- This command will do a few things:
- Creates a starter env file
- Installs npm packages
- Spins up docker containers
- Runs any additional database migrations
- Creates some dummy seed data
- Populates metrics and meilisearch
- Initializes prisma
- Runs the server
- If you see an error about an app not being found, make sure node_modules/.bin is added to your path:
- export PATH="$PATH:$(realpath node_modules/.bin)"
- If you are an internal member, you can use the buzz and signals service
- Set this up once by creating a personal access token in github (with read package permissions)
- Set that to CR_PAT env
- Run echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
- Please report any issues with these commands to us on [discord][discord-url]
4. Edit the .env.development file
- Most default values are configured to work out of the box, except the S3 upload key and secret. To generate those, navigate to
the minio web interface at 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 (S3_UPLOAD_KEY and S3_UPLOAD_SECRET, S3_IMAGE_UPLOAD_KEY and S3_IMAGE_UPLOAD_SECRET).
- Set WEBHOOK_TOKEN to a random string of your choice. This will be used to authenticate requests to the webhook endpoint.
- 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. Run git submodule update --recursive
6. Finally, visit http://localhost:3000 to see the website.
_* Note that account creation will run emails through maildev, which can be accessed at http://localhost:1080._
Altering your user
- 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:
PGPASSWORD=postgres psql -h localhost -p 15432 -U postgres civitai)
- Find your user (by email or username), and change isModerator to true
Known limitations
Services that require external input will currently not work locally. These include:
- Orchestration (Generation, Training)
- Signals (Chat, Notifications, other real-time updates)
- Buzz
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.
2. Create a new branch for your changes.
3. Make your changes to the code.
4. Commit your changes and push the branch to your forked 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.
Data Migrations
Over the course of development, you may need to change the structure of the database. To do this:
1. Make your changes to the packages/civitai-db-schema/prisma/schema.prisma file
2. Run pnpm run db:migrate:empty "brief description here". This creates
packages/civitai-db-schema/prisma/migrations/YYYYMMDDHHmmss_brief_description_here/migration.sql
for you, in the one directory Prisma reads.
To create it by hand instead, use that same path — not the prisma/migrations
directory at the repo root, which predates the monorepo layout and is no longer read.
3. Put your sql changes in the generated migration.sql
- These are usually simple sql commands like ALTER TABLE ...
4. Run make run-migrations and make gen-prisma
5. If you are adding/changing a column or table, please try to keep the gen_seed.ts file up to date with these changes.
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
-
civitai ★ PINNED
A repository of models, textual inversions, and more
TypeScript ★ 7.2k 5h agoExplain → -
sd_civitai_extension
All of the Civitai models inside Automatic 1111 Stable Diffusion Web UI
Python ★ 2.4k 2y agoExplain → -
civitai_comfy_nodes
Comfy Nodes that make utilizing resources from Civitas easy as copying and pasting
Python ★ 171 1mo agoExplain → -
civitai-comfy-nodes
ComfyUI custom node pack exposing Civitai Orchestration recipe endpoints as generated nodes
Python ★ 42 21d agoExplain → -
civitai-link-desktop
Manage your Civitai models for your Stable Diffusion Web UI models folder
TypeScript ★ 36 10mo agoExplain → -
CivitUI
A comfier GUI for Civitai generations
TypeScript ★ 35 2y agoExplain → -
civitai-javascript
Civitai Generator Node.js Client
TypeScript ★ 26 2y agoExplain → -
cf-images-r2-cache
A CF Worker to cache images from CF Images in R2
TypeScript ★ 25 3y agoExplain → -
civitai-python ▣
[RETIRED] Unmaintained Python client for the Civitai generation API — use the API directly: developer.civitai.com
Python ★ 25 26d agoExplain → -
civitai-gen-skill
Generate images, video, audio and more via Civitai's orchestration API — a runtime-agnostic agent skill (AgentSkills format, zero deps, Node 18+).
JavaScript ★ 16 1mo agoExplain → -
multithreaded-downloader-js ⑂ ▣
A browser based multithreaded downloader implemented in Javascript
JavaScript ★ 9 3y agoExplain → -
civitai-client-javascript
Civitai's javascript client for generating ai content
TypeScript ★ 6 17h agoExplain → -
cli
Browse & download Civitai models, images & articles from the command line - and author, validate & submit Apps
Go ★ 4 5h agoExplain → -
ai-toolkit ⑂
The ultimate training toolkit for finetuning diffusion models
Python ★ 4 21h agoExplain → -
civitai-app-starters
Starter templates + shared OAuth/PKCE SDK for building third-party Civitai apps
TypeScript ★ 3 16h agoExplain → -
calcom-docker ⑂
The Docker configuration for Cal.com is an effort powered by people within the community. Cal.com, Inc. does not provide official support for Docker, but we will accept fixes and documentation. Use at your own risk.
★ 3 2y agoExplain → -
civitai-developer-docs
Developer documentation site (developer.civitai.com) — orchestration API docs, SDKs, recipes
JavaScript ★ 2 2d agoExplain → -
SPM ⑂
Official implementation of paper "One-dimensional Adapter to Rule Them All: Concepts, Diffusion Models and Erasing Applications".
Python ★ 2 1y agoExplain → -
ComfyUI ⑂
The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
Python ★ 1 1d agoExplain → -
event-engine-common
No description.
TypeScript ★ 1 6d agoExplain → -
pullrequest-operator ⑂
Polls a branch in a git provider for new pull requests
Go ★ 1 27d agoExplain → -
vitrine
Marketing Studio using Civitai SDK
TypeScript ★ 1 1mo agoExplain → -
orchestrator-issues
Report bugs and request features for the Civitai Orchestrator API. Issue tracker for developers building against the orchestrator.
★ 1 1mo agoExplain → -
civitai-mcp-server
MCP server exposing Civitai's APIs (browse models/images, post, react, review, collections, articles, comments, DMs, bounties) to AI agents. Self-hostable — point CIVITAI_API_URL at civitai.com or an in-cluster service.
TypeScript ★ 1 1mo agoExplain → -
ComfyUI_smZNodes ⑂
Custom nodes for ComfyUI such as CLIP Text Encode++
Python ★ 1 3mo agoExplain → -
ggufy ⑂
CLI/GUI tool for efficient and easy safetensors and gguf model conversion
Zig ★ 0 3d agoExplain → -
homebrew-tap
Homebrew tap for the civitai CLI (goreleaser-published)
Ruby ★ 0 4d agoExplain → -
app-panorama-360
Panorama 360 — Civitai onsite App Block (panorama-360.civit.ai)
TypeScript ★ 0 6d agoExplain → -
bitdex
Purpose-built in-memory bitmap index engine. Filter + sort → ordered Vec<i64> of IDs. Bitmaps all the way down.
Rust ★ 0 11d agoExplain → -
pipeline-trigger-operator ⑂
Automated creation of Tekton PipelineRuns on events from Flux resources
Go ★ 0 27d agoExplain → -
roaring-rs
No description.
Rust ★ 0 4mo agoExplain → -
esigner-codesign ⑂
No description.
TypeScript ★ 0 2y agoExplain →
No repos match these filters.