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
57eb1a64
Commit
57eb1a64
authored
Oct 19, 2022
by
Alexandre Simard
Committed by
AUTOMATIC1111
Oct 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ui.py
parent
c6e9fed5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
ui.py
modules/ui.py
+9
-4
No files found.
modules/ui.py
View file @
57eb1a64
...
@@ -268,8 +268,13 @@ def calc_time_left(progress, threshold, label, force_display):
...
@@ -268,8 +268,13 @@ def calc_time_left(progress, threshold, label, force_display):
time_since_start
=
time
.
time
()
-
shared
.
state
.
time_start
time_since_start
=
time
.
time
()
-
shared
.
state
.
time_start
eta
=
(
time_since_start
/
progress
)
eta
=
(
time_since_start
/
progress
)
eta_relative
=
eta
-
time_since_start
eta_relative
=
eta
-
time_since_start
if
(
eta_relative
>
threshold
and
progress
>
0.02
)
or
force_display
:
if
(
eta_relative
>
threshold
and
progress
>
0.02
)
or
force_display
:
return
label
+
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
gmtime
(
eta_relative
))
if
eta_relative
>
3600
:
return
label
+
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
gmtime
(
eta_relative
))
elif
eta_relative
>
60
:
return
label
+
time
.
strftime
(
'
%
M:
%
S'
,
time
.
gmtime
(
eta_relative
))
else
:
return
label
+
time
.
strftime
(
'
%
Ss'
,
time
.
gmtime
(
eta_relative
))
else
:
else
:
return
""
return
""
...
@@ -285,7 +290,7 @@ def check_progress_call(id_part):
...
@@ -285,7 +290,7 @@ 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
,
60
,
" ETA:
"
,
shared
.
state
.
time_left_force_display
)
time_left
=
calc_time_left
(
progress
,
1
,
" ETA:
"
,
shared
.
state
.
time_left_force_display
)
if
time_left
!=
""
:
if
time_left
!=
""
:
shared
.
state
.
time_left_force_display
=
True
shared
.
state
.
time_left_force_display
=
True
...
@@ -293,7 +298,7 @@ def check_progress_call(id_part):
...
@@ -293,7 +298,7 @@ def check_progress_call(id_part):
progressbar
=
""
progressbar
=
""
if
opts
.
show_progressbar
:
if
opts
.
show_progressbar
:
progressbar
=
f
"""<div class='progressDiv'><div class='progress' style="overflow:
hidden;width:{progress * 100}
%
">{str(int(progress*100))+"
%
"+time_left if progress > 0.01 else ""}</div></div>"""
progressbar
=
f
"""<div class='progressDiv'><div class='progress' style="overflow:
visible;width:{progress * 100}
%
;white-space:nowrap;
">{str(int(progress*100))+"
%
"+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
)
...
...
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