Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
f25c81a7
Commit
f25c81a7
authored
Jan 17, 2024
by
Sj-Si
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix embeddings add/remove to/from prompt on click bugs.
parent
ccee26b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
11 deletions
+4
-11
javascript/extraNetworks.js
javascript/extraNetworks.js
+3
-10
modules/ui_extra_networks.py
modules/ui_extra_networks.py
+1
-1
No files found.
javascript/extraNetworks.js
View file @
f25c81a7
...
@@ -169,8 +169,8 @@ function tryToRemoveExtraNetworkFromPrompt(textarea, text, isNeg) {
...
@@ -169,8 +169,8 @@ function tryToRemoveExtraNetworkFromPrompt(textarea, text, isNeg) {
var
m
=
text
.
match
(
isNeg
?
re_extranet_neg
:
re_extranet
);
var
m
=
text
.
match
(
isNeg
?
re_extranet_neg
:
re_extranet
);
var
replaced
=
false
;
var
replaced
=
false
;
var
newTextareaText
;
var
newTextareaText
;
var
extraTextBeforeNet
=
opts
.
extra_networks_add_text_separator
;
if
(
m
)
{
if
(
m
)
{
var
extraTextBeforeNet
=
opts
.
extra_networks_add_text_separator
;
var
extraTextAfterNet
=
m
[
2
];
var
extraTextAfterNet
=
m
[
2
];
var
partToSearch
=
m
[
1
];
var
partToSearch
=
m
[
1
];
var
foundAtPosition
=
-
1
;
var
foundAtPosition
=
-
1
;
...
@@ -183,7 +183,6 @@ function tryToRemoveExtraNetworkFromPrompt(textarea, text, isNeg) {
...
@@ -183,7 +183,6 @@ function tryToRemoveExtraNetworkFromPrompt(textarea, text, isNeg) {
}
}
return
found
;
return
found
;
});
});
if
(
foundAtPosition
>=
0
)
{
if
(
foundAtPosition
>=
0
)
{
if
(
extraTextAfterNet
&&
newTextareaText
.
substr
(
foundAtPosition
,
extraTextAfterNet
.
length
)
==
extraTextAfterNet
)
{
if
(
extraTextAfterNet
&&
newTextareaText
.
substr
(
foundAtPosition
,
extraTextAfterNet
.
length
)
==
extraTextAfterNet
)
{
newTextareaText
=
newTextareaText
.
substr
(
0
,
foundAtPosition
)
+
newTextareaText
.
substr
(
foundAtPosition
+
extraTextAfterNet
.
length
);
newTextareaText
=
newTextareaText
.
substr
(
0
,
foundAtPosition
)
+
newTextareaText
.
substr
(
foundAtPosition
+
extraTextAfterNet
.
length
);
...
@@ -193,13 +192,8 @@ function tryToRemoveExtraNetworkFromPrompt(textarea, text, isNeg) {
...
@@ -193,13 +192,8 @@ function tryToRemoveExtraNetworkFromPrompt(textarea, text, isNeg) {
}
}
}
}
}
else
{
}
else
{
newTextareaText
=
textarea
.
value
.
replaceAll
(
new
RegExp
(
text
,
"
g
"
),
function
(
found
)
{
newTextareaText
=
textarea
.
value
.
replaceAll
(
new
RegExp
(
`((?:
${
extraTextBeforeNet
}
)?
${
text
}
)`
,
"
g
"
),
""
);
if
(
found
==
text
)
{
replaced
=
(
newTextareaText
!=
textarea
.
value
);
replaced
=
true
;
return
""
;
}
return
found
;
});
}
}
if
(
replaced
)
{
if
(
replaced
)
{
...
@@ -211,7 +205,6 @@ function tryToRemoveExtraNetworkFromPrompt(textarea, text, isNeg) {
...
@@ -211,7 +205,6 @@ function tryToRemoveExtraNetworkFromPrompt(textarea, text, isNeg) {
}
}
function
updatePromptArea
(
text
,
textArea
,
isNeg
)
{
function
updatePromptArea
(
text
,
textArea
,
isNeg
)
{
if
(
!
tryToRemoveExtraNetworkFromPrompt
(
textArea
,
text
,
isNeg
))
{
if
(
!
tryToRemoveExtraNetworkFromPrompt
(
textArea
,
text
,
isNeg
))
{
textArea
.
value
=
textArea
.
value
+
opts
.
extra_networks_add_text_separator
+
text
;
textArea
.
value
=
textArea
.
value
+
opts
.
extra_networks_add_text_separator
+
text
;
}
}
...
...
modules/ui_extra_networks.py
View file @
f25c81a7
...
@@ -236,7 +236,7 @@ class ExtraNetworksPage:
...
@@ -236,7 +236,7 @@ class ExtraNetworksPage:
**
{
**
{
"tabname"
:
tabname
,
"tabname"
:
tabname
,
"prompt"
:
item
[
"prompt"
],
"prompt"
:
item
[
"prompt"
],
"neg_prompt"
:
item
.
get
(
"negative_prompt"
,
""
),
"neg_prompt"
:
item
.
get
(
"negative_prompt"
,
"
''
"
),
"allow_neg"
:
str
(
self
.
allow_negative_prompt
)
.
lower
(),
"allow_neg"
:
str
(
self
.
allow_negative_prompt
)
.
lower
(),
}
}
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment