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
c4723776
"...ComputeVision/Detection/MaskRCNN/scripts/train_1GPU.sh" did not exist on "0fc002dfc863089e33ea2dee33b0827046e4d174"
Unverified
Commit
c4723776
authored
Feb 13, 2023
by
pythongosssss
Committed by
GitHub
Feb 13, 2023
Browse files
Merge branch 'comfyanonymous:master' into master
parents
f616dcc8
e3451cea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
comfy/extra_samplers/uni_pc.py
comfy/extra_samplers/uni_pc.py
+10
-2
No files found.
comfy/extra_samplers/uni_pc.py
View file @
c4723776
...
@@ -821,7 +821,13 @@ def expand_dims(v, dims):
...
@@ -821,7 +821,13 @@ def expand_dims(v, dims):
def
sample_unipc
(
model
,
noise
,
image
,
sigmas
,
sampling_function
,
extra_args
=
None
,
callback
=
None
,
disable
=
None
):
def
sample_unipc
(
model
,
noise
,
image
,
sigmas
,
sampling_function
,
extra_args
=
None
,
callback
=
None
,
disable
=
None
):
timesteps
=
torch
.
nn
.
functional
.
interpolate
(
sigmas
[
None
,
None
,:
-
1
],
size
=
(
len
(
sigmas
),),
mode
=
'linear'
)[
0
][
0
]
to_zero
=
False
if
sigmas
[
-
1
]
==
0
:
timesteps
=
torch
.
nn
.
functional
.
interpolate
(
sigmas
[
None
,
None
,:
-
1
],
size
=
(
len
(
sigmas
),),
mode
=
'linear'
)[
0
][
0
]
to_zero
=
True
else
:
timesteps
=
sigmas
.
clone
()
for
s
in
range
(
timesteps
.
shape
[
0
]):
for
s
in
range
(
timesteps
.
shape
[
0
]):
timesteps
[
s
]
=
(
model
.
sigma_to_t
(
timesteps
[
s
])
/
1000
)
+
(
1
/
len
(
model
.
sigmas
))
timesteps
[
s
]
=
(
model
.
sigma_to_t
(
timesteps
[
s
])
/
1000
)
+
(
1
/
len
(
model
.
sigmas
))
...
@@ -832,7 +838,7 @@ def sample_unipc(model, noise, image, sigmas, sampling_function, extra_args=None
...
@@ -832,7 +838,7 @@ def sample_unipc(model, noise, image, sigmas, sampling_function, extra_args=None
else
:
else
:
img
=
noise
img
=
noise
if
sigmas
[
-
1
]
==
0
:
if
to_zero
:
timesteps
[
-
1
]
=
(
1
/
len
(
model
.
sigmas
))
timesteps
[
-
1
]
=
(
1
/
len
(
model
.
sigmas
))
device
=
noise
.
device
device
=
noise
.
device
...
@@ -853,4 +859,6 @@ def sample_unipc(model, noise, image, sigmas, sampling_function, extra_args=None
...
@@ -853,4 +859,6 @@ def sample_unipc(model, noise, image, sigmas, sampling_function, extra_args=None
uni_pc
=
UniPC
(
model_fn
,
ns
,
predict_x0
=
True
,
thresholding
=
False
)
uni_pc
=
UniPC
(
model_fn
,
ns
,
predict_x0
=
True
,
thresholding
=
False
)
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
=
3
,
lower_order_final
=
True
)
if
not
to_zero
:
x
/=
ns
.
marginal_alpha
(
timesteps
[
-
1
])
return
x
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