mirror of
https://github.com/koishijs/novelai-bot
synced 2025-01-09 04:37:54 +08:00
feat: support loose sd-compatible negative prompt syntax
This commit is contained in:
parent
3f55e5c7ec
commit
1684f52ee5
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "koishi-plugin-novelai",
|
||||
"description": "Generate images by NovelAI",
|
||||
"version": "1.7.3",
|
||||
"version": "1.7.4",
|
||||
"main": "lib/index.js",
|
||||
"typings": "lib/index.d.ts",
|
||||
"files": [
|
||||
|
@ -187,9 +187,9 @@ export function apply(ctx: Context, config: Config) {
|
||||
// extract negative prompts
|
||||
const undesired = [lowQuality]
|
||||
if (options.anatomy ?? config.anatomy) undesired.push(badAnatomy)
|
||||
const capture = input.match(/^negative prompt: ([\s\S]+)/m)
|
||||
const capture = input.match(/(?:^|,\s*)negative prompts?:([\s\S]+)/m)
|
||||
if (capture) {
|
||||
input = input.slice(0, capture.index)
|
||||
input = input.slice(0, capture.index).trim()
|
||||
undesired.push(capture[1])
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user