mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-02 21:47:10 +08:00
Add ForceTiledVAEEncode node
This commit is contained in:
parent
779bbdf942
commit
deb49403c6
20
nodes.py
20
nodes.py
@ -356,6 +356,24 @@ class VAEEncodeTiled:
|
|||||||
t = vae.encode_tiled(pixels[:,:,:,:3], tile_x=tile_size, tile_y=tile_size, overlap=overlap, tile_t=temporal_size, overlap_t=temporal_overlap)
|
t = vae.encode_tiled(pixels[:,:,:,:3], tile_x=tile_size, tile_y=tile_size, overlap=overlap, tile_t=temporal_size, overlap_t=temporal_overlap)
|
||||||
return ({"samples": t}, )
|
return ({"samples": t}, )
|
||||||
|
|
||||||
|
class ForceTiledVAEEncode:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(s):
|
||||||
|
return {"required": {"vae": ("VAE", ),
|
||||||
|
"tile_size": ("INT", {"default": 256, "min": 64, "max": 4096, "step": 32}),
|
||||||
|
"overlap": ("INT", {"default": 64, "min": 0, "max": 4096, "step": 32}),
|
||||||
|
"temporal_size": ("INT", {"default": 64, "min": 8, "max": 4096, "step": 4, "tooltip": "Only used for video VAEs: Amount of frames to encode at a time."}),
|
||||||
|
"temporal_overlap": ("INT", {"default": 8, "min": 4, "max": 4096, "step": 4, "tooltip": "Only used for video VAEs: Amount of frames to overlap."}),
|
||||||
|
}}
|
||||||
|
RETURN_TYPES = ("VAE",)
|
||||||
|
FUNCTION = "cast"
|
||||||
|
|
||||||
|
CATEGORY = "_for_testing"
|
||||||
|
|
||||||
|
def cast(self, vae, tile_size, overlap, temporal_size=64, temporal_overlap=8):
|
||||||
|
tiled_vae = comfy.sd.ForcedTiledVAE.cast(vae, tile_size, overlap, temporal_size, temporal_overlap)
|
||||||
|
return (tiled_vae, )
|
||||||
|
|
||||||
class VAEEncodeForInpaint:
|
class VAEEncodeForInpaint:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
@ -1988,6 +2006,7 @@ NODE_CLASS_MAPPINGS = {
|
|||||||
"CLIPVisionLoader": CLIPVisionLoader,
|
"CLIPVisionLoader": CLIPVisionLoader,
|
||||||
"VAEDecodeTiled": VAEDecodeTiled,
|
"VAEDecodeTiled": VAEDecodeTiled,
|
||||||
"VAEEncodeTiled": VAEEncodeTiled,
|
"VAEEncodeTiled": VAEEncodeTiled,
|
||||||
|
"ForceTiledVAEEncode": ForceTiledVAEEncode,
|
||||||
"unCLIPCheckpointLoader": unCLIPCheckpointLoader,
|
"unCLIPCheckpointLoader": unCLIPCheckpointLoader,
|
||||||
"GLIGENLoader": GLIGENLoader,
|
"GLIGENLoader": GLIGENLoader,
|
||||||
"GLIGENTextBoxApply": GLIGENTextBoxApply,
|
"GLIGENTextBoxApply": GLIGENTextBoxApply,
|
||||||
@ -2071,6 +2090,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
|||||||
# _for_testing
|
# _for_testing
|
||||||
"VAEDecodeTiled": "VAE Decode (Tiled)",
|
"VAEDecodeTiled": "VAE Decode (Tiled)",
|
||||||
"VAEEncodeTiled": "VAE Encode (Tiled)",
|
"VAEEncodeTiled": "VAE Encode (Tiled)",
|
||||||
|
"ForceTiledVAEEncode": "Force tiled VAE Encode",
|
||||||
}
|
}
|
||||||
|
|
||||||
EXTENSION_WEB_DIRS = {}
|
EXTENSION_WEB_DIRS = {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user