diff --git a/nodes/comfy-env.toml b/nodes/comfy-env.toml index c8275de..b5a2de3 100644 --- a/nodes/comfy-env.toml +++ b/nodes/comfy-env.toml @@ -1,6 +1,4 @@ [pypi-dependencies] -numpy = ">=1.21.0" -pillow = ">=9.0.0" plyfile = "*" pillow-heif = ">=0.10.0" huggingface_hub = ">=0.16.0" diff --git a/nodes/merge_gaussians.py b/nodes/merge_gaussians.py index af8fe87..328e790 100644 --- a/nodes/merge_gaussians.py +++ b/nodes/merge_gaussians.py @@ -10,7 +10,6 @@ from pathlib import Path import numpy as np import torch -from plyfile import PlyData, PlyElement from comfy_api.latest import io @@ -22,6 +21,7 @@ def load_ply_simple(path: str) -> dict: Returns dict with arrays: positions, colors, scales, rotations, opacities """ + from plyfile import PlyData plydata = PlyData.read(path) vertex = plydata['vertex'] @@ -102,6 +102,7 @@ def save_merged_ply( elements['rot_2'] = rotations[:, 2] elements['rot_3'] = rotations[:, 3] + from plyfile import PlyData, PlyElement el = PlyElement.describe(elements, 'vertex') PlyData([el]).write(output_path) diff --git a/nodes/sharp/gaussians.py b/nodes/sharp/gaussians.py index 4b1f258..719c20c 100644 --- a/nodes/sharp/gaussians.py +++ b/nodes/sharp/gaussians.py @@ -12,7 +12,6 @@ from typing import Any, Literal, NamedTuple import numpy as np import torch -from plyfile import PlyData from . import color_space as cs_utils from . import linalg @@ -208,6 +207,7 @@ def convert_rgb_to_spherical_harmonics(rgb: torch.Tensor) -> torch.Tensor: def load_ply(path: Path) -> tuple[Gaussians3D, SceneMetaData]: """Loads a ply from a file.""" + from plyfile import PlyData plydata = PlyData.read(path) vertices = next(filter(lambda x: x.name == "vertex", plydata.elements)) diff --git a/pyproject.toml b/pyproject.toml index 1beabad..1cf04a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-sharp" description = "ComfyUI wrapper around Apple's latest SHARP model (ml-sharp). Monocular 3D Gaussian Splatting in under 1 second. Generate 3D Gaussians from a single image using Apple's SHARP model." -version = "0.1.1" +version = "0.1.2" license = {file = "LICENSE"}