Compare commits

...

25 Commits

Author SHA1 Message Date
kijai
b5d284744e Update hy3d_example_01.json
Latest Preview3D node
2025-02-20 12:39:20 +02:00
Jukka Seppänen
d72f2e9f3f
Merge pull request #71 from Easymode-ai/main
BPT node, seeded determinism, node sample count
2025-02-20 12:36:06 +02:00
Easymode
cc742005d7
Update nodes.py
Clear memory before starting BPT operation
2025-02-20 02:29:01 +00:00
Easymode
c7e0ab75e6
Update model.py 2025-02-20 01:34:24 +00:00
Easymode
2b44651d83
Added Node Progress Bar 2025-02-20 01:02:47 +00:00
Easymode
f5408c9493
Delete hy3dgen/shapegen/bpt/miche/michelangelo/models/tsal/__pycache__ directory 2025-02-20 00:10:41 +00:00
Easymode
9a7e743f56
Delete hy3dgen/shapegen/bpt/miche/michelangelo/models/modules/__pycache__ directory 2025-02-20 00:10:30 +00:00
Easymode
e34516b129
Delete hy3dgen/shapegen/bpt/miche/michelangelo/graphics/__pycache__ directory 2025-02-20 00:10:17 +00:00
Easymode
0ed1ff5348
Delete hy3dgen/shapegen/bpt/miche/michelangelo/models/__pycache__ directory 2025-02-20 00:10:07 +00:00
Easymode
b6c736a0b1
Delete hy3dgen/shapegen/bpt/miche/michelangelo/utils/__pycache__ directory 2025-02-20 00:09:46 +00:00
Easymode
06acd8ed9d
Update requirements.txt 2025-02-20 00:07:50 +00:00
Easymode
c403a8b910
Update requirements.txt 2025-02-19 23:55:43 +00:00
Easymode
6f872e80d9
Add files via upload 2025-02-19 23:20:33 +00:00
Easymode
d9aecb8e53
*Urgent* Fixed path 2025-02-19 23:13:08 +00:00
Easymode
8ac29d7647
BPT samples to 100k for best results 2025-02-19 19:04:38 +00:00
Easymode
c6bef17d4f
BPT samples added to node 2025-02-19 18:55:04 +00:00
Easymode
945400ea7e
BPT samples added to node 2025-02-19 18:54:30 +00:00
Easymode
74cfd26eda
BPT samples added to node 2025-02-19 18:54:03 +00:00
Easymode
3b543e82bc
BPT seed 2025-02-19 18:34:37 +00:00
Easymode
9cd19fd9e0
BPT seed 2025-02-19 18:34:13 +00:00
Easymode
738c302833
BPT seed 2025-02-19 18:33:53 +00:00
Easymode
2ff95dbd71
Updated BPT code 2025-02-19 17:18:06 +00:00
Easymode
d34f251c36
Updated BPT node 2025-02-19 17:16:35 +00:00
Easymode
f2cebadfa1
Merge branch 'kijai:main' into main 2025-02-19 16:54:42 +00:00
Easymode
ceb93eea69
Remove BPT batch size as it's per node 2025-02-19 16:54:27 +00:00
23 changed files with 285 additions and 212 deletions

View File

