CFG: NAI fixes

NAI does CFG differently, so add special cases for them. Also gate
CFG access to only work on textgenwebui since that's where it's
implemented.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri
2023-08-20 19:51:01 -04:00
parent 4ea9e481a8
commit 60faaf1831
2 changed files with 6 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import {
saveSettingsDebounced,
setGenerationParamsFromPreset
} from "../script.js";
import { getCfgPrompt } from "./extensions/cfg/util.js";
import { MAX_CONTEXT_DEFAULT, tokenizers } from "./power-user.js";
import {
getSortableDelay,
@@ -395,6 +396,10 @@ function getBadWordPermutations(text) {
}
export function getNovelGenerationData(finalPrompt, this_settings, this_amount_gen, isImpersonate, cfgValues) {
if (cfgValues.guidanceScale && cfgValues.guidanceScale !== 1) {
cfgValues.negativePrompt = (getCfgPrompt(cfgValues.guidanceScale, true))?.value;
}
const clio = nai_settings.model_novel.includes('clio');
const kayra = nai_settings.model_novel.includes('kayra');