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
2dc84d14
Commit
2dc84d14
authored
Jul 06, 2024
by
comfyanonymous
Browse files
Add a way to set the timestep multiplier in the flow sampling.
parent
ff63893d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
comfy/model_sampling.py
comfy/model_sampling.py
+6
-5
No files found.
comfy/model_sampling.py
View file @
2dc84d14
...
@@ -190,11 +190,12 @@ class ModelSamplingDiscreteFlow(torch.nn.Module):
...
@@ -190,11 +190,12 @@ class ModelSamplingDiscreteFlow(torch.nn.Module):
else
:
else
:
sampling_settings
=
{}
sampling_settings
=
{}
self
.
set_parameters
(
shift
=
sampling_settings
.
get
(
"shift"
,
1.0
))
self
.
set_parameters
(
shift
=
sampling_settings
.
get
(
"shift"
,
1.0
)
,
multiplier
=
sampling_settings
.
get
(
"multiplier"
,
1000
)
)
def
set_parameters
(
self
,
shift
=
1.0
,
timesteps
=
1000
):
def
set_parameters
(
self
,
shift
=
1.0
,
timesteps
=
1000
,
multiplier
=
1000
):
self
.
shift
=
shift
self
.
shift
=
shift
ts
=
self
.
sigma
(
torch
.
arange
(
1
,
timesteps
+
1
,
1
))
self
.
multiplier
=
multiplier
ts
=
self
.
sigma
((
torch
.
arange
(
1
,
timesteps
+
1
,
1
)
/
timesteps
)
*
multiplier
)
self
.
register_buffer
(
'sigmas'
,
ts
)
self
.
register_buffer
(
'sigmas'
,
ts
)
@
property
@
property
...
@@ -206,10 +207,10 @@ class ModelSamplingDiscreteFlow(torch.nn.Module):
...
@@ -206,10 +207,10 @@ class ModelSamplingDiscreteFlow(torch.nn.Module):
return
self
.
sigmas
[
-
1
]
return
self
.
sigmas
[
-
1
]
def
timestep
(
self
,
sigma
):
def
timestep
(
self
,
sigma
):
return
sigma
*
1000
return
sigma
*
self
.
multiplier
def
sigma
(
self
,
timestep
):
def
sigma
(
self
,
timestep
):
return
time_snr_shift
(
self
.
shift
,
timestep
/
1000
)
return
time_snr_shift
(
self
.
shift
,
timestep
/
self
.
multiplier
)
def
percent_to_sigma
(
self
,
percent
):
def
percent_to_sigma
(
self
,
percent
):
if
percent
<=
0.0
:
if
percent
<=
0.0
:
...
...
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