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
9cbde793
Commit
9cbde793
authored
Jul 06, 2024
by
AUTOMATIC1111
Committed by
GitHub
Jul 06, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16118 from AUTOMATIC1111/fix-Replace-preview
fix Replace preview
parents
019df53a
957185f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
javascript/ui.js
javascript/ui.js
+8
-0
modules/ui_extra_networks_user_metadata.py
modules/ui_extra_networks_user_metadata.py
+1
-1
No files found.
javascript/ui.js
View file @
9cbde793
...
@@ -26,6 +26,14 @@ function selected_gallery_index() {
...
@@ -26,6 +26,14 @@ function selected_gallery_index() {
return
all_gallery_buttons
().
findIndex
(
elem
=>
elem
.
classList
.
contains
(
'
selected
'
));
return
all_gallery_buttons
().
findIndex
(
elem
=>
elem
.
classList
.
contains
(
'
selected
'
));
}
}
function
gallery_container_buttons
(
gallery_container
)
{
return
gradioApp
().
querySelectorAll
(
`#
${
gallery_container
}
.thumbnail-item.thumbnail-small`
);
}
function
selected_gallery_index_id
(
gallery_container
)
{
return
Array
.
from
(
gallery_container_buttons
(
gallery_container
)).
findIndex
(
elem
=>
elem
.
classList
.
contains
(
'
selected
'
));
}
function
extract_image_from_gallery
(
gallery
)
{
function
extract_image_from_gallery
(
gallery
)
{
if
(
gallery
.
length
==
0
)
{
if
(
gallery
.
length
==
0
)
{
return
[
null
];
return
[
null
];
...
...
modules/ui_extra_networks_user_metadata.py
View file @
9cbde793
...
@@ -194,7 +194,7 @@ class UserMetadataEditor:
...
@@ -194,7 +194,7 @@ class UserMetadataEditor:
def
setup_ui
(
self
,
gallery
):
def
setup_ui
(
self
,
gallery
):
self
.
button_replace_preview
.
click
(
self
.
button_replace_preview
.
click
(
fn
=
self
.
save_preview
,
fn
=
self
.
save_preview
,
_js
=
"function(x, y, z){return [selected_gallery_index(), y, z]
}"
,
_js
=
f
"function(x, y, z){{return [selected_gallery_index_id('{self.tabname + '_gallery_container'}'), y, z]}
}"
,
inputs
=
[
self
.
edit_name_input
,
gallery
,
self
.
edit_name_input
],
inputs
=
[
self
.
edit_name_input
,
gallery
,
self
.
edit_name_input
],
outputs
=
[
self
.
html_preview
,
self
.
html_status
]
outputs
=
[
self
.
html_preview
,
self
.
html_status
]
)
.
then
(
)
.
then
(
...
...
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