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
e7d88855
"llama/git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "42dd5af51ec3f345018b2206a1656bb09718af67"
Commit
e7d88855
authored
Aug 14, 2023
by
comfyanonymous
Browse files
Add node to batch images together.
parent
d4380f3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
nodes.py
nodes.py
+18
-0
No files found.
nodes.py
View file @
e7d88855
...
@@ -1448,6 +1448,22 @@ class ImageInvert:
...
@@ -1448,6 +1448,22 @@ class ImageInvert:
s
=
1.0
-
image
s
=
1.0
-
image
return
(
s
,)
return
(
s
,)
class
ImageBatch
:
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"image1"
:
(
"IMAGE"
,),
"image2"
:
(
"IMAGE"
,)}}
RETURN_TYPES
=
(
"IMAGE"
,)
FUNCTION
=
"batch"
CATEGORY
=
"image"
def
batch
(
self
,
image1
,
image2
):
if
image1
.
shape
[
1
:]
!=
image2
.
shape
[
1
:]:
image2
=
comfy
.
utils
.
common_upscale
(
image2
.
movedim
(
-
1
,
1
),
image1
.
shape
[
2
],
image1
.
shape
[
1
],
"bilinear"
,
"center"
).
movedim
(
1
,
-
1
)
s
=
torch
.
cat
((
image1
,
image2
),
dim
=
0
)
return
(
s
,)
class
ImagePadForOutpaint
:
class
ImagePadForOutpaint
:
...
@@ -1533,6 +1549,7 @@ NODE_CLASS_MAPPINGS = {
...
@@ -1533,6 +1549,7 @@ NODE_CLASS_MAPPINGS = {
"ImageScale"
:
ImageScale
,
"ImageScale"
:
ImageScale
,
"ImageScaleBy"
:
ImageScaleBy
,
"ImageScaleBy"
:
ImageScaleBy
,
"ImageInvert"
:
ImageInvert
,
"ImageInvert"
:
ImageInvert
,
"ImageBatch"
:
ImageBatch
,
"ImagePadForOutpaint"
:
ImagePadForOutpaint
,
"ImagePadForOutpaint"
:
ImagePadForOutpaint
,
"ConditioningAverage "
:
ConditioningAverage
,
"ConditioningAverage "
:
ConditioningAverage
,
"ConditioningCombine"
:
ConditioningCombine
,
"ConditioningCombine"
:
ConditioningCombine
,
...
@@ -1627,6 +1644,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
...
@@ -1627,6 +1644,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"ImageUpscaleWithModel"
:
"Upscale Image (using Model)"
,
"ImageUpscaleWithModel"
:
"Upscale Image (using Model)"
,
"ImageInvert"
:
"Invert Image"
,
"ImageInvert"
:
"Invert Image"
,
"ImagePadForOutpaint"
:
"Pad Image for Outpainting"
,
"ImagePadForOutpaint"
:
"Pad Image for Outpainting"
,
"ImageBatch"
:
"Batch Images"
,
# _for_testing
# _for_testing
"VAEDecodeTiled"
:
"VAE Decode (Tiled)"
,
"VAEDecodeTiled"
:
"VAE Decode (Tiled)"
,
"VAEEncodeTiled"
:
"VAE Encode (Tiled)"
,
"VAEEncodeTiled"
:
"VAE Encode (Tiled)"
,
...
...
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