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
5f75d784
"doc/git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "1ea1a86eba0bf2d6d3906724b29eada486b9a519"
Commit
5f75d784
authored
Jul 24, 2023
by
comfyanonymous
Browse files
Start is now 0.0 and end is now 1.0 for the timestep ranges.
parent
7ff14b62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
comfy/sd.py
comfy/sd.py
+6
-1
nodes.py
nodes.py
+8
-8
No files found.
comfy/sd.py
View file @
5f75d784
...
@@ -713,7 +713,6 @@ class ControlBase:
...
@@ -713,7 +713,6 @@ class ControlBase:
out
=
[]
out
=
[]
if
self
.
previous_controlnet
is
not
None
:
if
self
.
previous_controlnet
is
not
None
:
out
+=
self
.
previous_controlnet
.
get_models
()
out
+=
self
.
previous_controlnet
.
get_models
()
out
.
append
(
self
.
control_model
)
return
out
return
out
def
copy_to
(
self
,
c
):
def
copy_to
(
self
,
c
):
...
@@ -791,6 +790,12 @@ class ControlNet(ControlBase):
...
@@ -791,6 +790,12 @@ class ControlNet(ControlBase):
self
.
copy_to
(
c
)
self
.
copy_to
(
c
)
return
c
return
c
def
get_models
(
self
):
out
=
super
().
get_models
()
out
.
append
(
self
.
control_model
)
return
out
def
load_controlnet
(
ckpt_path
,
model
=
None
):
def
load_controlnet
(
ckpt_path
,
model
=
None
):
controlnet_data
=
utils
.
load_torch_file
(
ckpt_path
,
safe_load
=
True
)
controlnet_data
=
utils
.
load_torch_file
(
ckpt_path
,
safe_load
=
True
)
...
...
nodes.py
View file @
5f75d784
...
@@ -208,8 +208,8 @@ class ConditioningSetTimestepRange:
...
@@ -208,8 +208,8 @@ class ConditioningSetTimestepRange:
@
classmethod
@
classmethod
def
INPUT_TYPES
(
s
):
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"conditioning"
:
(
"CONDITIONING"
,
),
return
{
"required"
:
{
"conditioning"
:
(
"CONDITIONING"
,
),
"start"
:
(
"FLOAT"
,
{
"default"
:
1
.0
,
"min"
:
0.0
,
"max"
:
1.0
,
"step"
:
0.001
}),
"start"
:
(
"FLOAT"
,
{
"default"
:
0
.0
,
"min"
:
0.0
,
"max"
:
1.0
,
"step"
:
0.001
}),
"end"
:
(
"FLOAT"
,
{
"default"
:
0
.0
,
"min"
:
0.0
,
"max"
:
1.0
,
"step"
:
0.001
})
"end"
:
(
"FLOAT"
,
{
"default"
:
1
.0
,
"min"
:
0.0
,
"max"
:
1.0
,
"step"
:
0.001
})
}}
}}
RETURN_TYPES
=
(
"CONDITIONING"
,)
RETURN_TYPES
=
(
"CONDITIONING"
,)
FUNCTION
=
"set_range"
FUNCTION
=
"set_range"
...
@@ -220,8 +220,8 @@ class ConditioningSetTimestepRange:
...
@@ -220,8 +220,8 @@ class ConditioningSetTimestepRange:
c
=
[]
c
=
[]
for
t
in
conditioning
:
for
t
in
conditioning
:
d
=
t
[
1
].
copy
()
d
=
t
[
1
].
copy
()
d
[
'start_percent'
]
=
start
d
[
'start_percent'
]
=
1.0
-
start
d
[
'end_percent'
]
=
end
d
[
'end_percent'
]
=
1.0
-
end
n
=
[
t
[
0
],
d
]
n
=
[
t
[
0
],
d
]
c
.
append
(
n
)
c
.
append
(
n
)
return
(
c
,
)
return
(
c
,
)
...
@@ -615,8 +615,8 @@ class ControlNetApplyAdvanced:
...
@@ -615,8 +615,8 @@ class ControlNetApplyAdvanced:
"control_net"
:
(
"CONTROL_NET"
,
),
"control_net"
:
(
"CONTROL_NET"
,
),
"image"
:
(
"IMAGE"
,
),
"image"
:
(
"IMAGE"
,
),
"strength"
:
(
"FLOAT"
,
{
"default"
:
1.0
,
"min"
:
0.0
,
"max"
:
10.0
,
"step"
:
0.01
}),
"strength"
:
(
"FLOAT"
,
{
"default"
:
1.0
,
"min"
:
0.0
,
"max"
:
10.0
,
"step"
:
0.01
}),
"start"
:
(
"FLOAT"
,
{
"default"
:
1
.0
,
"min"
:
0.0
,
"max"
:
1.0
,
"step"
:
0.001
}),
"start
_percent
"
:
(
"FLOAT"
,
{
"default"
:
0
.0
,
"min"
:
0.0
,
"max"
:
1.0
,
"step"
:
0.001
}),
"end"
:
(
"FLOAT"
,
{
"default"
:
0
.0
,
"min"
:
0.0
,
"max"
:
1.0
,
"step"
:
0.001
})
"end
_percent
"
:
(
"FLOAT"
,
{
"default"
:
1
.0
,
"min"
:
0.0
,
"max"
:
1.0
,
"step"
:
0.001
})
}}
}}
RETURN_TYPES
=
(
"CONDITIONING"
,
"CONDITIONING"
)
RETURN_TYPES
=
(
"CONDITIONING"
,
"CONDITIONING"
)
...
@@ -625,7 +625,7 @@ class ControlNetApplyAdvanced:
...
@@ -625,7 +625,7 @@ class ControlNetApplyAdvanced:
CATEGORY
=
"conditioning"
CATEGORY
=
"conditioning"
def
apply_controlnet
(
self
,
positive
,
negative
,
control_net
,
image
,
strength
,
start
,
end
):
def
apply_controlnet
(
self
,
positive
,
negative
,
control_net
,
image
,
strength
,
start
_percent
,
end_percent
):
if
strength
==
0
:
if
strength
==
0
:
return
(
positive
,
negative
)
return
(
positive
,
negative
)
...
@@ -642,7 +642,7 @@ class ControlNetApplyAdvanced:
...
@@ -642,7 +642,7 @@ class ControlNetApplyAdvanced:
if
prev_cnet
in
cnets
:
if
prev_cnet
in
cnets
:
c_net
=
cnets
[
prev_cnet
]
c_net
=
cnets
[
prev_cnet
]
else
:
else
:
c_net
=
control_net
.
copy
().
set_cond_hint
(
control_hint
,
strength
,
(
start
,
end
))
c_net
=
control_net
.
copy
().
set_cond_hint
(
control_hint
,
strength
,
(
1.0
-
start_percent
,
1.0
-
end_percent
))
c_net
.
set_previous_controlnet
(
prev_cnet
)
c_net
.
set_previous_controlnet
(
prev_cnet
)
cnets
[
prev_cnet
]
=
c_net
cnets
[
prev_cnet
]
=
c_net
...
...
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