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
bcfbb33e
Commit
bcfbb33e
authored
Oct 17, 2022
by
Anastasius
Committed by
AUTOMATIC1111
Oct 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added time left estimation
parent
2fd7935e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
ui.py
modules/ui.py
+13
-1
No files found.
modules/ui.py
View file @
bcfbb33e
...
@@ -261,6 +261,15 @@ def wrap_gradio_call(func, extra_outputs=None):
...
@@ -261,6 +261,15 @@ def wrap_gradio_call(func, extra_outputs=None):
return
f
return
f
def
calc_time_left
(
progress
):
if
progress
==
0
:
return
"N/A"
else
:
time_since_start
=
time
.
time
()
-
shared
.
state
.
time_start
eta
=
(
time_since_start
/
progress
)
return
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
gmtime
(
eta
-
time_since_start
))
def
check_progress_call
(
id_part
):
def
check_progress_call
(
id_part
):
if
shared
.
state
.
job_count
==
0
:
if
shared
.
state
.
job_count
==
0
:
return
""
,
gr_show
(
False
),
gr_show
(
False
),
gr_show
(
False
)
return
""
,
gr_show
(
False
),
gr_show
(
False
),
gr_show
(
False
)
...
@@ -272,11 +281,13 @@ def check_progress_call(id_part):
...
@@ -272,11 +281,13 @@ def check_progress_call(id_part):
if
shared
.
state
.
sampling_steps
>
0
:
if
shared
.
state
.
sampling_steps
>
0
:
progress
+=
1
/
shared
.
state
.
job_count
*
shared
.
state
.
sampling_step
/
shared
.
state
.
sampling_steps
progress
+=
1
/
shared
.
state
.
job_count
*
shared
.
state
.
sampling_step
/
shared
.
state
.
sampling_steps
time_left
=
calc_time_left
(
progress
)
progress
=
min
(
progress
,
1
)
progress
=
min
(
progress
,
1
)
progressbar
=
""
progressbar
=
""
if
opts
.
show_progressbar
:
if
opts
.
show_progressbar
:
progressbar
=
f
"""<div class='progressDiv'><div class='progress' style="
width:{progress * 100}
%
">{str(int(progress*100))+"
%
"
if progress > 0.01 else ""}</div></div>"""
progressbar
=
f
"""<div class='progressDiv'><div class='progress' style="
overflow:hidden;width:{progress * 100}
%
">{str(int(progress*100))+"
%
ETA:"+time_left
if progress > 0.01 else ""}</div></div>"""
image
=
gr_show
(
False
)
image
=
gr_show
(
False
)
preview_visibility
=
gr_show
(
False
)
preview_visibility
=
gr_show
(
False
)
...
@@ -308,6 +319,7 @@ def check_progress_call_initial(id_part):
...
@@ -308,6 +319,7 @@ def check_progress_call_initial(id_part):
shared
.
state
.
current_latent
=
None
shared
.
state
.
current_latent
=
None
shared
.
state
.
current_image
=
None
shared
.
state
.
current_image
=
None
shared
.
state
.
textinfo
=
None
shared
.
state
.
textinfo
=
None
shared
.
state
.
time_start
=
time
.
time
()
return
check_progress_call
(
id_part
)
return
check_progress_call
(
id_part
)
...
...
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