@ -1,6 +1,6 @@
{
"last_node_id": 152,
"last_link_id": 274,
"last_node_id": 156,
"last_link_id": 276,
"nodes": [
{
"id": 64,
@ -14,7 +14,7 @@
146
],
"flags": {},
"order": 26,
"order": 28,
"mode": 0,
"inputs": [
{
@ -30,8 +30,8 @@
{
"name": "mask",
"type": "MASK",
"link": 231,
"shape": 7
"shape": 7,
"link": 231
}
],
"outputs": [
@ -65,19 +65,19 @@
26
],
"flags": {},
"order": 30,
"order": 32,
"mode": 0,
"inputs": [
{
"name": "mesh",
"type": "HY3DMESH",
"name": "trimesh",
"type": "TRIMESH",
"link": 133
}
],
"outputs": [
{
"name": "mesh",
"type": "HY3DMESH",
"name": "trimesh",
"type": "TRIMESH",
"links": [
134
],
@ -101,7 +101,7 @@
375.8153991699219
],
"flags": {},
"order": 36,
"order": 38,
"mode": 0,
"inputs": [
{
@ -159,7 +159,7 @@
46
],
"flags": {},
"order": 45,
"order": 47,
"mode": 0,
"inputs": [
{
@ -175,8 +175,8 @@
],
"outputs": [
{
"name": "mesh",
"type": "HY3DMESH",
"name": "trimesh",
"type": "TRIMESH",
"links": [
163
],
@ -200,7 +200,7 @@
102
],
"flags": {},
"order": 44,
"order": 46,
"mode": 0,
"inputs": [
{
@ -245,7 +245,7 @@
523.9635620117188
],
"flags": {},
"order": 43,
"order": 45,
"mode": 0,
"inputs": [
{
@ -296,7 +296,7 @@
46
],
"flags": {},
"order": 39,
"order": 41,
"mode": 2,
"inputs": [
{
@ -336,7 +336,7 @@
"flags": {
"collapsed": true
},
"order": 14,
"order": 16,
"mode": 0,
"inputs": [
{
@ -372,7 +372,7 @@
375.8153991699219
],
"flags": {},
"order": 34,
"order": 36,
"mode": 0,
"inputs": [
{
@ -399,7 +399,7 @@
66
],
"flags": {},
"order": 40,
"order": 42,
"mode": 0,
"inputs": [
{
@ -415,8 +415,8 @@
{
"name": "camera_config",
"type": "HY3DCAMERA",
"link": 274,
"shape": 7
"shape": 7,
"link": 274
}
],
"outputs": [
@ -463,7 +463,7 @@
66
],
"flags": {},
"order": 42,
"order": 44,
"mode": 0,
"inputs": [
{
@ -523,7 +523,7 @@
26
],
"flags": {},
"order": 18,
"order": 20,
"mode": 0,
"inputs": [
{
@ -559,7 +559,7 @@
26
],
"flags": {},
"order": 24,
"order": 26,
"mode": 0,
"inputs": [
{
@ -628,7 +628,7 @@
246
],
"flags": {},
"order": 21,
"order": 23,
"mode": 0,
"inputs": [
{
@ -652,7 +652,7 @@
],
"size": [
372.8913269042969,
102
126
],
"flags": {},
"order": 3,
@ -661,8 +661,8 @@
{
"name": "compile_args",
"type": "HY3DCOMPILEARGS",
"link": null,
"shape": 7
"shape": 7,
"link": null
}
],
"outputs": [
@ -688,7 +688,8 @@
},
"widgets_values": [
"hy3dgen\\hunyuan3d-dit-v2-0-fp16.safetensors",
"sdpa"
"sdpa",
false
]
},
{
@ -700,15 +701,15 @@
],
"size": [
315.6768493652344,
82
106
],
"flags": {},
"order": 29,
"order": 31,
"mode": 0,
"inputs": [
{
"name": "mesh",
"type": "HY3DMESH",
"name": "trimesh",
"type": "TRIMESH",
"link": 86
}
],
@ -717,7 +718,7 @@
"name": "glb_path",
"type": "STRING",
"links": [
269
275
],
"slot_index": 0
}
@ -727,7 +728,8 @@
},
"widgets_values": [
"3D/Hy3D",
"glb"
"glb",
true
]
},
{
@ -742,25 +744,25 @@
174
],
"flags": {},
"order": 27,
"order": 29,
"mode": 0,
"inputs": [
{
"name": "mesh",
"type": "HY3DMESH",
"name": "trimesh",
"type": "TRIMESH",
"link": 251
},
{
"name": "mask",
"type": "MASK",
"link": null,
"shape": 7
"shape": 7,
"link": null
}
],
"outputs": [
{
"name": "mesh",
"type": "HY3DMESH",
"name": "trimesh",
"type": "TRIMESH",
"links": [
86,
133
@ -791,7 +793,7 @@
170
],
"flags": {},
"order": 23,
"order": 25,
"mode": 0,
"inputs": [
{
@ -807,8 +809,8 @@
{
"name": "mask",
"type": "MASK",
"link": 260,
"shape": 7
"shape": 7,
"link": 260
}
],
"outputs": [
@ -842,7 +844,7 @@
26
],
"flags": {},
"order": 19,
"order": 21,
"mode": 0,
"inputs": [
{
@ -879,7 +881,7 @@
46
],
"flags": {},
"order": 20,
"order": 22,
"mode": 0,
"inputs": [
{
@ -927,7 +929,7 @@
26
],
"flags": {},
"order": 22,
"order": 24,
"mode": 0,
"inputs": [
{
@ -964,7 +966,7 @@
218
],
"flags": {},
"order": 17,
"order": 19,
"mode": 0,
"inputs": [
{
@ -1058,8 +1060,8 @@
{
"name": "compile_args",
"type": "HY3DCOMPILEARGS",
"link": null,
"shape": 7
"shape": 7,
"link": null
}
],
"outputs": [
@ -1098,15 +1100,15 @@
{
"name": "INT",
"type": "INT",
"widget": {
"name": "width"
},
"links": [
262,
263,
264
],
"slot_index": 0,
"widget": {
"name": "width"
}
"slot_index": 0
}
],
"title": "Primitive: reference image size",
@ -1199,7 +1201,7 @@
562.7461547851562
],
"flags": {},
"order": 37,
"order": 39,
"mode": 0,
"inputs": [
{
@ -1227,7 +1229,7 @@
521.7835083007812
],
"flags": {},
"order": 41,
"order": 43,
"mode": 0,
"inputs": [
{
@ -1255,7 +1257,7 @@
520.6934204101562
],
"flags": {},
"order": 46,
"order": 48,
"mode": 0,
"inputs": [
{
@ -1280,15 +1282,15 @@
],
"size": [
315,
82
106
],
"flags": {},
"order": 47,
"order": 49,
"mode": 0,
"inputs": [
{
"name": "mesh",
"type": "HY3DMESH",
"name": "trimesh",
"type": "TRIMESH",
"link": 163
}
],
@ -1297,7 +1299,7 @@
"name": "glb_path",
"type": "STRING",
"links": [
270
276
],
"slot_index": 0
}
@ -1307,7 +1309,8 @@
},
"widgets_values": [
"3D/Hy3D_textured",
"glb"
"glb",
true
]
},
{
@ -1322,7 +1325,7 @@
270
],
"flags": {},
"order": 35,
"order": 37,
"mode": 0,
"inputs": [
{
@ -1348,28 +1351,28 @@
{
"name": "camera_config",
"type": "HY3DCAMERA",
"link": 273,
"shape": 7
"shape": 7,
"link": 273
},
{
"name": "scheduler",
"type": "NOISESCHEDULER",
"link": 267,
"shape": 7
"shape": 7,
"link": 267
},
{
"name": "view_size",
"type": "INT",
"link": 264,
"widget": {
"name": "view_size"
}
},
"link": 264
},
{
"name": "samples",
"type": "LATENT",
"link": null,
"shape": 7
"shape": 7,
"link": null
}
],
"outputs": [
@ -1407,7 +1410,7 @@
222
],
"flags": {},
"order": 28,
"order": 30,
"mode": 0,
"inputs": [
{
@ -1423,24 +1426,24 @@
{
"name": "scheduler",
"type": "NOISESCHEDULER",
"link": 265,
"shape": 7
"shape": 7,
"link": 265
},
{
"name": "width",
"type": "INT",
"link": 262,
"widget": {
"name": "width"
}
},
"link": 262
},
{
"name": "height",
"type": "INT",
"link": 263,
"widget": {
"name": "height"
}
},
"link": 263
}
],
"outputs": [
@ -1484,8 +1487,8 @@
{
"name": "compile_args",
"type": "HY3DCOMPILEARGS",
"link": null,
"shape": 7
"shape": 7,
"link": null
}
],
"outputs": [
@ -1518,7 +1521,7 @@
396.4273376464844
],
"flags": {},
"order": 31,
"order": 33,
"mode": 0,
"inputs": [
{
@ -1545,7 +1548,7 @@
82
],
"flags": {},
"order": 16,
"order": 18,
"mode": 0,
"inputs": [
{
@ -1571,43 +1574,6 @@
"default"
]
},
{
"id": 150,
"type": "Preview3D",
"pos": [
725.4800415039062,
-605.6441650390625
],
"size": [
929.393798828125,
1140.970947265625
],
"flags": {},
"order": 32,
"mode": 0,
"inputs": [
{
"name": "model_file",
"type": "STRING",
"link": 269,
"widget": {
"name": "model_file"
}
}
],
"outputs": [],
"properties": {
"Node name for S&R": "Preview3D"
},
"widgets_values": [
"",
"original",
10,
"original",
75,
null
]
},
{
"id": 13,
"type": "LoadImage",
@ -1659,7 +1625,7 @@
174
],
"flags": {},
"order": 25,
"order": 27,
"mode": 0,
"inputs": [
{
@ -1675,8 +1641,8 @@
],
"outputs": [
{
"name": "mesh",
"type": "HY3DMESH",
"name": "trimesh",
"type": "TRIMESH",
"links": [
251
],
@ -1694,43 +1660,6 @@
"mc"
]
},
{
"id": 151,
"type": "Preview3D",
"pos": [
4520,
640
],
"size": [
1110.3355712890625,
1471.956298828125
],
"flags": {},
"order": 48,
"mode": 0,
"inputs": [
{
"name": "model_file",
"type": "STRING",
"link": 270,
"widget": {
"name": "model_file"
}
}
],
"outputs": [],
"properties": {
"Node name for S&R": "Preview3D"
},
"widgets_values": [
"",
"original",
10,
"original",
75,
null
]
},
{
"id": 149,
"type": "Hy3DDiffusersSchedulerConfig",
@ -1743,7 +1672,7 @@
82
],
"flags": {},
"order": 15,
"order": 17,
"mode": 0,
"inputs": [
{
@ -1782,19 +1711,19 @@
170
],
"flags": {},
"order": 33,
"order": 35,
"mode": 0,
"inputs": [
{
"name": "mesh",
"type": "HY3DMESH",
"name": "trimesh",
"type": "TRIMESH",
"link": 134
},
{
"name": "camera_config",
"type": "HY3DCAMERA",
"link": 272,
"shape": 7
"shape": 7,
"link": 272
}
],
"outputs": [
@ -1850,7 +1779,7 @@
218
],
"flags": {},
"order": 38,
"order": 40,
"mode": 0,
"inputs": [
{
@ -1951,6 +1880,122 @@
1.45,
1.2
]
},
{
"id": 153,
"type": "Preview3D",
"pos": [
725.4800415039062,
-605.6441650390625
],
"size": [
899.2444458007812,
1024.1732177734375
],
"flags": {},
"order": 34,
"mode": 0,
"inputs": [
{
"name": "model_file",
"type": "STRING",
"widget": {
"name": "model_file"
},
"link": 275
}
],
"outputs": [],
"properties": {
"Node name for S&R": "Preview3D"
},
"widgets_values": [
"",
"original",
"original",
""
]
},
{
"id": 154,
"type": "Preview3D",
"pos": [
4520,
640
],
"size": [
977.4424438476562,
1298.644287109375
],
"flags": {},
"order": 50,
"mode": 0,
"inputs": [
{
"name": "model_file",
"type": "STRING",
"widget": {
"name": "model_file"
},
"link": 276
}
],
"outputs": [],
"properties": {
"Node name for S&R": "Preview3D"
},
"widgets_values": [
"",
"original",
"original",
""
]
},
{
"id": 155,
"type": "Note",
"pos": [
835.9649658203125,
-764.7407836914062
],
"size": [
317.4715270996094,
108.64700317382812
],
"flags": {},
"order": 14,
"mode": 0,
"inputs": [],
"outputs": [],
"properties": {},
"widgets_values": [
"If the Preview3D node doesn't work, right click on it and select \"fix node\" or re-create the whole node. It's part of ComfyUI and often gets updated causing mismatch with the version that's in the workflow."
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 156,
"type": "Note",
"pos": [
4580.03173828125,
445.3966064453125
],
"size": [
317.4715270996094,
108.64700317382812
],
"flags": {},
"order": 15,
"mode": 0,
"inputs": [],
"outputs": [],
"properties": {},
"widgets_values": [
"If the Preview3D node doesn't work, right click on it and select \"fix node\" or re-create the whole node. It's part of ComfyUI and often gets updated causing mismatch with the version that's in the workflow."
],
"color": "#432",
"bgcolor": "#653"
}
],
"links": [
@ -2386,22 +2431,6 @@
0,
"HY3DDIFFUSERSPIPE"
],
[
269,
17,
0,
150,
0,
"STRING"
],
[
270,
99,
0,
151,
0,
"STRING"
],
[
272,
61,
@ -2425,6 +2454,22 @@
92,
2,
"HY3DCAMERA"
],
[
275,
17,
0,
153,
0,
"STRING"
],
[
276,
99,
0,
154,
0,
"STRING"
]
],
"groups": [
@ -2484,15 +2529,15 @@
"config": {},
"extra": {
"ds": {
"scale": 0.5054470284993183,
"scale": 0.6115909044841759,
"offset": [
197.948937186443,
-188.3505800237151
-530.4836285148363,
269.1333328211381
]
},
"node_versions": {
"comfy-core": "0.3.13",
"ComfyUI-Hunyuan3DWrapper": "1b7c0606e21748eee1569b305c544ec04e4b5c00",
"comfy-core": "0.3.14",
"ComfyUI-Hunyuan3DWrapper": "d72f2e9f3fdb7907792df1a236853aff91abe6f2",
"ComfyUI_essentials": "76e9d1e4399bd025ce8b12c290753d58f9f53e93"
},
"VHS_latentpreview": true,

View File

@ -6,9 +6,12 @@ import torch
import torch.distributed as dist
import sys
sys.path.append(r"C:\Remade\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Hunyuan3DWrapper-main")
import os
custom_node_path = os.path.dirname(os.path.abspath(__file__))
custom_node_path = os.path.abspath(os.path.join(custom_node_path, "..", "..", "..", "..", "..",".."))
sys.path.append(custom_node_path)
from hy3dgen.shapegen.bpt.miche.michelangelo.models.tsal import asl_pl_module
#from hy3dgen.shapegen.bpt.miche.michelangelo.models.tsal import asl_pl_module
def get_obj_from_str(string, reload=False):
module, cls = string.rsplit(".", 1)
@ -26,6 +29,10 @@ def get_obj_from_config(config):
def instantiate_from_config(config, **kwargs):
print(" custom path :")
print(custom_node_path)
print("\n")
if "target" not in config:
raise KeyError("Expected key `target` to instantiate.")

View File

@ -18,6 +18,7 @@ from .miche_conditioner import PointConditioner
from functools import partial
from tqdm import tqdm
from .data_utils import discretize
from comfy.utils import ProgressBar
# helper functions
@ -182,6 +183,10 @@ class MeshTransformer(Module):
cache = None
eos_iter = None
# ✅ Initialize ComfyUI progress bar
pbar = ProgressBar(max_seq_len - curr_length)
# predict tokens auto-regressively
for i in tqdm(range(curr_length, max_seq_len), position=tqdm_position,
desc=f'Process: {tqdm_position}', dynamic_ncols=True, leave=False):
@ -207,6 +212,9 @@ class MeshTransformer(Module):
sample = torch.multinomial(probs, 1)
codes, _ = pack([codes, sample], 'b *')
# ComfyUI progress bar
pbar.update(1)
# Check if all sequences have encountered EOS at least once
is_eos_codes = (codes == self.eos_token_id)
if is_eos_codes.any(dim=-1).all():
@ -216,6 +224,9 @@ class MeshTransformer(Module):
# Once we've generated 20% more tokens than eos_iter, break out of the loop
if codes.shape[-1] >= int(eos_iter * 1.2):
break
# Ensure progress bar reaches 100% when loop completes
#pbar.complete()
# mask out to padding anything after the first eos

View File

@ -9,7 +9,7 @@ pytorch-warmup
torch_geometric
torchtyping
vector-quantize-pytorch>=1.12.8
x-transformers>=1.26.6
x-transformers==1.26.6
tqdm
matplotlib
wandb
@ -26,4 +26,7 @@ setuptools
pytorch_lightning
mesh2sdf
numpy
point-cloud-utils
point-cloud-utils
transformers==4.48.0
networkx==3.4.2
deepspeed==0.16.3

View File

@ -66,20 +66,23 @@ def apply_normalize(mesh):
def sample_pc(trimesh, pc_num, with_normal=False):
mesh = apply_normalize(trimesh)
def sample_pc(mesh, pc_num, with_normal=False, seed=1234, samples=50000):
mesh = apply_normalize(mesh)
if not with_normal:
points, _ = mesh.sample(pc_num, return_index=True)
return points
points, face_idx = mesh.sample(50000, return_index=True)
points, face_idx = trimesh.sample.sample_surface(mesh=mesh, count=samples, seed=seed)
#points, face_idx = mesh.sample(50000, return_index=True)
normals = mesh.face_normals[face_idx]
pc_normal = np.concatenate([points, normals], axis=-1, dtype=np.float16)
# random sample point cloud
np.random.seed(seed)
ind = np.random.choice(pc_normal.shape[0], pc_num, replace=False)
pc_normal = pc_normal[ind]
return pc_normal

View File

@ -158,13 +158,13 @@ def import_mesh(mesh: Union[pymeshlab.MeshSet, trimesh.Trimesh, Latent2MeshOutpu
return mesh
def bpt_remesh(self, mesh: trimesh.Trimesh, verbose: bool = False, with_normal: bool = True, temperature: float = 0.5, batch_size: int = 1):
def bpt_remesh(self, mesh: trimesh.Trimesh, verbose: bool = False, with_normal: bool = True, temperature: float = 0.5, batch_size: int = 1, pc_num: int = 4096, seed: int = 1234, samples: int = 50000):
from .bpt.model import data_utils
from .bpt.model.model import MeshTransformer
from .bpt.model.serializaiton import BPT_deserialize
from .bpt.utils import sample_pc, joint_filter
pc_normal = sample_pc(mesh, pc_num=8192, with_normal=with_normal)
pc_normal = sample_pc(mesh, pc_num=pc_num, with_normal=with_normal, seed=seed, samples=samples)
pc_normal = pc_normal[None, :, :] if len(pc_normal.shape) == 2 else pc_normal
@ -181,9 +181,7 @@ def bpt_remesh(self, mesh: trimesh.Trimesh, verbose: bool = False, with_normal:
model_path = os.path.join(comfyui_dir, 'bpt/bpt-8-16-500m.pt')
print(model_path)
model.load(model_path)
model = model.eval()
model = model.half()
model = model.cuda()
model = model.eval().cuda().half()
import torch
pc_tensor = torch.from_numpy(pc_normal).cuda().half()
@ -196,9 +194,9 @@ def bpt_remesh(self, mesh: trimesh.Trimesh, verbose: bool = False, with_normal:
filter_kwargs=dict(k=50, p=0.95),
return_codes=True,
temperature=temperature,
batch_size=batch_size
batch_size=batch_size,
)
coords = []
try:
for i in range(len(codes)):
@ -214,8 +212,7 @@ def bpt_remesh(self, mesh: trimesh.Trimesh, verbose: bool = False, with_normal:
except:
coords.append(np.zeros(3, 3))
# convert coordinates to mesh
vertices = coords[0]
vertices = coords[i]
faces = torch.arange(1, len(vertices) + 1).view(-1, 3)
# Move to CPU
@ -225,6 +222,7 @@ def bpt_remesh(self, mesh: trimesh.Trimesh, verbose: bool = False, with_normal:
return data_utils.to_mesh(vertices, faces, transpose=False, post_process=True)
class BptMesh:
def __call__(
self,
@ -232,9 +230,12 @@ class BptMesh:
temperature: float = 0.5,
batch_size: int = 1,
with_normal: bool = True,
verbose: bool = False
verbose: bool = False,
pc_num: int = 4096,
seed: int = 1234,
samples: int = 50000
) -> Union[pymeshlab.MeshSet, trimesh.Trimesh]:
mesh = bpt_remesh(self, mesh=mesh, temperature=temperature, batch_size=batch_size, with_normal=with_normal)
mesh = bpt_remesh(self, mesh=mesh, temperature=temperature, batch_size=batch_size, with_normal=with_normal, pc_num=pc_num, seed=seed, samples=samples)
return mesh
class FaceReducer:

View File

@ -1279,8 +1279,10 @@ class Hy3DBPT:
"required": {
"trimesh": ("TRIMESH",),
"enable_bpt": ("BOOLEAN", {"default": True}),
"seed": ("INT", {"default": 42, "min": 0, "max": 0xffffffffffffffff}),
"temperature": ("FLOAT", {"default": 0.5}),
"batch_size": ("INT", {"default": 1}),
"pc_num": ("INT", {"default": 4096, "min": 1024, "max": 8192, "step": 1024}),
"samples": ("INT", {"default": 100000})
},
}
@ -1290,12 +1292,13 @@ class Hy3DBPT:
CATEGORY = "Hunyuan3DWrapper"
DESCRIPTION = "BPT the mesh using bpt: https://github.com/whaohan/bpt"
def bpt(self, trimesh, enable_bpt, temperature, batch_size):
def bpt(self, trimesh, enable_bpt, temperature, pc_num, seed, samples):
mm.unload_all_models()
mm.soft_empty_cache()
new_mesh = trimesh.copy()
if enable_bpt:
from .hy3dgen.shapegen.postprocessors import BptMesh
new_mesh = BptMesh()(new_mesh, with_normal=True, temperature=temperature, batch_size=batch_size)
new_mesh = BptMesh()(new_mesh, with_normal=True, temperature=temperature, batch_size=1, pc_num=pc_num, verbose=False, seed=seed, samples=samples)
mm.unload_all_models()
mm.soft_empty_cache()