• Stars
    star
    120
  • Rank 295,983 (Top 6 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 1 year ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ChatVisualNovel - a fully customizable visual novel engine powered by ChatGPT. ChatVisualNovel —— 基于ChatGPT的定制化视觉小说引擎。

ChatVisualNovel - A fully customizable visual novel engine powered by ChatGPT

ci GitHub Discord

English | 简体中文

Online Demo: https://chatvisualnovel.com/

Genshin Impact Doujin: https://genshin.chatvisualnovel.com/

Ace Attorney Doujin: https://ace.chatvisualnovel.com/

Screenshot

Join us:

Chat Server

Deploy ChatVisualNovel on Vercel with Planetscale

Follow these steps to deploy ChatVisualNovel on Vercel with a serverless MySQL database provided by Planetscale:

  1. Clone ChatVisualNovel from GitHub.
  2. Create a Vercel account and connect it to your GitHub account.
  3. Create a Planetscale account.
  4. Set up your Planetscale database:
    1. Log in to your Planetscale account with pscale auth login.
    2. Create a password with pscale password create <DATABASE_NAME> <BRANCH_NAME> <PASSWORD_NAME>.
    3. Push your database to Planetscale with npx prisma db push.
  5. Configure your Vercel environment:
    • Set DATABASE_URL to your Planetscale database URL.
    • Generate an encryption key with node scripts/gen-enc.js and set it as ENC_KEY.

With these steps completed, your ChatVisualNovel will be deployed on Vercel with a Planetscale serverless MySQL database.

Local Usage

  1. Clone the ChatVisualNovel repo from GitHub.
  2. Dependencies on Planetscale services still exist temporarily. Please register as mentioned in the previous section and configure DATABASE_URL in the .env file.
  3. Run npm install.
  4. Generate an encryption key using node scripts/gen-enc.js and configure it in the .env file in the format ENC_KEY=***. (Note: You can copy the .env file from env.template)
  5. You can now use the application by running npm run dev.

Customization

assets.json

  • When an item is marked with (i18n). Either the key or value needs to be locale mapped in i18n configs.
{
  "genres": string[],           //(Required)(i18n) Genres, used in Prompt.
  "player": {                   //(Optional) Player characters whose name will be generated by ChatGPT. Used only when there is no isPlayer: true in characters.
    "images": {
      [key: string]: string         //(Required) Each key is a mood of the character. Can have any number of moods but there must be one named neutral. All possible moods of the first character will be used in Prompt for mood selection of all characters. Value is the URL to the image of corresponding mood.
    },
    "imageSettings": {
      [key: string]: string         //(Optional) CSS override to this character's image when displayed. Take highest priority.
    }
  },
  "playerGender": string,       //(Optional)(i18n) Gender of player, used in Prompt when there is no isPlayer: true in characters.
  "girls": [{                   //(Optional) Girl characters whose names will be generated by ChatGPT. Used only when there is no isPlayer: false in characters.
    "images": {
      [key: string]: string         //(Required) Each key is a mood of the character. Can have any number of moods but there must be one named neutral. All possible moods of the first character will be used in Prompt for mood selection of all characters. Value is the URL to the image of corresponding mood.
    },
    "imageSettings": {
      [key: string]: string         //(Optional) CSS override to this character's image when displayed. Take highest priority.
    }
  }],
  "characters": {               //(Optional) Named characters.
    [key: string]: {                //(Required)(i18n) Character name, used in Prompt.
      "isPlayer": boolean,          //(Optional) When set to true, will be the player character. Please only set one character as isPlayer: true.
      "images": {
        [key: string]: string       //(Required) Each key is a mood of the character. Can have any number of moods but there must be one named neutral. All possible moods of the first character will be used in Prompt for mood selection of all characters. Value is the URL to the image of corresponding mood.
      },
      "imageSettings": {
        [key: string]: string       //(Optional) CSS override to this character's image when displayed. Take highest priority.
      }
    }
  },
  "places": {                   //(Required) Location (Background).
    [key: string]: {                //(Required)(i18n) Each key is a location. There must be at least one location. All possible locations will be used in Prompt for location selection.
      "image": string,              //(Required) URL to the image of the location.
      "bgm": string                 //(Optional) Background music of this location.
  },
  "imageSettings": {            //(Optional) Global Character image settings (CSS).
    [key: string]: string
  },
  "tts": {                      //(Optional) Online Text-to-speach service integration. Only basic GET is supported for now.
    [key: string]: {                //(Required) i18n locale, can set a default.
      "method": string,             //(Optional) GET or POST(not supported yet) or HuggingFaceSpace, defaults to GET.
      "url": string,                //(Required) API URL.
      "params": {                   //(Optional) URL query param map. Required when method is GET.
        "speaker": string,          //(Required) Query param name for speaker.
        "text": string,             //(Required) Query param name for text(dialogue).
        "additionalParams": string  //(Optional) Additional parameters as a string.
      },
      "ws": {                   //(Optional) When method is HuggingFaceSpace, this is required.
        url: string;                //(Required) Hugging Face Space websocket URL.
        data: string[];             //(Optional) Data payload schema. Each key name will be replaced by the corresponding value.
      },
      "voices": {
        male: string[];         //(Optional) Collection of allowed male voice names.
        female: string[];       //(Optional) Collection of allowed female voice names.
      }
    }
  }
}

LICENSE

This code is distributed under the MIT license. See LICENSE in this directory.

More Repositories

1

understand-prompt

【🔞🔞🔞 内含不适合未成年人阅读的图片】基于我擅长的编程、绘画、写作展开的 AI 探索和总结:StableDiffusion 是一种强大的图像生成模型,能够通过对一张图片进行演化来生成新的图片。ChatGPT 是一个基于 Transformer 的语言生成模型,它能够自动为输入的主题生成合适的文章。而 Github Copilot 是一个智能编程助手,能够加速日常编程活动。
Jupyter Notebook
3,188
star
2

click-prompt

ClickPrompt - Streamline your prompt design, with ClickPrompt, you can easily view, share, and run these prompts with just one click. ClickPrompt 用于一键轻松查看、分享和执行您的 Prompt。
TypeScript
2,282
star
3

chat-flow

ChatFlow - AI-based chat flow framework, personalize your ChatGPT workflows and build the road to automation。ChatFlow —— 打造个性化 ChatGPT 流程,构建自动化之路
TypeScript
433
star
4

chatgpt-integration-patterns

总结如何更好地集成 ChatGPT 的相关模式,方便于我们后续在其它 LLM(大语言模型)中使用。Summary some interesting integration modes related to ChatGPT, which will facilitate our future use in other large language models .
65
star
5

chat-diffusion

ChatDiffusion - A ChatGPT web UI that integrates with variety of online Stable Diffusion services
TypeScript
57
star
6

unit-mesh

Unit Mesh: A asymptotic AI programming architecture
Kotlin
45
star
7

chat-chess

Chess AI and commentary powered by ChatGPT
TypeScript
12
star
8

unit-server

UnitServer 是一个结合 Serverless + REPL 的工具 ,允许用户轻松地运行 AI 生成的代码,并进行实时交互。FlowREPL is an interactive REPL tool that enables users to easily run code generated by AI and interact with it in real-time.
Kotlin
12
star
9

awesome-prompt-engineering

awesome for your to collections
11
star
10

stable-diffusion-preview

a collections of preview images for generator
6
star
11

chat-flow-old

ChatFlow, personalize your ChatGPT workflows and build the road to automation。ChatFlow —— 打造个性化 ChatGPT 流程,构建自动化之路
TypeScript
1
star