mirror of
https://github.com/koishijs/novelai-bot
synced 2025-01-07 07:06:54 +08:00
feat: support options strength
and noise
, fix #24
This commit is contained in:
parent
a474322fbb
commit
5e9db20e33
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "koishi-plugin-novelai",
|
||||
"description": "Generate images by NovelAI",
|
||||
"version": "1.6.1",
|
||||
"version": "1.6.2",
|
||||
"main": "lib/index.js",
|
||||
"typings": "lib/index.d.ts",
|
||||
"files": [
|
||||
|
14
src/index.ts
14
src/index.ts
@ -120,6 +120,8 @@ export function apply(ctx: Context, config: Config) {
|
||||
.option('seed', '-x <seed:number>')
|
||||
.option('steps', '-t <step:number>', { hidden })
|
||||
.option('scale', '-c <scale:number>')
|
||||
.option('noise', '-n <noise:number>', { hidden })
|
||||
.option('strength', '-N <strength:number>', { hidden })
|
||||
.option('anatomy', '-a, --strict-anatomy', { value: true, hidden: () => config.anatomy })
|
||||
.option('anatomy', '-A, --loose-anatomy', { value: false, hidden: () => !config.anatomy })
|
||||
.action(async ({ session, options }, input) => {
|
||||
@ -212,16 +214,16 @@ export function apply(ctx: Context, config: Config) {
|
||||
Object.assign(parameters, {
|
||||
height: size.height * 1.5,
|
||||
width: size.width * 1.5,
|
||||
noise: 0,
|
||||
strength: 0.2,
|
||||
noise: options.noise ?? 0,
|
||||
strength: options.strength ?? 0.2,
|
||||
})
|
||||
} else {
|
||||
const orient = resizeInput(size)
|
||||
Object.assign(parameters, {
|
||||
height: orient.height,
|
||||
width: orient.width,
|
||||
noise: 0.2,
|
||||
strength: 0.7,
|
||||
noise: options.noise ?? 0.2,
|
||||
strength: options.strength ?? 0.7,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
@ -230,8 +232,8 @@ export function apply(ctx: Context, config: Config) {
|
||||
width: orient.width,
|
||||
scale: options.scale ?? 12,
|
||||
steps: options.steps ?? 28,
|
||||
noise: 0.2,
|
||||
strength: 0.7,
|
||||
noise: options.noise ?? 0.2,
|
||||
strength: options.strength ?? 0.7,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,8 @@ commands:
|
||||
seed: 设置随机种子
|
||||
steps: 设置迭代步数
|
||||
scale: 设置对输入的服从度
|
||||
strength: 图片修改幅度
|
||||
noise: 图片噪声强度
|
||||
|
||||
messages:
|
||||
expect-prompt: 请输入标签。
|
||||
|
Loading…
Reference in New Issue
Block a user