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
"vscode:/vscode.git/clone" did not exist on "21a563d385ff520e1f7fdaada722212b35fb8d95"
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
Show 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:
out
=
[]
if
self
.
previous_controlnet
is
not
None
:
out
+=
self
.
previous_controlnet
.
get_models
()
out
.
append
(
self
.
control_model
)
return
out
def
copy_to
(
self
,
c
):
...
...
@@ -791,6 +790,12 @@ class ControlNet(ControlBase):
self
.
copy_to
(
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
):
controlnet_data
=
utils
.
load_torch_file
(
ckpt_path
,
safe_load
=
True
)
...
...
nodes.py
View file @
5f75d784
...
...
@@ -208,8 +208,8 @@ class ConditioningSetTimestepRange:
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"conditioning"
:
(
"CONDITIONING"
,
),
"start"
:
(
"FLOAT"
,
{
"default"
:
1
.0
,
"min"
:
0.0
,
"max"
:
1.0
,
"step"
:
0.001
}),
"end"
:
(
"FLOAT"
,
{
"default"
:
0
.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"
:
1
.0
,
"min"
:
0.0
,
"max"
:
1.0
,
"step"
:
0.001
})
}}
RETURN_TYPES
=
(
"CONDITIONING"
,)
FUNCTION
=
"set_range"
...
...
@@ -220,8 +220,8 @@ class ConditioningSetTimestepRange:
c
=
[]
for
t
in
conditioning
:
d
=
t
[
1
].
copy
()
d
[
'start_percent'
]
=
start
d
[
'end_percent'
]
=
end
d
[
'start_percent'
]
=
1.0
-
start
d
[
'end_percent'
]
=
1.0
-
end
n
=
[
t
[
0
],
d
]
c
.
append
(
n
)
return
(
c
,
)
...
...
@@ -615,8 +615,8 @@ class ControlNetApplyAdvanced:
"control_net"
:
(
"CONTROL_NET"
,
),
"image"
:
(
"IMAGE"
,
),
"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
}),
"end"
:
(
"FLOAT"
,
{
"default"
:
0
.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
_percent
"
:
(
"FLOAT"
,
{
"default"
:
1
.0
,
"min"
:
0.0
,
"max"
:
1.0
,
"step"
:
0.001
})
}}
RETURN_TYPES
=
(
"CONDITIONING"
,
"CONDITIONING"
)
...
...
@@ -625,7 +625,7 @@ class ControlNetApplyAdvanced:
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
:
return
(
positive
,
negative
)
...
...
@@ -642,7 +642,7 @@ class ControlNetApplyAdvanced:
if
prev_cnet
in
cnets
:
c_net
=
cnets
[
prev_cnet
]
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
)
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