feat: support --undesired syntax

This commit is contained in:
Shigma 2022-10-31 14:00:19 +08:00
parent 9ce387d7a2
commit f1e676d82c
3 changed files with 3 additions and 2 deletions

1
.gitattributes vendored
View File

@ -3,4 +3,5 @@
*.png -text
*.jpg -text
*.ico -text
*.gif -text
*.webp -text

View File

@ -1,7 +1,7 @@
{
"name": "koishi-plugin-novelai",
"description": "Generate images by NovelAI",
"version": "1.12.4",
"version": "1.12.5",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [

View File

@ -243,7 +243,7 @@ export function parseInput(input: string, config: Config, forbidden: Forbidden[]
}
// extract negative prompts
const capture = input.match(/(,\s*|\s+)(-u\s+|negative prompts?:)\s*([\s\S]+)/m)
const capture = input.match(/(,\s*|\s+)(-u\s+|--undesired\s+|negative prompts?:\s*)([\s\S]+)/m)
if (capture?.[3]) {
input = input.slice(0, capture.index).trim()
appendToList(negative, capture[3])