ComfyUI Node

BPT

The remesh pass that makes 3D meshes actually good

By Easymode-ai·Created about a year ago·Updated about a year ago· 12
BPT
  • trimesh
  • trimesh
enable_bpttrue
seed0
temperature0.50
pc_num4096
samples100000
enable_reduce_facestrue
target_num_faces50000

The BPT node is the whole point of ComfyUI-BPT. It takes a mesh - any TRIMESH - and runs it through Tencent's BPT remesher, the same enhancement pass that powers the tail end of the Hunyuan3D-2 pipeline. In plain terms: your source mesh goes in rough or sparse, and a cleaner, better-detailed one comes out.

BPT stands for the "Block-wise Point Transformer"-style model behind it (the weight file is literally named bpt-8-16-500m.pt - block size 8, offset 16, 500M params). If you've seen the acronym in kijai's ComfyUI-Hunyuan3DWrapper, it's the same thing; that wrapper is fully compatible with this pack, so you can treat the BPT node as the "polish" stage after a Hunyuan3D generation, or after loading a TRELLIS .glb. Community wisdom on it is pretty consistent: it adds detail and cleans up topology, and it matters most when your source mesh is rough - less so if you're already coming from the 2-mini-turbo models, which tend to produce dense, detailed meshes on their own.

How it works

The mechanism is neat and worth understanding before you tune it. The node:

  1. Samples the source mesh into a point cloud with normals - samples surface points, of which pc_num get kept.
  2. Feeds that point cloud into a 500M-parameter autoregressive transformer (MeshTransformer) running in fp16 on CUDA.
  3. The transformer generates the mesh as a token sequence (block-wise serialized vertex coordinates), which gets deserialized back into vertices and post-processed into a fresh Trimesh.

The model weight loads from ComfyUI/models/bpt/bpt-8-16-500m.pt, and the node unloads every other model from VRAM and empties the cache before and after - polite to your memory, mildly rude to whatever else you had loaded.

Inputs that matter

  • enable_bpt (BOOLEAN, default on) - flip it off to skip the neural net entirely and just get the face-reduction passthrough. Useful for A/B comparing what the model actually changed.
  • seed and temperature - the usual sampling knobs. Lower temperature (default 0.5) is more conservative; keep it there unless you're chasing variation.
  • pc_num (10248192, step 1024, default 4096) - how many condition points the model sees. More points = more input fidelity and slower runs. 4096 is a sane default.
  • samples (default 100000) - how many surface points get sampled to estimate normals before the pc_num selection. The author's own workflow uses 150000.
  • enable_reduce_faces (default on) and target_num_faces (default 50000) - if your mesh has more faces than the target, it gets decimated first (via pymeshlab's quadric edge collapse plus pyfqmr). The example workflow drops to 7000. Leave it on; BPT doesn't want to chew on a million-face mesh.

The single output is trimesh (TRIMESH) - wire it into Trimesh Save to keep it, or Trimesh Preview to look at it.

Installing and the model file

Pack install is standard. ComfyUI Manager: search "ComfyUI-BPT". Or:

cd ComfyUI/custom_nodes
git clone https://github.com/Easymode-ai/ComfyUI-BPT

Then the dependencies (heavy - deepspeed pinned at ==0.16.3, torch_geometric, x-transformers ==1.26.6, trimesh, mesh2sdf and more):

cd ComfyUI/custom_nodes/ComfyUI-BPT
..\..\..\python_embeded\python.exe -m pip install -r requirements.txt

The README warns this step is genuinely fiddly: several packages need Python 3.12 headers/libs, and on the portable install you may have to copy them from a local 3.12 Python into python_embeded. That's not hyperbole - expect to do it.

Then grab the weight and put it where the code looks for it:

ComfyUI/models/bpt/bpt-8-16-500m.pt   (from https://huggingface.co/whaohan/bpt)

Watch the folder name. The README says models\BPT\, but the code actually loads from models/bpt/ (lowercase). On Windows that doesn't matter - case-insensitive filesystem. On Linux or macOS it does, so use the lowercase folder or the model won't be found.

Troubleshooting

  • "BPT Model Path" printed, then a load error - the weight is missing or in the wrong place. Check models/bpt/bpt-8-16-500m.pt exactly.
  • ImportError: pymeshlab not found - real gap in the pack: pymeshlab is used for face reduction but isn't in requirements.txt. Install it yourself (pip install pymeshlab), or disable enable_reduce_faces if your mesh is already light.
  • pip build failures on deepspeed or torch_geometric - the Python 3.12 include/libs problem from the README. Copy the missing headers/libs from a working 3.12 install into python_embeded and retry.
  • Everything else in your workflow needs to reload after this node runs - expected, since it flushes all models from VRAM.

One last note: BPT is a Tencent Hunyuan project, so its weights and code carry Tencent's license terms (the model code is Apache-2.0, with Hunyuan components under Tencent's license). Fine for personal tinkering; skim the license if you plan to ship output commercially.

CategoryBPT

Inputs (8)

NameTypeDefaultDescription
trimeshTRIMESH
enable_bptBOOLEANtrue
seedINT00–268435455
temperatureFLOAT0.50
pc_numINT40961024–8192
samplesINT100000
enable_reduce_facesBOOLEANtrue
target_num_facesINT50000

Outputs (1)

NameTypeDescription
trimeshTRIMESH