mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-15 04:52:31 +08:00
fixed color addition
This commit is contained in:
parent
d2c37c222a
commit
22dcd81fb3
@ -782,7 +782,7 @@ class Trellis2(nn.Module):
|
||||
mode = "structure_generation"
|
||||
not_struct_mode = False
|
||||
|
||||
if is_1024 and mode == "shape_generation" and not is_512_run:
|
||||
if is_1024 and not_struct_mode and not is_512_run:
|
||||
context = embeds
|
||||
|
||||
sigmas = transformer_options.get("sigmas")[0].item()
|
||||
@ -825,7 +825,6 @@ class Trellis2(nn.Module):
|
||||
x_st = SparseTensor(feats=feats_flat, coords=batched_coords.to(torch.int32))
|
||||
|
||||
if mode == "shape_generation":
|
||||
# TODO
|
||||
if is_512_run:
|
||||
out = self.img2shape_512(x_st, t_eval, c_eval)
|
||||
else:
|
||||
|
||||
@ -591,6 +591,9 @@ def save_glb(vertices, faces, filepath, metadata=None, colors=None):
|
||||
gltf["bufferViews"].append({"buffer": 0, "byteOffset": colors_byte_offset, "byteLength": colors_byte_length, "target": 34962})
|
||||
gltf["accessors"].append({"bufferView": 2, "byteOffset": 0, "componentType": 5126, "count": len(colors_np), "type": "VEC3"})
|
||||
gltf["meshes"][0]["primitives"][0]["attributes"]["COLOR_0"] = 2
|
||||
# Define a base material so Three.js actually activates vertex coloring
|
||||
gltf["materials"] =[{"pbrMetallicRoughness": {"baseColorFactor": [1.0, 1.0, 1.0, 1.0]}}]
|
||||
gltf["meshes"][0]["primitives"][0]["material"] = 0
|
||||
|
||||
if metadata is not None:
|
||||
gltf["asset"]["extras"] = metadata
|
||||
|
||||
@ -53,6 +53,7 @@ def paint_mesh_with_voxels(mesh, voxel_coords, voxel_colors, resolution):
|
||||
device = comfy.model_management.vae_offload_device()
|
||||
|
||||
origin = torch.tensor([-0.5, -0.5, -0.5], device=device)
|
||||
# TODO: generic independent node? if so: figure how pass the resolution parameter
|
||||
voxel_size = 1.0 / resolution
|
||||
|
||||
# map voxels
|
||||
|
||||
Loading…
Reference in New Issue
Block a user