mirror of
https://github.com/Physton/sd-webui-prompt-all-in-one.git
synced 2026-05-01 03:31:41 +00:00
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -327,7 +327,7 @@
|
||||
@mousemove.stop=""
|
||||
@mouseup.stop="">
|
||||
<vue-number-input class="input-number" :model-value="tag.weightNum" center controls
|
||||
:min="0" :step="0.1" size="small"
|
||||
:min="tag.isLora || tag.isLyco ? -100 : 0" :step="0.1" size="small"
|
||||
@update:model-value="onTagWeightNumChange(tag.id, $event)"></vue-number-input>
|
||||
<button type="button" v-tooltip="getLang('increase_weight_add_parentheses')"
|
||||
@click="onIncWeightClick(tag.id, +1)">
|
||||
|
||||
@@ -382,11 +382,11 @@ export default {
|
||||
this._setTag(tag)
|
||||
}
|
||||
} else {
|
||||
// 如果原来的括号是<>,那么最小权重数只能是0.1
|
||||
const bracket = common.hasBrackets(value)
|
||||
if (bracket[0] === '<' && bracket[1] === '>') {
|
||||
weightNum = 0.1
|
||||
if (tag.isLora || tag.isLyco) {
|
||||
tag.value = value.replace(common.weightNumRegex, '$1:' + weightNum)
|
||||
if (localValue !== '') tag.localValue = tag.localValue.replace(common.weightNumRegex, '$1:' + weightNum)
|
||||
} else {
|
||||
if (weightNum <= 0) weightNum = 0
|
||||
if (this.autoKeepWeightZero) {
|
||||
// 保留权重数
|
||||
tag.value = value.replace(common.weightNumRegex, '$1:0')
|
||||
|
||||
@@ -5,9 +5,9 @@ import tinycolor from "tinycolor2";
|
||||
export default {
|
||||
loraRegex: /^\<lora:\s*([^\:]+)\s*(:)?\s*([0-9\.]+)?\>$/,
|
||||
lycoRegex: /^\<lyco:\s*([^\:]+)\s*(:)?\s*([0-9\.]+)?\>$/,
|
||||
weightNumRegex: /(.*):([0-9\.]+)/,
|
||||
weightNumRegexEN: /(.*):\s*([0-9\.]+)/,
|
||||
weightNumRegexCN: /(.*):\s*([0-9\.]+)/,
|
||||
weightNumRegex: /(.*):(-?[0-9\.]+)/,
|
||||
weightNumRegexEN: /(.*):\s*(-?[0-9\.]+)/,
|
||||
weightNumRegexCN: /(.*):\s*(-[0-9\.]+)/,
|
||||
bracketsEN: [
|
||||
{'(': '(', ')': ')'},
|
||||
{'[': '[', ']': ']'},
|
||||
|
||||
Reference in New Issue
Block a user