let it work better with extranetwork-lora

pull/308/head
yangming 2024-03-10 03:16:37 +08:00
parent d0eb9c5b7d
commit 90d05207ec
25 changed files with 56 additions and 52 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

0
scripts/on_app_started.py Executable file → Normal file
View File

0
src/.gitignore vendored Executable file → Normal file
View File

0
src/README.md Executable file → Normal file
View File

0
src/index.html Executable file → Normal file
View File

0
src/package.json Executable file → Normal file
View File

0
src/src/App.vue Executable file → Normal file
View File

0
src/src/components/phystonPrompt.vue Executable file → Normal file
View File

0
src/src/main.js Executable file → Normal file
View File

View File

@ -340,6 +340,7 @@ export default {
find = tag.originalValue === name || (output_name && tag.originalValue === output_name) find = tag.originalValue === name || (output_name && tag.originalValue === output_name)
} }
if (find) { if (find) {
console.log("1")
indexes.push(index) indexes.push(index)
} }
} }

View File

@ -371,7 +371,7 @@ export default {
onTagWeightNumChange(id, e) { onTagWeightNumChange(id, e) {
let tag = this.tags.find(tag => tag.id === id) let tag = this.tags.find(tag => tag.id === id)
if (!tag) return false if (!tag) return false
e = typeof e === "number" || typeof a === "string" ? e : e.target.value e = typeof e === "number" || typeof e === "string" ? e : e.target.value
if (tag.weightNum == e) return if (tag.weightNum == e) return
let weightNum = e let weightNum = e
let value = tag.value let value = tag.value
@ -403,8 +403,10 @@ export default {
if (localValue !== '') localValue = localValue + ':' + weightNum if (localValue !== '') localValue = localValue + ':' + weightNum
} }
} }
// 如果原来没有括号() [] {} <>,那么就加上括号 // 排除Lora、embedding、lyco
if (!common.hasBrackets(value)) { // 如果原来没有括号() [] {},那么就加上括号
if (tag.isLora||tag.isLyco||tag.isEmbedding){}
else if (!common.hasBrackets(value)) {
if (this.useNovelAiWeightSymbol) { if (this.useNovelAiWeightSymbol) {
value = common.setLayers(value, 1, '{', '}') value = common.setLayers(value, 1, '{', '}')
if (localValue !== '') localValue = common.setLayers(localValue, 1, '{', '}') if (localValue !== '') localValue = common.setLayers(localValue, 1, '{', '}')

View File

@ -4,7 +4,8 @@ import tinycolor from "tinycolor2";
export default { export default {
// loraRegex: /^\<lora:\s*([^\:]+)\s*(:)?\s*(\-?[0-9\.]+)?\>$/, // loraRegex: /^\<lora:\s*([^\:]+)\s*(:)?\s*(\-?[0-9\.]+)?\>$/,
loraRegex: /^\<lora:\s*([^\:]+)\s*(:)?\s*(\-?[0-9\.]+)?([^\>]+)?\>$/, // lora加上metadata 描述词
loraRegex: /^\<lora:\s*([^\:]+)\s*(:)?\s*(\-?[0-9\.]+)?([^\>]+)?\>/,
// lycoRegex: /^\<lyco:\s*([^\:]+)\s*(:)?\s*(\-?[0-9\.]+)?\>$/, // lycoRegex: /^\<lyco:\s*([^\:]+)\s*(:)?\s*(\-?[0-9\.]+)?\>$/,
lycoRegex: /^\<lyco:\s*([^\:]+)\s*(:)?\s*(\-?[0-9\.]+)?([^\>]+)?\>$/, lycoRegex: /^\<lyco:\s*([^\:]+)\s*(:)?\s*(\-?[0-9\.]+)?([^\>]+)?\>$/,
weightNumRegex: /(.*):(\-?[0-9\.]+)/, weightNumRegex: /(.*):(\-?[0-9\.]+)/,

0
src/src/utils/gradioAPI.js Executable file → Normal file
View File

View File

@ -150,8 +150,8 @@ export default (tags, autoBreakBeforeWrap = false, autoBreakAfterWrap = false) =
while (match = regex.exec(value)) { while (match = regex.exec(value)) {
let startIndex = match.index let startIndex = match.index
let endIndex = startIndex + match[0].length let endIndex = startIndex + match[0].length
let before = value.substring(0, startIndex) let before = value.substring(0, startIndex).trim()
let after = value.substring(endIndex) let after = value.substring(endIndex).trim()
let middle = match[0] let middle = match[0]
values.push(before) values.push(before)
values.push(middle) values.push(middle)

0
src/vite.config.js Executable file → Normal file
View File

0
style.css Executable file → Normal file
View File

0
styles/icons/weight-braces-dec.svg Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
styles/icons/weight-braces-inc.svg Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

0
styles/icons/weight-brackets-dec.svg Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 513 B

After

Width:  |  Height:  |  Size: 513 B

0
styles/icons/weight-brackets-inc.svg Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 634 B

After

Width:  |  Height:  |  Size: 634 B

0
styles/icons/weight-parentheses-dec.svg Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 789 B

After

Width:  |  Height:  |  Size: 789 B

0
styles/icons/weight-parentheses-inc.svg Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 910 B

After

Width:  |  Height:  |  Size: 910 B

0
styles/tippy.css Executable file → Normal file
View File

0
styles/toastr.min.css vendored Executable file → Normal file
View File