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
70ab21e6
Commit
70ab21e6
authored
Mar 29, 2023
by
siutin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep randomId simpler
parent
90366b8d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
12 deletions
+6
-12
javascript/progressbar.js
javascript/progressbar.js
+2
-2
javascript/ui.js
javascript/ui.js
+2
-8
modules/progress.py
modules/progress.py
+2
-2
No files found.
javascript/progressbar.js
View file @
70ab21e6
...
@@ -59,8 +59,8 @@ function setTitle(progress){
...
@@ -59,8 +59,8 @@ function setTitle(progress){
}
}
function
randomId
(
prefix
=
null
){
function
randomId
(){
return
"
task(
"
+
(
prefix
==
null
?
""
:
prefix
+
"
_
"
)
+
Math
.
random
().
toString
(
36
).
slice
(
2
,
7
)
+
Math
.
random
().
toString
(
36
).
slice
(
2
,
7
)
+
Math
.
random
().
toString
(
36
).
slice
(
2
,
7
)
+
"
)
"
return
"
task(
"
+
Math
.
random
().
toString
(
36
).
slice
(
2
,
7
)
+
Math
.
random
().
toString
(
36
).
slice
(
2
,
7
)
+
Math
.
random
().
toString
(
36
).
slice
(
2
,
7
)
+
"
)
"
}
}
// starts sending progress requests to "/internal/progress" uri, creating progressbar above progressbarContainer element and
// starts sending progress requests to "/internal/progress" uri, creating progressbar above progressbarContainer element and
...
...
javascript/ui.js
View file @
70ab21e6
...
@@ -163,7 +163,7 @@ function submit(){
...
@@ -163,7 +163,7 @@ function submit(){
rememberGallerySelection
(
'
txt2img_gallery
'
)
rememberGallerySelection
(
'
txt2img_gallery
'
)
showSubmitButtons
(
'
txt2img
'
,
false
)
showSubmitButtons
(
'
txt2img
'
,
false
)
var
id
=
randomId
(
"
txt2img
"
)
var
id
=
randomId
()
requestProgress
(
id
,
gradioApp
().
getElementById
(
'
txt2img_gallery_container
'
),
gradioApp
().
getElementById
(
'
txt2img_gallery
'
),
function
(){
requestProgress
(
id
,
gradioApp
().
getElementById
(
'
txt2img_gallery_container
'
),
gradioApp
().
getElementById
(
'
txt2img_gallery
'
),
function
(){
showSubmitButtons
(
'
txt2img
'
,
true
)
showSubmitButtons
(
'
txt2img
'
,
true
)
...
@@ -180,7 +180,7 @@ function submit_img2img(){
...
@@ -180,7 +180,7 @@ function submit_img2img(){
rememberGallerySelection
(
'
img2img_gallery
'
)
rememberGallerySelection
(
'
img2img_gallery
'
)
showSubmitButtons
(
'
img2img
'
,
false
)
showSubmitButtons
(
'
img2img
'
,
false
)
var
id
=
randomId
(
"
img2img
"
)
var
id
=
randomId
()
requestProgress
(
id
,
gradioApp
().
getElementById
(
'
img2img_gallery_container
'
),
gradioApp
().
getElementById
(
'
img2img_gallery
'
),
function
(){
requestProgress
(
id
,
gradioApp
().
getElementById
(
'
img2img_gallery_container
'
),
gradioApp
().
getElementById
(
'
img2img_gallery
'
),
function
(){
showSubmitButtons
(
'
img2img
'
,
true
)
showSubmitButtons
(
'
img2img
'
,
true
)
})
})
...
@@ -367,12 +367,6 @@ function restoreProgress (task_tag) {
...
@@ -367,12 +367,6 @@ function restoreProgress (task_tag) {
if
(
task_tag
)
{
if
(
task_tag
)
{
let
successHandler
=
({
current_task
})
=>
{
let
successHandler
=
({
current_task
})
=>
{
if
(
current_task
)
{
if
(
current_task
)
{
let
_task_tag
=
[
"
txt2img
"
,
"
img2img
"
].
find
(
t
=>
current_task
.
startsWith
(
`task(
${
t
}
_`
)
&&
current_task
.
endsWith
(
"
)
"
))
if
(
!
_task_tag
)
{
console
.
warn
(
`task tag
${
current_task
}
not implemented yet`
)
return
}
if
(
task_tag
!=
_task_tag
)
return
showSubmitButtons
(
task_tag
,
false
)
showSubmitButtons
(
task_tag
,
false
)
requestProgress
(
current_task
,
gradioApp
().
getElementById
(
`
${
task_tag
}
_gallery_container`
),
gradioApp
().
getElementById
(
`
${
task_tag
}
_gallery`
),
function
(){
requestProgress
(
current_task
,
gradioApp
().
getElementById
(
`
${
task_tag
}
_gallery_container`
),
gradioApp
().
getElementById
(
`
${
task_tag
}
_gallery`
),
function
(){
showSubmitButtons
(
task_tag
,
true
)
showSubmitButtons
(
task_tag
,
true
)
...
...
modules/progress.py
View file @
70ab21e6
...
@@ -49,8 +49,8 @@ def set_last_task_result(id_job, result):
...
@@ -49,8 +49,8 @@ def set_last_task_result(id_job, result):
last_task_result
=
result
last_task_result
=
result
def
restore_progress_call
(
task_tag
):
def
restore_progress_call
():
if
current_task
is
None
or
not
current_task
[
5
:
-
1
]
.
startswith
(
task_tag
)
:
if
current_task
is
None
:
# image, generation_info, html_info, html_log
# image, generation_info, html_info, html_log
return
tuple
(
list
([
None
,
None
,
None
,
None
]))
return
tuple
(
list
([
None
,
None
,
None
,
None
]))
...
...
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