From 06661522d9fd884939edd2ab297e4c1f90bc2893 Mon Sep 17 00:00:00 2001 From: John Pollock Date: Mon, 20 Apr 2026 14:35:08 -0500 Subject: [PATCH 1/3] fix: issue 88 texture path resolution and gpu-only host conversion --- comfy_extras/nodes_trellis2.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/comfy_extras/nodes_trellis2.py b/comfy_extras/nodes_trellis2.py index 8121e261b..e00444f8c 100644 --- a/comfy_extras/nodes_trellis2.py +++ b/comfy_extras/nodes_trellis2.py @@ -111,8 +111,8 @@ def paint_mesh_with_voxels(mesh, voxel_coords, voxel_colors, resolution): verts = mesh.vertices.to(device).squeeze(0) voxel_colors = voxel_colors.to(device) - voxel_pos_np = voxel_pos.numpy() - verts_np = verts.numpy() + voxel_pos_np = voxel_pos.cpu().numpy() + verts_np = verts.cpu().numpy() tree = scipy.spatial.cKDTree(voxel_pos_np) @@ -194,6 +194,7 @@ class VaeDecodeTextureTrellis(IO.ComfyNode): IO.Latent.Input("samples"), IO.Vae.Input("vae"), IO.AnyType.Input("shape_subs"), + IO.Combo.Input("resolution", options=["512", "1024"], default="1024") ], outputs=[ IO.Mesh.Output("mesh"), @@ -201,9 +202,9 @@ class VaeDecodeTextureTrellis(IO.ComfyNode): ) @classmethod - def execute(cls, shape_mesh, samples, vae, shape_subs): + def execute(cls, shape_mesh, samples, vae, shape_subs, resolution): - resolution = 1024 + resolution = int(resolution) patcher = vae.patcher device = comfy.model_management.get_torch_device() comfy.model_management.load_model_gpu(patcher) From 7b95f7c4b05414d60e893c40a3f9d2b5b9e58732 Mon Sep 17 00:00:00 2001 From: John Pollock Date: Mon, 20 Apr 2026 14:39:15 -0500 Subject: [PATCH 2/3] fix: issue 88 unify texture paint color path on host --- comfy_extras/nodes_trellis2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy_extras/nodes_trellis2.py b/comfy_extras/nodes_trellis2.py index e00444f8c..6651ea72a 100644 --- a/comfy_extras/nodes_trellis2.py +++ b/comfy_extras/nodes_trellis2.py @@ -109,7 +109,7 @@ def paint_mesh_with_voxels(mesh, voxel_coords, voxel_colors, resolution): # map voxels voxel_pos = voxel_coords.to(device).float() * voxel_size + origin verts = mesh.vertices.to(device).squeeze(0) - voxel_colors = voxel_colors.to(device) + voxel_colors = voxel_colors.cpu() voxel_pos_np = voxel_pos.cpu().numpy() verts_np = verts.cpu().numpy() From 55997759d837d97a9f8c861693c60d41b8ccea9c Mon Sep 17 00:00:00 2001 From: John Pollock Date: Mon, 20 Apr 2026 14:44:45 -0500 Subject: [PATCH 3/3] fix: issue 88 make texture voxel query deterministic --- comfy_extras/nodes_trellis2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy_extras/nodes_trellis2.py b/comfy_extras/nodes_trellis2.py index 6651ea72a..fe09ec7b9 100644 --- a/comfy_extras/nodes_trellis2.py +++ b/comfy_extras/nodes_trellis2.py @@ -117,7 +117,7 @@ def paint_mesh_with_voxels(mesh, voxel_coords, voxel_colors, resolution): tree = scipy.spatial.cKDTree(voxel_pos_np) # nearest neighbour k=1 - _, nearest_idx_np = tree.query(verts_np, k=1, workers=-1) + _, nearest_idx_np = tree.query(verts_np, k=1, workers=1) nearest_idx = torch.from_numpy(nearest_idx_np).long() v_colors = voxel_colors[nearest_idx]