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
3ae61a2b
Commit
3ae61a2b
authored
Feb 22, 2023
by
comfyanonymous
Browse files
Add a node to invert the colours of images.
Might be useful for controlnets.
parent
f04dc2c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
nodes.py
nodes.py
+17
-0
No files found.
nodes.py
View file @
3ae61a2b
...
@@ -727,6 +727,22 @@ class ImageScale:
...
@@ -727,6 +727,22 @@ class ImageScale:
s
=
s
.
movedim
(
1
,
-
1
)
s
=
s
.
movedim
(
1
,
-
1
)
return
(
s
,)
return
(
s
,)
class
ImageInvert
:
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"image"
:
(
"IMAGE"
,)}}
RETURN_TYPES
=
(
"IMAGE"
,)
FUNCTION
=
"invert"
CATEGORY
=
"image"
def
invert
(
self
,
image
):
s
=
1.0
-
image
return
(
s
,)
NODE_CLASS_MAPPINGS
=
{
NODE_CLASS_MAPPINGS
=
{
"KSampler"
:
KSampler
,
"KSampler"
:
KSampler
,
"CheckpointLoader"
:
CheckpointLoader
,
"CheckpointLoader"
:
CheckpointLoader
,
...
@@ -741,6 +757,7 @@ NODE_CLASS_MAPPINGS = {
...
@@ -741,6 +757,7 @@ NODE_CLASS_MAPPINGS = {
"LoadImage"
:
LoadImage
,
"LoadImage"
:
LoadImage
,
"LoadImageMask"
:
LoadImageMask
,
"LoadImageMask"
:
LoadImageMask
,
"ImageScale"
:
ImageScale
,
"ImageScale"
:
ImageScale
,
"ImageInvert"
:
ImageInvert
,
"ConditioningCombine"
:
ConditioningCombine
,
"ConditioningCombine"
:
ConditioningCombine
,
"ConditioningSetArea"
:
ConditioningSetArea
,
"ConditioningSetArea"
:
ConditioningSetArea
,
"KSamplerAdvanced"
:
KSamplerAdvanced
,
"KSamplerAdvanced"
:
KSamplerAdvanced
,
...
...
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