mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-08-08 23:44:39 +02:00
Moving attention weighting to InvokeAI syntax (#1055)
* Moving attention weighting to InvokeAI syntax () and [] were actually ignored by the legacy parser, so moving the Ctrl+Wheel shortcut to the InvokeAI syntax of '+' and '-'. * Moving attention weighting to InvokeAI syntax () and [] were actually ignored by the legacy parser, so moving the Ctrl+Wheel shortcut to the InvokeAI syntax of '+' and '-'. * Properly cleanup parenthesis '(image tag)++' need to be trimmed to 'image tag' * Add parenthesis as needed when adjusting weights In the InvokeAI syntax, 'image modifier' must become '(image modifier)++' when adjusting weight. * Code cleanup
This commit is contained in:
@ -129,7 +129,10 @@ function createModifierGroup(modifierGroup, initiallyExpanded, removeBy) {
|
||||
}
|
||||
|
||||
function trimModifiers(tag) {
|
||||
return tag.replace(/^\(+|\)+$/g, '').replace(/^\[+|\]+$/g, '')
|
||||
// Remove trailing '-' and/or '+'
|
||||
tag = tag.replace(/[-+]+$/, '');
|
||||
// Remove parentheses at beginning and end
|
||||
return tag.replace(/^[(]+|[\s)]+$/g, '');
|
||||
}
|
||||
|
||||
async function loadModifiers() {
|
||||
|
Reference in New Issue
Block a user