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
c00bb1a0
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "6028ed92bd9e5471e6f8a1d23cfd95a3a63018fb"
Commit
c00bb1a0
authored
May 23, 2023
by
comfyanonymous
Browse files
Add a latent upscale by node.
parent
b8ccbec6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
nodes.py
nodes.py
+21
-0
No files found.
nodes.py
View file @
c00bb1a0
...
@@ -768,6 +768,25 @@ class LatentUpscale:
...
@@ -768,6 +768,25 @@ class LatentUpscale:
s
[
"samples"
]
=
comfy
.
utils
.
common_upscale
(
samples
[
"samples"
],
width
//
8
,
height
//
8
,
upscale_method
,
crop
)
s
[
"samples"
]
=
comfy
.
utils
.
common_upscale
(
samples
[
"samples"
],
width
//
8
,
height
//
8
,
upscale_method
,
crop
)
return
(
s
,)
return
(
s
,)
class
LatentUpscaleBy
:
upscale_methods
=
[
"nearest-exact"
,
"bilinear"
,
"area"
,
"bislerp"
]
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"samples"
:
(
"LATENT"
,),
"upscale_method"
:
(
s
.
upscale_methods
,),
"scale_by"
:
(
"FLOAT"
,
{
"default"
:
1.5
,
"min"
:
0.01
,
"max"
:
8.0
,
"step"
:
0.01
}),}}
RETURN_TYPES
=
(
"LATENT"
,)
FUNCTION
=
"upscale"
CATEGORY
=
"latent"
def
upscale
(
self
,
samples
,
upscale_method
,
scale_by
):
s
=
samples
.
copy
()
width
=
round
(
samples
[
"samples"
].
shape
[
3
]
*
scale_by
)
height
=
round
(
samples
[
"samples"
].
shape
[
2
]
*
scale_by
)
s
[
"samples"
]
=
comfy
.
utils
.
common_upscale
(
samples
[
"samples"
],
width
,
height
,
upscale_method
,
"disabled"
)
return
(
s
,)
class
LatentRotate
:
class
LatentRotate
:
@
classmethod
@
classmethod
def
INPUT_TYPES
(
s
):
def
INPUT_TYPES
(
s
):
...
@@ -1244,6 +1263,7 @@ NODE_CLASS_MAPPINGS = {
...
@@ -1244,6 +1263,7 @@ NODE_CLASS_MAPPINGS = {
"VAELoader"
:
VAELoader
,
"VAELoader"
:
VAELoader
,
"EmptyLatentImage"
:
EmptyLatentImage
,
"EmptyLatentImage"
:
EmptyLatentImage
,
"LatentUpscale"
:
LatentUpscale
,
"LatentUpscale"
:
LatentUpscale
,
"LatentUpscaleBy"
:
LatentUpscaleBy
,
"LatentFromBatch"
:
LatentFromBatch
,
"LatentFromBatch"
:
LatentFromBatch
,
"RepeatLatentBatch"
:
RepeatLatentBatch
,
"RepeatLatentBatch"
:
RepeatLatentBatch
,
"SaveImage"
:
SaveImage
,
"SaveImage"
:
SaveImage
,
...
@@ -1322,6 +1342,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
...
@@ -1322,6 +1342,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"LatentCrop"
:
"Crop Latent"
,
"LatentCrop"
:
"Crop Latent"
,
"EmptyLatentImage"
:
"Empty Latent Image"
,
"EmptyLatentImage"
:
"Empty Latent Image"
,
"LatentUpscale"
:
"Upscale Latent"
,
"LatentUpscale"
:
"Upscale Latent"
,
"LatentUpscaleBy"
:
"Upscale Latent By"
,
"LatentComposite"
:
"Latent Composite"
,
"LatentComposite"
:
"Latent Composite"
,
"LatentFromBatch"
:
"Latent From Batch"
,
"LatentFromBatch"
:
"Latent From Batch"
,
"RepeatLatentBatch"
:
"Repeat Latent Batch"
,
"RepeatLatentBatch"
:
"Repeat Latent Batch"
,
...
...
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