The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Fix some more video tiled encode issues.
comfyanonymouscac68ca81392
diff --git a/comfy/sd.py b/comfy/sd.pyindex 85393ef0d..b5cf296c8 100644--- a/comfy/sd.py+++ b/comfy/sd.py@@ -12,6 +12,7 @@ from .ldm.audio.autoencoder import AudioOobleckVAEimport comfy.ldm.genmo.vae.modelimport comfy.ldm.lightricks.vae.causal_video_autoencoderimport yaml+import mathimport comfy.utils@@ -336,7 +337,7 @@ class VAE:self.memory_used_decode = lambda shape, dtype: (1000 * shape[2] * shape[3] * shape[4] * (6 * 8 * 8)) * model_management.dtype_size(dtype)self.memory_used_encode = lambda shape, dtype: (1.5 * max(shape[2], 7) * shape[3] * shape[4] * (6 * 8 * 8)) * model_management.dtype_size(dtype)self.upscale_ratio = (lambda a: max(0, a * 6 - 5), 8, 8)- self.downscale_ratio = (lambda a: max(0, (a + 3) / 6), 8, 8)+ self.downscale_ratio = (lambda a: max(0, math.floor((a + 5) / 6)), 8, 8)self.working_dtypes = [torch.float16, torch.float32]elif "decoder.up_blocks.0.res_blocks.0.conv1.conv.weight" in sd: #lightricks ltxvself.first_stage_model = comfy.ldm.lightricks.vae.causal_video_autoencoder.VideoVAE()@@ -345,14 +346,14 @@ class VAE:self.memory_used_decode = lambda shape, dtype: (900 * shape[2] * shape[3] * shape[4] * (8 * 8 * 8)) * model_management.dtype_size(dtype)self.memory_used_encode = lambda shape, dtype: (70 * max(shape[2], 7) * shape[3] * shape[4]) * model_management.dtype_size(dtype)self.upscale_ratio = (lambda a: max(0, a * 8 - 7), 32, 32)- self.downscale_ratio = (lambda a: max(0, (a + 4) / 8), 32, 32)+ self.downscale_ratio = (lambda a: max(0, math.floor((a + 7) / 8)), 32, 32)self.working_dtypes = [torch.bfloat16, torch.float32]elif "decoder.conv_in.conv.weight" in sd:ddconfig = {'double_z': True, 'z_channels': 4, 'resolution': 256, 'in_channels': 3, 'out_ch': 3, 'ch': 128, 'ch_mult': [1, 2, 4, 4], 'num_res_blocks': 2, 'attn_resolutions': [], 'dropout': 0.0}ddconfig["conv3d"] = Trueddconfig["time_compress"] = 4self.upscale_ratio = (lambda a: max(0, a * 4 - 3), 8, 8)- self.downscale_ratio = (lambda a: max(0, (a + 2) / 4), 8, 8)+ self.downscale_ratio = (lambda a: max(0, math.floor((a + 3) / 4)), 8, 8)self.latent_dim = 3self.latent_channels = ddconfig['z_channels'] = sd["decoder.conv_in.conv.weight"].shape[1]self.first_stage_model = AutoencoderKL(ddconfig=ddconfig, embed_dim=sd['post_quant_conv.weight'].shape[1])