Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
87d63bba
Commit
87d63bba
authored
Oct 11, 2022
by
yfszzx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
images history improvement
parent
594ab4ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
19 deletions
+17
-19
images_history.js
javascript/images_history.js
+2
-4
images_history.py
modules/images_history.py
+15
-15
No files found.
javascript/images_history.js
View file @
87d63bba
...
@@ -93,7 +93,6 @@ function images_history_delete(tabname, img_path, img_file_name, page_index, fil
...
@@ -93,7 +93,6 @@ function images_history_delete(tabname, img_path, img_file_name, page_index, fil
buttons
.
push
(
e
)
buttons
.
push
(
e
)
}
}
})
})
img_num
=
buttons
.
length
/
2
img_num
=
buttons
.
length
/
2
if
(
img_num
==
1
){
if
(
img_num
==
1
){
...
@@ -110,15 +109,14 @@ function images_history_delete(tabname, img_path, img_file_name, page_index, fil
...
@@ -110,15 +109,14 @@ function images_history_delete(tabname, img_path, img_file_name, page_index, fil
btn
=
buttons
[
image_index
+
1
]
btn
=
buttons
[
image_index
+
1
]
}
}
setTimeout
(
function
(
btn
){
btn
.
click
()},
30
,
btn
)
setTimeout
(
function
(
btn
){
btn
.
click
()},
30
,
btn
)
}
}
return
[
tabname
,
img_path
,
img_file_name
,
page_index
,
filenames
,
image_index
]
return
[
tabname
,
img_path
,
img_file_name
,
page_index
,
filenames
,
image_index
]
}
}
function
images_history_turnpage
(
img_path
,
page_index
,
image_index
,
tabname
){
function
images_history_turnpage
(
img_path
,
page_index
,
image_index
,
tabname
){
buttons
=
gradioApp
().
getElementById
(
tabname
+
'_images_history'
).
querySelectorAll
(
".gallery-item"
)
buttons
=
gradioApp
().
getElementById
(
tabname
+
'_images_history'
).
querySelectorAll
(
".gallery-item"
)
buttons
.
forEach
(
function
(
elem
)
{
buttons
.
forEach
(
function
(
elem
)
{
elem
.
style
.
display
=
'block'
elem
.
style
.
display
=
'block'
})
})
return
[
img_path
,
page_index
,
image_index
,
tabname
]
return
[
img_path
,
page_index
,
image_index
,
tabname
]
}
}
modules/images_history.py
View file @
87d63bba
...
@@ -64,12 +64,12 @@ def show_images_history(gr, opts, tabname, run_pnginfo, switch_dict):
...
@@ -64,12 +64,12 @@ def show_images_history(gr, opts, tabname, run_pnginfo, switch_dict):
elif
tabname
==
"extras"
:
elif
tabname
==
"extras"
:
dir_name
=
opts
.
outdir_extras_samples
dir_name
=
opts
.
outdir_extras_samples
with
gr
.
Row
():
with
gr
.
Row
():
renew_page
=
gr
.
Button
(
'Renew'
,
elem_id
=
tabname
+
"_images_history_renew_page"
)
renew_page
=
gr
.
Button
(
'Renew'
,
elem_id
=
tabname
+
"_images_history_renew_page"
)
first_page
=
gr
.
Button
(
'First'
,
elem_id
=
tabname
+
"_images_history_first_page"
)
first_page
=
gr
.
Button
(
'First'
,
elem_id
=
tabname
+
"_images_history_first_page"
)
prev_page
=
gr
.
Button
(
'Prev'
)
prev_page
=
gr
.
Button
(
'Prev'
)
page_index
=
gr
.
Number
(
value
=
1
,
label
=
"Page Index"
)
page_index
=
gr
.
Number
(
value
=
1
,
label
=
"Page Index"
)
next_page
=
gr
.
Button
(
'Next'
,
elem_id
=
tabname
+
"_images_history_next_page"
)
next_page
=
gr
.
Button
(
'Next'
,
elem_id
=
tabname
+
"_images_history_next_page"
)
end_page
=
gr
.
Button
(
'End'
)
end_page
=
gr
.
Button
(
'End'
)
with
gr
.
Row
(
elem_id
=
tabname
+
"_images_history"
):
with
gr
.
Row
(
elem_id
=
tabname
+
"_images_history"
):
with
gr
.
Row
():
with
gr
.
Row
():
with
gr
.
Column
():
with
gr
.
Column
():
...
@@ -84,15 +84,15 @@ def show_images_history(gr, opts, tabname, run_pnginfo, switch_dict):
...
@@ -84,15 +84,15 @@ def show_images_history(gr, opts, tabname, run_pnginfo, switch_dict):
img_file_info
=
gr
.
Textbox
(
label
=
"Generate Info"
)
img_file_info
=
gr
.
Textbox
(
label
=
"Generate Info"
)
img_file_name
=
gr
.
Textbox
(
label
=
"File Name"
)
img_file_name
=
gr
.
Textbox
(
label
=
"File Name"
)
with
gr
.
Row
():
with
gr
.
Row
():
# hiden items
# hiden items
img_path
=
gr
.
Textbox
(
dir_name
,
visible
=
False
)
img_path
=
gr
.
Textbox
(
dir_name
,
visible
=
False
)
tabname_box
=
gr
.
Textbox
(
tabname
,
visible
=
False
)
tabname_box
=
gr
.
Textbox
(
tabname
,
visible
=
False
)
image_index
=
gr
.
Textbox
(
value
=-
1
,
visible
=
False
)
image_index
=
gr
.
Textbox
(
value
=-
1
,
visible
=
False
)
set_index
=
gr
.
Button
(
'set_index'
,
elem_id
=
tabname
+
"_images_history_set_index"
,
visible
=
False
)
set_index
=
gr
.
Button
(
'set_index'
,
elem_id
=
tabname
+
"_images_history_set_index"
,
visible
=
False
)
filenames
=
gr
.
State
()
filenames
=
gr
.
State
()
hide_image
=
gr
.
Image
(
visible
=
False
,
type
=
"pil"
)
hide_image
=
gr
.
Image
(
visible
=
False
,
type
=
"pil"
)
info1
=
gr
.
Textbox
(
visible
=
False
)
info1
=
gr
.
Textbox
(
visible
=
False
)
info2
=
gr
.
Textbox
(
visible
=
False
)
info2
=
gr
.
Textbox
(
visible
=
False
)
# turn pages
# turn pages
...
...
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