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
3dae545a
Commit
3dae545a
authored
Jan 04, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename weirdly named variables from #3176
parent
cf413d1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
ui.py
modules/ui.py
+5
-7
No files found.
modules/ui.py
View file @
3dae545a
...
@@ -162,16 +162,14 @@ def save_files(js_data, images, do_make_zip, index):
...
@@ -162,16 +162,14 @@ def save_files(js_data, images, do_make_zip, index):
return
gr
.
File
.
update
(
value
=
fullfns
,
visible
=
True
),
plaintext_to_html
(
f
"Saved: {filenames[0]}"
)
return
gr
.
File
.
update
(
value
=
fullfns
,
visible
=
True
),
plaintext_to_html
(
f
"Saved: {filenames[0]}"
)
def
calc_time_left
(
progress
,
threshold
,
label
,
force_display
,
show_eta
):
def
calc_time_left
(
progress
,
threshold
,
label
,
force_display
,
showTime
):
if
progress
==
0
:
if
progress
==
0
:
return
""
return
""
else
:
else
:
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
show
Time
)
or
force_display
:
if
(
eta_relative
>
threshold
and
show
_eta
)
or
force_display
:
if
eta_relative
>
3600
:
if
eta_relative
>
3600
:
return
label
+
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
gmtime
(
eta_relative
))
return
label
+
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
gmtime
(
eta_relative
))
elif
eta_relative
>
60
:
elif
eta_relative
>
60
:
...
@@ -194,9 +192,9 @@ def check_progress_call(id_part):
...
@@ -194,9 +192,9 @@ def check_progress_call(id_part):
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
# Show progress percentage and time left at the same moment, and base it also on steps done
# Show progress percentage and time left at the same moment, and base it also on steps done
show
PBText
=
progress
>=
0.01
or
shared
.
state
.
sampling_step
>=
10
show
_eta
=
progress
>=
0.01
or
shared
.
state
.
sampling_step
>=
10
time_left
=
calc_time_left
(
progress
,
1
,
" ETA: "
,
shared
.
state
.
time_left_force_display
,
showPBText
)
time_left
=
calc_time_left
(
progress
,
1
,
" ETA: "
,
shared
.
state
.
time_left_force_display
,
show_eta
)
if
time_left
!=
""
:
if
time_left
!=
""
:
shared
.
state
.
time_left_force_display
=
True
shared
.
state
.
time_left_force_display
=
True
...
@@ -204,7 +202,7 @@ def check_progress_call(id_part):
...
@@ -204,7 +202,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:visible;width:{progress * 100}
%
;white-space:nowrap;">{" " * 2 + str(int(progress*100))+"
%
" + time_left if show
PBText
else ""}</div></div>"""
progressbar
=
f
"""<div class='progressDiv'><div class='progress' style="overflow:visible;width:{progress * 100}
%
;white-space:nowrap;">{" " * 2 + str(int(progress*100))+"
%
" + time_left if show
_eta
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