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
65522ff1
Unverified
Commit
65522ff1
authored
Nov 02, 2022
by
AUTOMATIC1111
Committed by
GitHub
Nov 02, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4142 from jn-jairo/processing-close
Release processing resources after it finishes
parents
10f62546
c9148b23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
img2img.py
modules/img2img.py
+2
-0
processing.py
modules/processing.py
+4
-3
txt2img.py
modules/txt2img.py
+2
-0
No files found.
modules/img2img.py
View file @
65522ff1
...
@@ -137,6 +137,8 @@ def img2img(mode: int, prompt: str, negative_prompt: str, prompt_style: str, pro
...
@@ -137,6 +137,8 @@ def img2img(mode: int, prompt: str, negative_prompt: str, prompt_style: str, pro
if
processed
is
None
:
if
processed
is
None
:
processed
=
process_images
(
p
)
processed
=
process_images
(
p
)
p
.
close
()
shared
.
total_tqdm
.
clear
()
shared
.
total_tqdm
.
clear
()
generation_info_js
=
processed
.
js
()
generation_info_js
=
processed
.
js
()
...
...
modules/processing.py
View file @
65522ff1
...
@@ -202,6 +202,10 @@ class StableDiffusionProcessing():
...
@@ -202,6 +202,10 @@ class StableDiffusionProcessing():
def
sample
(
self
,
conditioning
,
unconditional_conditioning
,
seeds
,
subseeds
,
subseed_strength
):
def
sample
(
self
,
conditioning
,
unconditional_conditioning
,
seeds
,
subseeds
,
subseed_strength
):
raise
NotImplementedError
()
raise
NotImplementedError
()
def
close
(
self
):
self
.
sd_model
=
None
self
.
sampler
=
None
class
Processed
:
class
Processed
:
def
__init__
(
self
,
p
:
StableDiffusionProcessing
,
images_list
,
seed
=-
1
,
info
=
""
,
subseed
=
None
,
all_prompts
=
None
,
all_seeds
=
None
,
all_subseeds
=
None
,
index_of_first_image
=
0
,
infotexts
=
None
):
def
__init__
(
self
,
p
:
StableDiffusionProcessing
,
images_list
,
seed
=-
1
,
info
=
""
,
subseed
=
None
,
all_prompts
=
None
,
all_seeds
=
None
,
all_subseeds
=
None
,
index_of_first_image
=
0
,
infotexts
=
None
):
...
@@ -597,9 +601,6 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
...
@@ -597,9 +601,6 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
if
p
.
scripts
is
not
None
:
if
p
.
scripts
is
not
None
:
p
.
scripts
.
postprocess
(
p
,
res
)
p
.
scripts
.
postprocess
(
p
,
res
)
p
.
sd_model
=
None
p
.
sampler
=
None
return
res
return
res
...
...
modules/txt2img.py
View file @
65522ff1
...
@@ -47,6 +47,8 @@ def txt2img(prompt: str, negative_prompt: str, prompt_style: str, prompt_style2:
...
@@ -47,6 +47,8 @@ def txt2img(prompt: str, negative_prompt: str, prompt_style: str, prompt_style2:
if
processed
is
None
:
if
processed
is
None
:
processed
=
process_images
(
p
)
processed
=
process_images
(
p
)
p
.
close
()
shared
.
total_tqdm
.
clear
()
shared
.
total_tqdm
.
clear
()
generation_info_js
=
processed
.
js
()
generation_info_js
=
processed
.
js
()
...
...
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