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
cf10c559
"test/vscode:/vscode.git/clone" did not exist on "ddc495482b8d84f276df3a9c6b406732f0828458"
Commit
cf10c559
authored
Aug 09, 2023
by
comfyanonymous
Browse files
Disable calculating uncond when CFG is 1.0
parent
5ac96897
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
comfy/samplers.py
comfy/samplers.py
+9
-5
No files found.
comfy/samplers.py
View file @
cf10c559
...
@@ -189,6 +189,7 @@ def sampling_function(model_function, x, timestep, uncond, cond, cond_scale, con
...
@@ -189,6 +189,7 @@ def sampling_function(model_function, x, timestep, uncond, cond, cond_scale, con
continue
continue
to_run
+=
[(
p
,
COND
)]
to_run
+=
[(
p
,
COND
)]
if
uncond
is
not
None
:
for
x
in
uncond
:
for
x
in
uncond
:
p
=
get_area_and_mult
(
x
,
x_in
,
cond_concat_in
,
timestep
)
p
=
get_area_and_mult
(
x
,
x_in
,
cond_concat_in
,
timestep
)
if
p
is
None
:
if
p
is
None
:
...
@@ -282,6 +283,9 @@ def sampling_function(model_function, x, timestep, uncond, cond, cond_scale, con
...
@@ -282,6 +283,9 @@ def sampling_function(model_function, x, timestep, uncond, cond, cond_scale, con
max_total_area
=
model_management
.
maximum_batch_area
()
max_total_area
=
model_management
.
maximum_batch_area
()
if
math
.
isclose
(
cond_scale
,
1.0
):
uncond
=
None
cond
,
uncond
=
calc_cond_uncond_batch
(
model_function
,
cond
,
uncond
,
x
,
timestep
,
max_total_area
,
cond_concat
,
model_options
)
cond
,
uncond
=
calc_cond_uncond_batch
(
model_function
,
cond
,
uncond
,
x
,
timestep
,
max_total_area
,
cond_concat
,
model_options
)
if
"sampler_cfg_function"
in
model_options
:
if
"sampler_cfg_function"
in
model_options
:
args
=
{
"cond"
:
cond
,
"uncond"
:
uncond
,
"cond_scale"
:
cond_scale
,
"timestep"
:
timestep
}
args
=
{
"cond"
:
cond
,
"uncond"
:
uncond
,
"cond_scale"
:
cond_scale
,
"timestep"
:
timestep
}
...
...
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