Skip to content

Commit

Permalink
build: 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Nov 10, 2022
1 parent a033ce9 commit e8dd756
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 34 deletions.
59 changes: 34 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

**使用前应该查阅的相关文档或项目**

* [User Manual](https://github.com/mamoe/mirai/blob/dev/docs/UserManual.md)
* [Permission Command](https://github.com/mamoe/mirai/blob/dev/mirai-console/docs/BuiltInCommands.md#permissioncommand)
* [Chat Command](https://github.com/project-mirai/chat-command)
* [User Manual](https://github.com/mamoe/mirai/blob/dev/docs/UserManual.md)
* [Permission Command](https://github.com/mamoe/mirai/blob/dev/mirai-console/docs/BuiltInCommands.md#permissioncommand)
* [Chat Command](https://github.com/project-mirai/chat-command)

会自动下载 [EhTagTranslation](https://github.com/EhTagTranslation/Database) 翻译词库
可以对接 [NaiFu](#NaiFu) 本地搭建
Expand All @@ -19,31 +19,40 @@

## 指令

* `/nai <word>` 生成一张图片
例如 `/nai 连裤袜 双马尾` (只有部分词条会自动翻译)
例如 `/nai swimsuit #seed=12346` (设置种子)
例如 `/nai swimsuit #steps=3` (AI迭代次数)
例如 `/nai "swimsuit, ahegao"` (如果需要以 `,` 分割词条, 请用 `"` 包裹)
例如 `/nai 连裤袜 [图片]` (以图生图, `[图片]` 是指指令消息中包含有图片)
可用的配置项有
`seed` 种子
`steps` 迭代次数
`width` 宽度
`height` 高度
`scale` 比例
`sampler` 采样器 可选值 `k_euler_ancestral`, `k_euler`, `k_lms`, `plms`, `ddim`
`strength` 以图出图中对原图的更改程度 可选值 [0.00, 0.99]
`noise` 以图出图中的噪声 可选值 [0.00, 0.99]
* `/nai-login <mail> <password>` 登录账号
例如 `/nai-login [email protected] 1919810`
* `/naifu <word>` 生成一张图片
对接 `naifu`, `naifu` 是基于 novelai 官方 web 端的修改版,所以指令用法 和 `nai` 一致
* `/nai-reload` 重新载入 `config.yml` 配置文件
* `/nai <word>` 生成一张图片 官方API需要登录
例如 `/nai 连裤袜 双马尾` (只有部分词条会自动翻译)
例如 `/nai swimsuit #seed=12346` (设置种子)
例如 `/nai swimsuit #steps=3` (AI迭代次数)
例如 `/nai "swimsuit, ahegao"` (如果需要以 `,` 分割词条, 请用 `"` 包裹)
例如 `/nai 连裤袜 [图片]` (以图生图, `[图片]` 是指指令消息中包含有图片)
可用的配置项有
`seed` 种子
`steps` 迭代次数
`width` 宽度
`height` 高度
`scale` 比例
`sampler` 采样器 可选值 `k_euler_ancestral`, `k_euler`, `k_lms`, `plms`, `ddim`
`strength` 以图出图中对原图的更改程度 可选值 [0.00, 0.99]
`noise` 以图出图中的噪声 可选值 [0.00, 0.99]

* `/nai-fu <word>` 生成一张图片 自建API需要配置 naifu_api
对接 `naifu`, `naifu` 是基于 novelai 官方 web 端的修改版,所以指令用法 和 `nai` 一致

* `/nai-login <mail> <password>` 登录账号
例如 `/nai-login [email protected] 1919810`

* `/nai-reload` 重新载入 `config.yml` 配置文件

## 配置

* `config.yml` 配置文件 包括 `proxy`, `doh`, `ipv6`, `naifu_api` 等配置
* `ban.txt` 屏蔽的词条,可热编辑,保存后一段时间会自动启用
* `config.yml` 配置文件 包括 `proxy`, `doh`, `ipv6`, `naifu_api` 等配置
* `proxy` 代理
* `doh` DNS
* `ipv6` 是否使用ipv6
* `naifu_api` 自建 naifu 地址
* `command_interval` 命令间隔延迟时间 单位毫秒

* `ban.txt` 屏蔽的词条,可热编辑,保存后一段时间会自动启用

## NaiFu

Expand Down
16 changes: 8 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@ plugins {
kotlin("jvm") version "1.7.20"
kotlin("plugin.serialization") version "1.7.20"

id("net.mamoe.mirai-console") version "2.13.0-RC2"
id("net.mamoe.mirai-console") version "2.13.0"
}

group = "xyz.cssxsh.mirai.novelai"
version = "1.1.0"
version = "1.1.1"

repositories {
mavenLocal()
mavenCentral()
}

dependencies {
implementation("io.ktor:ktor-client-okhttp:2.1.2") {
implementation("io.ktor:ktor-client-okhttp:2.1.3") {
exclude(group = "org.jetbrains.kotlin")
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
}
implementation("io.ktor:ktor-client-auth:2.1.2") {
implementation("io.ktor:ktor-client-auth:2.1.3") {
exclude(group = "org.jetbrains.kotlin")
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
}
implementation("io.ktor:ktor-client-encoding:2.1.2") {
implementation("io.ktor:ktor-client-encoding:2.1.3") {
exclude(group = "org.jetbrains.kotlin")
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
}
implementation("io.ktor:ktor-client-content-negotiation:2.1.2") {
implementation("io.ktor:ktor-client-content-negotiation:2.1.3") {
exclude(group = "org.jetbrains.kotlin")
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
}
implementation("io.ktor:ktor-serialization-kotlinx-json:2.1.2") {
implementation("io.ktor:ktor-serialization-kotlinx-json:2.1.3") {
exclude(group = "org.jetbrains.kotlin")
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
Expand All @@ -48,7 +48,7 @@ dependencies {

testImplementation(kotlin("test"))
testImplementation("org.slf4j:slf4j-simple:2.0.3")
testImplementation("net.mamoe:mirai-logging-slf4j:2.13.0-RC2")
testImplementation("net.mamoe:mirai-logging-slf4j:2.13.0")
}

kotlin {
Expand Down
5 changes: 4 additions & 1 deletion src/main/kotlin/xyz/cssxsh/mirai/novelai/NovelAiHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public object NovelAiHelper : KotlinPlugin(
JvmPluginDescription(
id = "xyz.cssxsh.mirai.plugin.novelai-helper",
name = "novelai-helper",
version = "1.1.0",
version = "1.1.1",
) {
author("cssxsh")
}
Expand All @@ -38,10 +38,13 @@ public object NovelAiHelper : KotlinPlugin(
NovelAiCommand.register()
NovelAiFuCommand.register()
NovelAiLoginCommand.register()
NovelAiReLoadCommand.register()
}

override fun onDisable() {
NovelAiCommand.unregister()
NovelAiFuCommand.unregister()
NovelAiLoginCommand.unregister()
NovelAiReLoadCommand.unregister()
}
}

0 comments on commit e8dd756

Please sign in to comment.