Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
9b655d4f
Commit
9b655d4f
authored
Dec 04, 2023
by
comfyanonymous
Browse files
Fix memory issue with control loras.
parent
26b1c0a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
comfy/sample.py
comfy/sample.py
+2
-2
No files found.
comfy/sample.py
View file @
9b655d4f
...
...
@@ -101,7 +101,7 @@ def sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative
samples
=
samples
.
cpu
()
cleanup_additional_models
(
models
)
cleanup_additional_models
(
set
(
get_models_from_cond
(
positive
,
"control"
)
+
get_models_from_cond
(
negative
,
"control"
)))
cleanup_additional_models
(
set
(
get_models_from_cond
(
positive
_copy
,
"control"
)
+
get_models_from_cond
(
negative
_copy
,
"control"
)))
return
samples
def
sample_custom
(
model
,
noise
,
cfg
,
sampler
,
sigmas
,
positive
,
negative
,
latent_image
,
noise_mask
=
None
,
callback
=
None
,
disable_pbar
=
False
,
seed
=
None
):
...
...
@@ -113,6 +113,6 @@ def sample_custom(model, noise, cfg, sampler, sigmas, positive, negative, latent
samples
=
comfy
.
samplers
.
sample
(
real_model
,
noise
,
positive_copy
,
negative_copy
,
cfg
,
model
.
load_device
,
sampler
,
sigmas
,
model_options
=
model
.
model_options
,
latent_image
=
latent_image
,
denoise_mask
=
noise_mask
,
callback
=
callback
,
disable_pbar
=
disable_pbar
,
seed
=
seed
)
samples
=
samples
.
cpu
()
cleanup_additional_models
(
models
)
cleanup_additional_models
(
set
(
get_models_from_cond
(
positive
,
"control"
)
+
get_models_from_cond
(
negative
,
"control"
)))
cleanup_additional_models
(
set
(
get_models_from_cond
(
positive
_copy
,
"control"
)
+
get_models_from_cond
(
negative
_copy
,
"control"
)))
return
samples
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