mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-09 08:42:30 +08:00
sd/ltx: Make chunked_io a flag in its own right
Taking this bi-direcitonal, so make it a for-purpose named flag.
This commit is contained in:
parent
793386d754
commit
d0db3bb104
@ -1122,6 +1122,8 @@ class processor(nn.Module):
|
|||||||
return (x - self.get_buffer("mean-of-means").view(1, -1, 1, 1, 1).to(x)) / self.get_buffer("std-of-means").view(1, -1, 1, 1, 1).to(x)
|
return (x - self.get_buffer("mean-of-means").view(1, -1, 1, 1, 1).to(x)) / self.get_buffer("std-of-means").view(1, -1, 1, 1, 1).to(x)
|
||||||
|
|
||||||
class VideoVAE(nn.Module):
|
class VideoVAE(nn.Module):
|
||||||
|
comfy_has_chunked_io = True
|
||||||
|
|
||||||
def __init__(self, version=0, config=None):
|
def __init__(self, version=0, config=None):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
|
|||||||
@ -953,7 +953,7 @@ class VAE:
|
|||||||
|
|
||||||
# Pre-allocate output for VAEs that support direct buffer writes
|
# Pre-allocate output for VAEs that support direct buffer writes
|
||||||
preallocated = False
|
preallocated = False
|
||||||
if hasattr(self.first_stage_model, 'decode_output_shape'):
|
if getattr(self.first_stage_model, 'comfy_has_chunked_io', False):
|
||||||
pixel_samples = torch.empty(self.first_stage_model.decode_output_shape(samples_in.shape), device=self.output_device, dtype=self.vae_output_dtype())
|
pixel_samples = torch.empty(self.first_stage_model.decode_output_shape(samples_in.shape), device=self.output_device, dtype=self.vae_output_dtype())
|
||||||
preallocated = True
|
preallocated = True
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user