Giter Club home page Giter Club logo

civitai-china's Introduction

Contributors Forks Stargazers Issues Apache License 2.0 Discord


Table of Content

关于该项目

本项目的目标是创建一个平台,让人们可以分享他们的稳定扩散模型(文本反转、超网络、美学梯度、变分自动编码器以及其他人们用来定制AI生成的疯狂方法),与他人合作改进这些模型,并互相学习。该平台允许用户创建账户,上传他们的模型,并浏览他人分享的模型。用户还可以在彼此的模型上留下评论和反馈,以促进合作和知识共享。

技术栈

我们使用了一系列现代Web技术来构建这个项目,其中包括Next.js作为前端框架,TRPC作为API工具,以及Prisma和Postgres作为数据库。通过利用这些工具,我们成功创建了一个可扩展和易于维护的平台,既用户友好又功能强大。

  • 数据库: Prisma + Postgres
  • API: tRPC
  • 前后端: NextJS
  • UI Kit: Mantine
  • 空间: Cloudflare

入门指南

若要在本地运行并进行简单示例操作,请按照以下步骤进行操作:

准备

首先,请确保您的计算机已安装以下内容:

  • Node.js (18或者以上)
  • Docker (运行数据库)

我们建议您安装nvm,以便设置正确的Node版本来运行此项目。

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash

安装

请按照以下步骤在本地机器上进行操作:

  1. 将存储库克隆到您的本地机器。
  2. 在项目目录中运行npm install,安装所需的依赖项。
  3. 使用docker-compose up -d启动所需的服务。
    • 注意:除了PostgreSQL和Redis外,这还将自动运行用于电子邮件的maildev和用于S3存储的minio,并自动创建所有必要的存储桶。尽管minio和maildev不是强制性的,但在测试和开发过程中它们是首选。
  4. 通过从.env-example文件中复制内容创建您的.env文件。
    • 大多数默认值都已配置为与docker-compose设置配合工作,除了S3上传密钥和密钥。要生成这些,请访问minio的Web界面http://localhost:9000,使用默认用户名和密码minioadmin,然后导航到"Access Keys"选项卡。点击"Create Access Key",并将生成的密钥和密钥复制到.env文件中。
    • WEBHOOK_TOKEN设置为您选择的随机字符串。这将用于对webhook端点的请求进行身份验证。
  5. 运行npm run db:migrate来运行所有数据库迁移。
  6. 运行npm run db:generate以生成Prisma客户端。
  7. 运行npm run dev启动开发服务器。
  8. 访问页面http://localhost:3000/api/webhooks/run-jobs?token=WEBHOOK_TOKEN&run=update-metrics以启动度量更新作业(确保替换WEBHOOK_TOKEN)。
  9. 最后,访问http://localhost:3000以查看网站。
    • 请注意,帐户创建将通过maildev发送电子邮件,可以在http://localhost:1080访问maildev。
    • 还请注意,为了使图像上传工作,需要Cloudflare凭据。

请根据您的具体情况进行相应的安装和设置。

重要脚本

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

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.

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 for more details.

civitai-china's People

Contributors

bkdiehl avatar charleprr avatar eltociear avatar garfield550 avatar ikun886-cxk avatar justmaier avatar koenbeuk avatar lychees avatar manuelurenah avatar peterlorre avatar rockerboo avatar zaidhaan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.