Move CFG scale to built-in functionality

This commit is contained in:
Cohee
2023-10-21 22:19:49 +03:00
parent ed8f5ddc33
commit a4ab898933
9 changed files with 321 additions and 328 deletions

View File

@ -169,7 +169,7 @@ import { getDeviceInfo } from "./scripts/RossAscends-mods.js";
import { registerPromptManagerMigration } from "./scripts/PromptManager.js";
import { getRegexedString, regex_placement } from "./scripts/extensions/regex/engine.js";
import { FILTER_TYPES, FilterHelper } from "./scripts/filters.js";
import { getCfgPrompt, getGuidanceScale } from "./scripts/extensions/cfg/util.js";
import { getCfgPrompt, getGuidanceScale, initCfg } from "./scripts/cfg-scale.js";
import {
force_output_sequence,
formatInstructModeChat,
@ -724,6 +724,7 @@ async function firstLoadInit() {
initPersonas();
initRossMods();
initStats();
initCfg();
}
function checkOnlineStatus() {
@ -3017,7 +3018,9 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
: ` ${cfgPrompt.value}`;
} else {
// TODO: Make all extension prompts use an array/splice method
finalMesSend[mesSend.length - cfgPrompt.depth].extensionPrompts.push(`${cfgPrompt.value}\n`);
const lengthDiff = mesSend.length - cfgPrompt.depth;
const cfgDepth = lengthDiff >= 0 ? lengthDiff : 0;
finalMesSend[cfgDepth].extensionPrompts.push(`${cfgPrompt.value}\n`);
}
}