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 *.png -text
*.jpg -text *.jpg -text
*.ico -text *.ico -text
*.gif -text
*.webp -text *.webp -text

View File

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

View File

@ -243,7 +243,7 @@ export function parseInput(input: string, config: Config, forbidden: Forbidden[]
} }
// extract negative prompts // 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]) { if (capture?.[3]) {
input = input.slice(0, capture.index).trim() input = input.slice(0, capture.index).trim()
appendToList(negative, capture[3]) appendToList(negative, capture[3])