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
91965880
"tools/vscode:/vscode.git/clone" did not exist on "ea52f47a9549857c5284f9af905ef3c35714dc6b"
Unverified
Commit
91965880
authored
Aug 28, 2023
by
BVH
Committed by
GitHub
Aug 28, 2023
Browse files
Make tile size in Tiled VAE encode/decode user configurable
parent
0faee118
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
nodes.py
nodes.py
+10
-6
No files found.
nodes.py
View file @
91965880
...
...
@@ -244,14 +244,16 @@ class VAEDecode:
class
VAEDecodeTiled
:
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"samples"
:
(
"LATENT"
,
),
"vae"
:
(
"VAE"
,
)}}
return
{
"required"
:
{
"samples"
:
(
"LATENT"
,
),
"vae"
:
(
"VAE"
,
),
"tile_size"
:
(
"INT"
,
{
"default"
:
64
,
"min"
:
64
,
"max"
:
4096
,
"step"
:
64
})
}}
RETURN_TYPES
=
(
"IMAGE"
,)
FUNCTION
=
"decode"
CATEGORY
=
"_for_testing"
def
decode
(
self
,
vae
,
samples
):
return
(
vae
.
decode_tiled
(
samples
[
"samples"
]),
)
def
decode
(
self
,
vae
,
samples
,
tile_size
):
return
(
vae
.
decode_tiled
(
samples
[
"samples"
]
,
tile_x
=
tile_size
,
tile_y
=
tile_size
,
),
)
class
VAEEncode
:
@
classmethod
...
...
@@ -280,15 +282,17 @@ class VAEEncode:
class
VAEEncodeTiled
:
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"pixels"
:
(
"IMAGE"
,
),
"vae"
:
(
"VAE"
,
)}}
return
{
"required"
:
{
"pixels"
:
(
"IMAGE"
,
),
"vae"
:
(
"VAE"
,
),
"tile_size"
:
(
"INT"
,
{
"default"
:
512
,
"min"
:
512
,
"max"
:
4096
,
"step"
:
64
})
}}
RETURN_TYPES
=
(
"LATENT"
,)
FUNCTION
=
"encode"
CATEGORY
=
"_for_testing"
def
encode
(
self
,
vae
,
pixels
):
def
encode
(
self
,
vae
,
pixels
,
tile_size
):
pixels
=
VAEEncode
.
vae_encode_crop_pixels
(
pixels
)
t
=
vae
.
encode_tiled
(
pixels
[:,:,:,:
3
])
t
=
vae
.
encode_tiled
(
pixels
[:,:,:,:
3
]
,
tile_x
=
tile_size
,
tile_y
=
tile_size
,
)
return
({
"samples"
:
t
},
)
class
VAEEncodeForInpaint
:
...
...
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