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
3cd7d84b
Commit
3cd7d84b
authored
Feb 26, 2023
by
comfyanonymous
Browse files
Fix uni_pc sampler not working with 1 or 2 steps.
parent
8f75047d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
comfy/extra_samplers/uni_pc.py
comfy/extra_samplers/uni_pc.py
+2
-1
No files found.
comfy/extra_samplers/uni_pc.py
View file @
3cd7d84b
...
...
@@ -875,8 +875,9 @@ def sample_unipc(model, noise, image, sigmas, sampling_function, max_denoise, ex
model_kwargs
=
extra_args
,
)
order
=
min
(
3
,
len
(
timesteps
)
-
1
)
uni_pc
=
UniPC
(
model_fn
,
ns
,
predict_x0
=
True
,
thresholding
=
False
,
noise_mask
=
noise_mask
,
masked_image
=
image
,
noise
=
noise
,
variant
=
variant
)
x
=
uni_pc
.
sample
(
img
,
timesteps
=
timesteps
,
skip_type
=
"time_uniform"
,
method
=
"multistep"
,
order
=
3
,
lower_order_final
=
True
)
x
=
uni_pc
.
sample
(
img
,
timesteps
=
timesteps
,
skip_type
=
"time_uniform"
,
method
=
"multistep"
,
order
=
order
,
lower_order_final
=
True
)
if
not
to_zero
:
x
/=
ns
.
marginal_alpha
(
timesteps
[
-
1
])
return
x
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