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
e0e80050
Commit
e0e80050
authored
Jan 16, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make StableDiffusionProcessing class not hold a reference to shared.sd_model object
parent
9991967f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
processing.py
modules/processing.py
+5
-4
xy_grid.py
scripts/xy_grid.py
+0
-1
No files found.
modules/processing.py
View file @
e0e80050
...
...
@@ -94,7 +94,7 @@ def txt2img_image_conditioning(sd_model, x, width, height):
return
image_conditioning
class
StableDiffusionProcessing
()
:
class
StableDiffusionProcessing
:
"""
The first set of paramaters: sd_models -> do_not_reload_embeddings represent the minimum required to create a StableDiffusionProcessing
"""
...
...
@@ -102,7 +102,6 @@ class StableDiffusionProcessing():
if
sampler_index
is
not
None
:
print
(
"sampler_index argument for StableDiffusionProcessing does not do anything; use sampler_name"
,
file
=
sys
.
stderr
)
self
.
sd_model
=
sd_model
self
.
outpath_samples
:
str
=
outpath_samples
self
.
outpath_grids
:
str
=
outpath_grids
self
.
prompt
:
str
=
prompt
...
...
@@ -156,6 +155,10 @@ class StableDiffusionProcessing():
self
.
all_subseeds
=
None
self
.
iteration
=
0
@
property
def
sd_model
(
self
):
return
shared
.
sd_model
def
txt2img_image_conditioning
(
self
,
x
,
width
=
None
,
height
=
None
):
self
.
is_using_inpainting_conditioning
=
self
.
sd_model
.
model
.
conditioning_key
in
{
'hybrid'
,
'concat'
}
...
...
@@ -236,7 +239,6 @@ class StableDiffusionProcessing():
raise
NotImplementedError
()
def
close
(
self
):
self
.
sd_model
=
None
self
.
sampler
=
None
...
...
@@ -471,7 +473,6 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
if
k
==
'sd_model_checkpoint'
:
sd_models
.
reload_model_weights
()
# make onchange call for changing SD model
p
.
sd_model
=
shared
.
sd_model
if
k
==
'sd_vae'
:
sd_vae
.
reload_vae_weights
()
# make onchange call for changing VAE
...
...
scripts/xy_grid.py
View file @
e0e80050
...
...
@@ -86,7 +86,6 @@ def apply_checkpoint(p, x, xs):
if
info
is
None
:
raise
RuntimeError
(
f
"Unknown checkpoint: {x}"
)
modules
.
sd_models
.
reload_model_weights
(
shared
.
sd_model
,
info
)
p
.
sd_model
=
shared
.
sd_model
def
confirm_checkpoints
(
p
,
xs
):
...
...
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