From 5d2548822c4519b8fb22b454c15114f7ba0ea26d Mon Sep 17 00:00:00 2001 From: Yousef Rafat <81116377+yousef-rafat@users.noreply.github.com> Date: Fri, 20 Mar 2026 02:36:01 +0200 Subject: [PATCH] . --- comfy/ldm/trellis2/model.py | 1 + comfy_extras/nodes_trellis2.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/comfy/ldm/trellis2/model.py b/comfy/ldm/trellis2/model.py index 651d516b6..7a3e387c3 100644 --- a/comfy/ldm/trellis2/model.py +++ b/comfy/ldm/trellis2/model.py @@ -756,6 +756,7 @@ class Trellis2(nn.Module): self.img2shape = SLatFlowModel(resolution=resolution, in_channels=in_channels, **args) if init_txt_model: self.shape2txt = SLatFlowModel(resolution=resolution, in_channels=in_channels*2, **args) + self.img2shape_512 = SLatFlowModel(resolution=32, in_channels=in_channels, **args) args.pop("out_channels") self.structure_model = SparseStructureFlowModel(resolution=16, in_channels=8, out_channels=8, **args) self.guidance_interval = [0.6, 1.0] diff --git a/comfy_extras/nodes_trellis2.py b/comfy_extras/nodes_trellis2.py index 86f08f8bd..409d2d23c 100644 --- a/comfy_extras/nodes_trellis2.py +++ b/comfy_extras/nodes_trellis2.py @@ -54,7 +54,7 @@ class VaeDecodeShapeTrellis(IO.ComfyNode): inputs=[ IO.Latent.Input("samples"), IO.Vae.Input("vae"), - IO.Combo.Input("resolution", options=["512", "1024"], default="512") + IO.Combo.Input("resolution", options=["512", "1024"], default="1024") ], outputs=[ IO.Mesh.Output("mesh"), @@ -116,7 +116,7 @@ class VaeDecodeTextureTrellis(IO.ComfyNode): samples = SparseTensor(feats = samples, coords=coords) samples = samples * std + mean - mesh = vae.decode_tex_slat(samples, shape_subs) + mesh = vae.decode_tex_slat(samples, shape_subs) * 0.5 + 0.5 faces = torch.stack([m.faces for m in mesh]) verts = torch.stack([m.vertices for m in mesh]) mesh = Types.MESH(vertices=verts, faces=faces) @@ -541,7 +541,7 @@ def fill_holes_fn(vertices, faces, max_perimeter=0.03): new_verts.append(loop_v.mean(dim=0)) for i in range(len(loop)): - new_faces.append([loop[i], loop[(i + 1) % len(loop)], v_idx]) + new_faces.append([loop[(i + 1) % len(loop)], loop[i], v_idx]) v_idx += 1 if new_verts: