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
f5589428
"vscode:/vscode.git/clone" did not exist on "574ea12f7c747cb636374f3cb9323823bba4e89c"
Unverified
Commit
f5589428
authored
Feb 12, 2023
by
pythongosssss
Committed by
GitHub
Feb 12, 2023
Browse files
Merge branch 'comfyanonymous:master' into master
parents
9d1edfde
3fd6b702
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
nodes.py
nodes.py
+20
-2
webshit/index.html
webshit/index.html
+15
-1
No files found.
nodes.py
View file @
f5589428
...
...
@@ -301,17 +301,35 @@ class LatentComposite:
"samples_from"
:
(
"LATENT"
,),
"x"
:
(
"INT"
,
{
"default"
:
0
,
"min"
:
0
,
"max"
:
4096
,
"step"
:
8
}),
"y"
:
(
"INT"
,
{
"default"
:
0
,
"min"
:
0
,
"max"
:
4096
,
"step"
:
8
}),
"feather"
:
(
"INT"
,
{
"default"
:
0
,
"min"
:
0
,
"max"
:
4096
,
"step"
:
8
}),
}}
RETURN_TYPES
=
(
"LATENT"
,)
FUNCTION
=
"composite"
CATEGORY
=
"latent"
def
composite
(
self
,
samples_to
,
samples_from
,
x
,
y
,
composite_method
=
"normal"
):
def
composite
(
self
,
samples_to
,
samples_from
,
x
,
y
,
composite_method
=
"normal"
,
feather
=
0
):
x
=
x
//
8
y
=
y
//
8
feather
=
feather
//
8
s
=
samples_to
.
clone
()
s
[:,:,
y
:
y
+
samples_from
.
shape
[
2
],
x
:
x
+
samples_from
.
shape
[
3
]]
=
samples_from
[:,:,:
samples_to
.
shape
[
2
]
-
y
,
:
samples_to
.
shape
[
3
]
-
x
]
if
feather
==
0
:
s
[:,:,
y
:
y
+
samples_from
.
shape
[
2
],
x
:
x
+
samples_from
.
shape
[
3
]]
=
samples_from
[:,:,:
samples_to
.
shape
[
2
]
-
y
,
:
samples_to
.
shape
[
3
]
-
x
]
else
:
s_from
=
samples_from
[:,:,:
samples_to
.
shape
[
2
]
-
y
,
:
samples_to
.
shape
[
3
]
-
x
]
mask
=
torch
.
ones_like
(
s_from
)
for
t
in
range
(
feather
):
if
y
!=
0
:
mask
[:,:,
t
:
1
+
t
,:]
*=
((
1.0
/
feather
)
*
(
t
+
1
))
if
y
+
samples_from
.
shape
[
2
]
<
samples_to
.
shape
[
2
]:
mask
[:,:,
mask
.
shape
[
2
]
-
1
-
t
:
mask
.
shape
[
2
]
-
t
,:]
*=
((
1.0
/
feather
)
*
(
t
+
1
))
if
x
!=
0
:
mask
[:,:,:,
t
:
1
+
t
]
*=
((
1.0
/
feather
)
*
(
t
+
1
))
if
x
+
samples_from
.
shape
[
3
]
<
samples_to
.
shape
[
3
]:
mask
[:,:,:,
mask
.
shape
[
3
]
-
1
-
t
:
mask
.
shape
[
3
]
-
t
]
*=
((
1.0
/
feather
)
*
(
t
+
1
))
rev_mask
=
torch
.
ones_like
(
mask
)
-
mask
s
[:,:,
y
:
y
+
samples_from
.
shape
[
2
],
x
:
x
+
samples_from
.
shape
[
3
]]
=
samples_from
[:,:,:
samples_to
.
shape
[
2
]
-
y
,
:
samples_to
.
shape
[
3
]
-
x
]
*
mask
+
s
[:,:,
y
:
y
+
samples_from
.
shape
[
2
],
x
:
x
+
samples_from
.
shape
[
3
]]
*
rev_mask
return
(
s
,)
class
LatentCrop
:
...
...
webshit/index.html
View file @
f5589428
...
...
@@ -3,6 +3,20 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"litegraph.css"
>
<script
type=
"text/javascript"
src=
"litegraph.core.js"
></script>
</head>
<style>
.customtext_input
{
background-color
:
#FFFFFF
;
}
@media
(
prefers-color-scheme
:
dark
)
{
body
{
background-color
:
#202020
;
}
.customtext_input
{
background-color
:
#202020
;
color
:
white
;
}
}
</style>
<body
style=
'width:100%; height:100%; overflow: hidden;'
>
<style>
.modal
{
...
...
@@ -198,7 +212,7 @@ function onObjectInfo(json) {
};
w
.
input_div
=
document
.
createElement
(
'
div
'
);
w
.
input_div
.
contentEditable
=
true
;
w
.
input_div
.
style
.
backgroundColor
=
"
#FFFFFF
"
;
w
.
input_div
.
className
=
"
customtext_input
"
;
w
.
input_div
.
style
.
overflow
=
'
hidden
'
;
w
.
input_div
.
style
.
overflowY
=
'
auto
'
;
w
.
input_div
.
style
.
padding
=
2
;
...
...
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