do the prompt_shortcut substitution in getSettings()
parent
914a6409aa
commit
dd106bee00
26
index.js
26
index.js
|
|
@ -1766,10 +1766,32 @@ async function getSettings() {
|
||||||
delete payload['script_args']
|
delete payload['script_args']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bUsePromptShortcut) {
|
||||||
|
//replace the prompt with the prompt shortcut equivalent
|
||||||
|
const [new_prompt, new_negative_prompt] =
|
||||||
|
py_re.replacePromptsWithShortcuts(
|
||||||
|
prompt,
|
||||||
|
negative_prompt,
|
||||||
|
prompt_shortcut_ui_dict
|
||||||
|
)
|
||||||
|
|
||||||
|
//used in generation
|
||||||
|
payload['prompt'] = new_prompt
|
||||||
|
payload['negative_prompt'] = new_negative_prompt
|
||||||
|
|
||||||
|
//used to when resote settings from metadata
|
||||||
|
payload['original_prompt'] = prompt
|
||||||
|
payload['original_negative_prompt'] = negative_prompt
|
||||||
|
} else {
|
||||||
|
//use the same prompt as in the prompt textarea
|
||||||
|
payload['prompt'] = prompt
|
||||||
|
payload['negative_prompt'] = negative_prompt
|
||||||
|
}
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
...payload,
|
...payload,
|
||||||
prompt: prompt,
|
// prompt: prompt,
|
||||||
negative_prompt: negative_prompt,
|
// negative_prompt: negative_prompt,
|
||||||
steps: numberOfSteps,
|
steps: numberOfSteps,
|
||||||
// n_iter: numberOfImages,
|
// n_iter: numberOfImages,
|
||||||
sampler_index: sampler_name,
|
sampler_index: sampler_name,
|
||||||
|
|
|
||||||
|
|
@ -507,4 +507,5 @@ module.exports = {
|
||||||
getDocumentFolderNativePath,
|
getDocumentFolderNativePath,
|
||||||
convertMetadataToJson,
|
convertMetadataToJson,
|
||||||
openUrlRequest,
|
openUrlRequest,
|
||||||
|
replacePromptsWithShortcuts,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue