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
871a76b7
Commit
871a76b7
authored
Apr 04, 2023
by
comfyanonymous
Browse files
Rename and reorganize post processing nodes.
parent
10ad4c1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
comfy_extras/nodes_post_processing.py
comfy_extras/nodes_post_processing.py
+8
-8
No files found.
comfy_extras/nodes_post_processing.py
View file @
871a76b7
...
...
@@ -29,7 +29,7 @@ class Blend:
RETURN_TYPES
=
(
"IMAGE"
,)
FUNCTION
=
"blend_images"
CATEGORY
=
"postprocessing"
CATEGORY
=
"
image/
postprocessing"
def
blend_images
(
self
,
image1
:
torch
.
Tensor
,
image2
:
torch
.
Tensor
,
blend_factor
:
float
,
blend_mode
:
str
):
if
image1
.
shape
!=
image2
.
shape
:
...
...
@@ -86,7 +86,7 @@ class Blur:
RETURN_TYPES
=
(
"IMAGE"
,)
FUNCTION
=
"blur"
CATEGORY
=
"postprocessing"
CATEGORY
=
"
image/
postprocessing"
def
gaussian_kernel
(
self
,
kernel_size
:
int
,
sigma
:
float
):
x
,
y
=
torch
.
meshgrid
(
torch
.
linspace
(
-
1
,
1
,
kernel_size
),
torch
.
linspace
(
-
1
,
1
,
kernel_size
),
indexing
=
"ij"
)
...
...
@@ -131,7 +131,7 @@ class Quantize:
RETURN_TYPES
=
(
"IMAGE"
,)
FUNCTION
=
"quantize"
CATEGORY
=
"postprocessing"
CATEGORY
=
"
image/
postprocessing"
def
quantize
(
self
,
image
:
torch
.
Tensor
,
colors
:
int
=
256
,
dither
:
str
=
"FLOYDSTEINBERG"
):
batch_size
,
height
,
width
,
_
=
image
.
shape
...
...
@@ -179,7 +179,7 @@ class Sharpen:
RETURN_TYPES
=
(
"IMAGE"
,)
FUNCTION
=
"sharpen"
CATEGORY
=
"postprocessing"
CATEGORY
=
"
image/
postprocessing"
def
sharpen
(
self
,
image
:
torch
.
Tensor
,
sharpen_radius
:
int
,
alpha
:
float
):
if
sharpen_radius
==
0
:
...
...
@@ -203,8 +203,8 @@ class Sharpen:
return
(
result
,)
NODE_CLASS_MAPPINGS
=
{
"Blend"
:
Blend
,
"Blur"
:
Blur
,
"Quantize"
:
Quantize
,
"Sharpen"
:
Sharpen
,
"
Image
Blend"
:
Blend
,
"
Image
Blur"
:
Blur
,
"
Image
Quantize"
:
Quantize
,
"
Image
Sharpen"
:
Sharpen
,
}
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