ComfyUI の EmptyLatentImage と EmptySD3LatentImage の違い
カテゴリ:deeplearning
EmptyLatentImage は nodes.py にある。SD1.5 や SDXL 用の Latent で、実装は
latent = torch.zeros([batch_size, 4, height // 8, width // 8], device=self.device)
EmptySD3LatentImage は comfy_extras/nodes_sd3.py にある。SD3 用の Latent で、実装は
latent = torch.zeros([batch_size, 16, height // 8, width // 8], device=comfy.model_management.intermediate_device())
なぜ EmptyLatentImage と EmptySD3LatentImage を混同しても機能するのか?
comfy/sample.py の fix_empty_latent_channels が latent の channel 次元の修正をしている。これは latent が empty かつ VAE の解像度の圧縮率が同じ場合のみ機能する。
これは解像度の圧縮率が8倍で共通だから機能する。SANA や HunyuanImage-2.1 のように 32 倍圧縮の VAE を使用している場合は、解像度の修正も必要になる。