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
d9d8702d
Commit
d9d8702d
authored
Nov 18, 2023
by
comfyanonymous
Browse files
percent_to_sigma now returns a float instead of a tensor.
parent
8a451234
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
comfy/model_sampling.py
comfy/model_sampling.py
+3
-3
comfy_extras/nodes_model_advanced.py
comfy_extras/nodes_model_advanced.py
+3
-3
comfy_extras/nodes_model_downscale.py
comfy_extras/nodes_model_downscale.py
+2
-2
No files found.
comfy/model_sampling.py
View file @
d9d8702d
...
@@ -77,9 +77,9 @@ class ModelSamplingDiscrete(torch.nn.Module):
...
@@ -77,9 +77,9 @@ class ModelSamplingDiscrete(torch.nn.Module):
def
percent_to_sigma
(
self
,
percent
):
def
percent_to_sigma
(
self
,
percent
):
if
percent
<=
0.0
:
if
percent
<=
0.0
:
return
torch
.
tensor
(
999999999.9
)
return
999999999.9
if
percent
>=
1.0
:
if
percent
>=
1.0
:
return
torch
.
tensor
(
0.0
)
return
0.0
percent
=
1.0
-
percent
percent
=
1.0
-
percent
return
self
.
sigma
(
torch
.
tensor
(
percent
*
999.0
))
return
self
.
sigma
(
torch
.
tensor
(
percent
*
999.0
))
.
item
()
comfy_extras/nodes_model_advanced.py
View file @
d9d8702d
...
@@ -67,11 +67,11 @@ class ModelSamplingDiscreteLCM(torch.nn.Module):
...
@@ -67,11 +67,11 @@ class ModelSamplingDiscreteLCM(torch.nn.Module):
def
percent_to_sigma
(
self
,
percent
):
def
percent_to_sigma
(
self
,
percent
):
if
percent
<=
0.0
:
if
percent
<=
0.0
:
return
torch
.
tensor
(
999999999.9
)
return
999999999.9
if
percent
>=
1.0
:
if
percent
>=
1.0
:
return
torch
.
tensor
(
0.0
)
return
0.0
percent
=
1.0
-
percent
percent
=
1.0
-
percent
return
self
.
sigma
(
torch
.
tensor
(
percent
*
999.0
))
return
self
.
sigma
(
torch
.
tensor
(
percent
*
999.0
))
.
item
()
def
rescale_zero_terminal_snr_sigmas
(
sigmas
):
def
rescale_zero_terminal_snr_sigmas
(
sigmas
):
...
...
comfy_extras/nodes_model_downscale.py
View file @
d9d8702d
...
@@ -16,8 +16,8 @@ class PatchModelAddDownscale:
...
@@ -16,8 +16,8 @@ class PatchModelAddDownscale:
CATEGORY
=
"_for_testing"
CATEGORY
=
"_for_testing"
def
patch
(
self
,
model
,
block_number
,
downscale_factor
,
start_percent
,
end_percent
,
downscale_after_skip
):
def
patch
(
self
,
model
,
block_number
,
downscale_factor
,
start_percent
,
end_percent
,
downscale_after_skip
):
sigma_start
=
model
.
model
.
model_sampling
.
percent_to_sigma
(
start_percent
)
.
item
()
sigma_start
=
model
.
model
.
model_sampling
.
percent_to_sigma
(
start_percent
)
sigma_end
=
model
.
model
.
model_sampling
.
percent_to_sigma
(
end_percent
)
.
item
()
sigma_end
=
model
.
model
.
model_sampling
.
percent_to_sigma
(
end_percent
)
def
input_block_patch
(
h
,
transformer_options
):
def
input_block_patch
(
h
,
transformer_options
):
if
transformer_options
[
"block"
][
1
]
==
block_number
:
if
transformer_options
[
"block"
][
1
]
==
block_number
:
...
...
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