Skip to content

Fix ImportError with newer Kornia versions (missing pad import) #541

Description

With recent versions of kornia, the following import fails:

from kornia.geometry.transform.pyramid import pad

This prevents the entire node package from loading:

ImportError: cannot import name 'pad' from 'kornia.geometry.transform.pyramid'

A simple fix is:

 import torch.nn.functional as F
+pad = F.pad

 from kornia.geometry.transform.pyramid import (
     PyrUp,
     build_laplacian_pyramid,
     build_pyramid,
     find_next_powerof_two,
     is_powerof_two,
-    pad,
 )

After this change the nodes load correctly with current Kornia versions.

Environment:

  • Linux (Arch)
  • Python 3.14
  • Latest ComfyUI
  • Latest ComfyUI-LTXVideo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions