mirror of
https://github.com/koishijs/novelai-bot
synced 2025-01-07 07:06:54 +08:00
feat: support --undesired syntax
This commit is contained in:
parent
9ce387d7a2
commit
f1e676d82c
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -3,4 +3,5 @@
|
|||||||
*.png -text
|
*.png -text
|
||||||
*.jpg -text
|
*.jpg -text
|
||||||
*.ico -text
|
*.ico -text
|
||||||
|
*.gif -text
|
||||||
*.webp -text
|
*.webp -text
|
||||||
|
@ -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": [
|
||||||
|
@ -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])
|
||||||
|
Loading…
Reference in New Issue
Block a user