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
4a8cf01f
Commit
4a8cf01f
authored
Nov 02, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove duplicate code from #3970
parent
e526f6b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
18 deletions
+16
-18
modules/api/api.py
modules/api/api.py
+1
-9
modules/shared.py
modules/shared.py
+14
-0
modules/ui.py
modules/ui.py
+1
-9
No files found.
modules/api/api.py
View file @
4a8cf01f
...
...
@@ -178,15 +178,7 @@ class Api:
progress
=
min
(
progress
,
1
)
# copy from check_progress_call of ui.py
if
shared
.
parallel_processing_allowed
:
if
shared
.
state
.
sampling_step
-
shared
.
state
.
current_image_sampling_step
>=
shared
.
opts
.
show_progress_every_n_steps
and
shared
.
state
.
current_latent
is
not
None
:
if
shared
.
opts
.
show_progress_grid
:
shared
.
state
.
current_image
=
samples_to_image_grid
(
shared
.
state
.
current_latent
)
else
:
shared
.
state
.
current_image
=
sample_to_image
(
shared
.
state
.
current_latent
)
shared
.
state
.
current_image_sampling_step
=
shared
.
state
.
sampling_step
shared
.
state
.
set_current_image
()
current_image
=
None
if
shared
.
state
.
current_image
and
not
req
.
skip_current_image
:
...
...
modules/shared.py
View file @
4a8cf01f
...
...
@@ -184,6 +184,20 @@ class State:
devices
.
torch_gc
()
"""sets self.current_image from self.current_latent if enough sampling steps have been made after the last call to this"""
def
set_current_image
(
self
):
if
not
parallel_processing_allowed
:
return
if
self
.
sampling_step
-
self
.
current_image_sampling_step
>=
opts
.
show_progress_every_n_steps
and
self
.
current_latent
is
not
None
:
if
opts
.
show_progress_grid
:
self
.
current_image
=
sd_samplers
.
samples_to_image_grid
(
self
.
current_latent
)
else
:
self
.
current_image
=
sd_samplers
.
sample_to_image
(
self
.
current_latent
)
self
.
current_image_sampling_step
=
self
.
sampling_step
state
=
State
()
artist_db
=
modules
.
artists
.
ArtistsDatabase
(
os
.
path
.
join
(
script_path
,
'artists.csv'
))
...
...
modules/ui.py
View file @
4a8cf01f
...
...
@@ -277,15 +277,7 @@ def check_progress_call(id_part):
preview_visibility
=
gr_show
(
False
)
if
opts
.
show_progress_every_n_steps
>
0
:
if
shared
.
parallel_processing_allowed
:
if
shared
.
state
.
sampling_step
-
shared
.
state
.
current_image_sampling_step
>=
opts
.
show_progress_every_n_steps
and
shared
.
state
.
current_latent
is
not
None
:
if
opts
.
show_progress_grid
:
shared
.
state
.
current_image
=
modules
.
sd_samplers
.
samples_to_image_grid
(
shared
.
state
.
current_latent
)
else
:
shared
.
state
.
current_image
=
modules
.
sd_samplers
.
sample_to_image
(
shared
.
state
.
current_latent
)
shared
.
state
.
current_image_sampling_step
=
shared
.
state
.
sampling_step
shared
.
state
.
set_current_image
()
image
=
shared
.
state
.
current_image
if
image
is
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