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
a4ec54a4
Commit
a4ec54a4
authored
Dec 08, 2023
by
comfyanonymous
Browse files
Add linear_start and linear_end to model_config.sampling_settings
parent
9ac0b487
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
comfy/model_sampling.py
comfy/model_sampling.py
+10
-3
No files found.
comfy/model_sampling.py
View file @
a4ec54a4
...
@@ -22,10 +22,17 @@ class V_PREDICTION(EPS):
...
@@ -22,10 +22,17 @@ class V_PREDICTION(EPS):
class
ModelSamplingDiscrete
(
torch
.
nn
.
Module
):
class
ModelSamplingDiscrete
(
torch
.
nn
.
Module
):
def
__init__
(
self
,
model_config
=
None
):
def
__init__
(
self
,
model_config
=
None
):
super
().
__init__
()
super
().
__init__
()
beta_schedule
=
"linear"
if
model_config
is
not
None
:
if
model_config
is
not
None
:
beta_schedule
=
model_config
.
sampling_settings
.
get
(
"beta_schedule"
,
beta_schedule
)
sampling_settings
=
model_config
.
sampling_settings
self
.
_register_schedule
(
given_betas
=
None
,
beta_schedule
=
beta_schedule
,
timesteps
=
1000
,
linear_start
=
0.00085
,
linear_end
=
0.012
,
cosine_s
=
8e-3
)
else
:
sampling_settings
=
{}
beta_schedule
=
sampling_settings
.
get
(
"beta_schedule"
,
"linear"
)
linear_start
=
sampling_settings
.
get
(
"linear_start"
,
0.00085
)
linear_end
=
sampling_settings
.
get
(
"linear_end"
,
0.012
)
self
.
_register_schedule
(
given_betas
=
None
,
beta_schedule
=
beta_schedule
,
timesteps
=
1000
,
linear_start
=
linear_start
,
linear_end
=
linear_end
,
cosine_s
=
8e-3
)
self
.
sigma_data
=
1.0
self
.
sigma_data
=
1.0
def
_register_schedule
(
self
,
given_betas
=
None
,
beta_schedule
=
"linear"
,
timesteps
=
1000
,
def
_register_schedule
(
self
,
given_betas
=
None
,
beta_schedule
=
"linear"
,
timesteps
=
1000
,
...
...
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