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
585fb047
Commit
585fb047
authored
Sep 23, 2023
by
MoonRide303
Browse files
Adding default alpha when splitting RGB images
parent
ece69bf2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
comfy_extras/nodes_compositing.py
comfy_extras/nodes_compositing.py
+1
-1
No files found.
comfy_extras/nodes_compositing.py
View file @
585fb047
...
@@ -153,7 +153,7 @@ class SplitImageWithAlpha:
...
@@ -153,7 +153,7 @@ class SplitImageWithAlpha:
def
split_image_with_alpha
(
self
,
image
:
torch
.
Tensor
):
def
split_image_with_alpha
(
self
,
image
:
torch
.
Tensor
):
out_images
=
[
i
[:,:,:
3
]
for
i
in
image
]
out_images
=
[
i
[:,:,:
3
]
for
i
in
image
]
out_alphas
=
[
i
[:,:,
3
]
for
i
in
image
]
out_alphas
=
[
i
[:,:,
3
]
if
i
.
shape
[
2
]
>
3
else
torch
.
ones_like
(
i
[:,:,
0
])
for
i
in
image
]
result
=
(
torch
.
stack
(
out_images
),
torch
.
stack
(
out_alphas
))
result
=
(
torch
.
stack
(
out_images
),
torch
.
stack
(
out_alphas
))
return
result
return
result
...
...
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