ComfyUI-3D-Pack icon indicating copy to clipboard operation
ComfyUI-3D-Pack copied to clipboard

name 'meshVerticeInpaint' is not defined

Open PrometheusDante opened this issue 1 month ago • 2 comments

Hey there, trying to get the example workflow to run. I'm using a separate ComfyUI, fresh install, torch2.7, cu128, python 3.12

Image

PrometheusDante avatar Nov 23 '25 02:11 PrometheusDante

@PrometheusDante

Hi, this means the wheel wasn’t installed correctly.

Please go to the following folder: ComfyUI-3D-Pack/Gen_3D_Modules/Hunyuan3D_2_1/hy3dpaint/DifferentiableRenderer

Then run the appropriate script depending on your OS:

  • compile_mesh_painter.bat (Windows)
  • compile_mesh_painter.sh (Linux / macOS)

This will build the required library.

DenisKochetov avatar Nov 24 '25 04:11 DenisKochetov

Hey there, thank you for your help. Unfortunately I got the following error when running the compile_mesh_painter.bat :

D:\VER_13_AI\ComfyUI_windows_portable_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_2_1\hy3dpaint\DifferentiableRenderer>cl /O2 /LD /EHsc /MD mesh_inpaint_processor.cpp /link /OUT: /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\lib\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64" Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30159 for x64 Copyright (C) Microsoft Corporation. All rights reserved.

mesh_inpaint_processor.cpp mesh_inpaint_processor.cpp(1): fatal error C1083: Cannot open include file: 'pybind11/numpy.h': No such file or directory

However I can confirm, that I have the numpy.h file under this path "D:\VER_13\_AI\ComfyUI_windows_portable_3D\python_embeded\Lib\site-packages\pybind11\include\pybind11\numpy.h"

Could my Visual Studio installation be missing some necessary extension for the building process?

Image

PrometheusDante avatar Nov 24 '25 13:11 PrometheusDante

Open Developer Command Prompt for VS 2019 (Start Menu → type Developer Command Prompt for VS 2019)

Go to:

ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_2_1\hy3dpaint\DifferentiableRenderer

Run:

compile_mesh_painter_auto_2019.bat

The script will automatically:

  • locate your python_embeded
  • locate the pybind11/include directory
  • pass the correct /I include path to MSVC
  • compile mesh_inpaint_processor.pyd

I’ve attached the batch file, change the extension to .bat.

compile_mesh_painter_auto_2019.txt

DenisKochetov avatar Nov 25 '25 09:11 DenisKochetov

I placed the compile_mesh_painter_auto_2019.bat in

"D:\VER_13_AI\ComfyUI_windows_portable_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_2_1\hy3dpaint\DifferentiableRenderer"

Then I opened Developer Command Prompt for VS 2019 and ran:

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools>D:\VER_13\_AI\ComfyUI_windows_portable_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_2_1\hy3dpaint\DifferentiableRenderer\compile_mesh_painter_auto_2019.bat

This is the result:


Auto-detecting python_embeded and pybind11 include path...

[ERROR] python_embeded folder not found. Run this script inside your ComfyUI portable directory.

PrometheusDante avatar Nov 25 '25 10:11 PrometheusDante

@PrometheusDante Open Developer Command Prompt for VS 2019, then run:

cd /d D:\VER_13_AI\ComfyUI_windows_portable_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_2_1\hy3dpaint\DifferentiableRenderer
compile_mesh_painter_auto_2019.bat

you need to run this file while being in that folder

DenisKochetov avatar Nov 25 '25 11:11 DenisKochetov

Unfortunately ended with the same result:

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools>cd /d D:\VER_13_AI\ComfyUI_windows_portable_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_2_1\hy3dpaint\DifferentiableRenderer

D:\VER_13_AI\ComfyUI_windows_portable_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_2_1\hy3dpaint\DifferentiableRenderer>compile_mesh_painter_auto_2019.bat

Auto-detecting python_embeded and pybind11 include path...

[ERROR] python_embeded folder not found. Run this script inside your ComfyUI portable directory.

It's right there: "D:\VER_13_AI\ComfyUI_windows_portable_3D\python_embeded\python.exe"

PrometheusDante avatar Nov 25 '25 11:11 PrometheusDante

@PrometheusDante The script is searching upward from the current folder, but your path contains:

VER_13_AI
VER_13\_AI

(one has an extra underscore), so the auto-detect logic never reaches the actual folder.

Your real Python path is:

D:\VER_13_AI\ComfyUI_windows_portable_3D\python_embeded

but the script is looking under:

D:\VER_13\_AI\

To fix it, please make sure your ComfyUI folder name is consistent — remove the extra underscore so the path becomes:

D:\VER_13_AI\...

After that, run:

cd /d D:\VER_13_AI\ComfyUI_windows_portable_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_2_1\hy3dpaint\DifferentiableRenderer
compile_mesh_painter_auto_2019.bat

Then the script will find:

python_embeded\
  Lib\site-packages\pybind11\include\pybind11\numpy.h

DenisKochetov avatar Nov 26 '25 04:11 DenisKochetov

This is literally just github interpreting \_ as an underscore outside of code fences 😄 I can guarantee the path is as follows D:\VER_13\_AI\ComfyUI_windows_portable_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_2_1\hy3dpaint\DifferentiableRenderer

Image

PrometheusDante avatar Nov 26 '25 05:11 PrometheusDante

@PrometheusDante the script can't find your python_embeded folder because of how Windows batch handles directory matching update your .bat with this:

@echo off
setlocal enabledelayedexpansion

set ROOT=%cd%

echo Auto-detecting python_embeded ...

for /d /r "%ROOT%" %%a in (*) do (
    if /I "%%~nxa"=="python_embeded" (
        set PYTHON_EMBED=%%a
        goto found_python
    )
)

echo [ERROR] python_embeded folder not found.
exit /b 1

:found_python
echo Found python_embeded:
echo     %PYTHON_EMBED%

set PB11_INCLUDE=%PYTHON_EMBED%\Lib\site-packages\pybind11\include

cl /O2 /LD /EHsc /MD /I"%PB11_INCLUDE%" mesh_inpaint_processor.cpp ^
 /link /OUT:mesh_inpaint_processor.pyd ^
 /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\lib\x64" ^
 /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64" ^
 /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64"

echo Done.
pause

DenisKochetov avatar Nov 26 '25 10:11 DenisKochetov

This is still resulting in the same error so I resorted to entering the path manually and running it like this:

@echo off
setlocal enabledelayedexpansion

set PYTHON_EMBED="D:\VER_13\_AI\ComfyUI_windows_portable_3D\python_embeded"

:found_python
echo ✔ Found python_embeded:
echo     %PYTHON_EMBED%
echo.

rem ---- Find pybind11 include ----
set PB11_INCLUDE=%PYTHON_EMBED%\Lib\site-packages\pybind11\include

if not exist "%PB11_INCLUDE%\pybind11\numpy.h" (
    echo [ERROR] pybind11 headers not found!
    echo Expected here:
    echo     %PB11_INCLUDE%\pybind11\numpy.h
    exit /b 1
)

echo ✔ Found pybind11 include:
echo     %PB11_INCLUDE%
echo.

rem ---- Set MSVC include variables ----
set INCLUDE1=/I"%PB11_INCLUDE%"
set INCLUDE2=

echo ------------------------------------------------------
echo Compiling using MSVC 2019...
echo ------------------------------------------------------

cl /O2 /LD /EHsc /MD /I"%PB11_INCLUDE%" mesh_inpaint_processor.cpp ^
 /link /OUT:mesh_inpaint_processor.pyd ^
 /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\lib\x64" ^
 /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64" ^
 /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64"

echo.
echo ------------------------------------------------------
echo ✔ Done! If there are no errors, your .pyd was compiled successfully.
echo ------------------------------------------------------
pause

Running it like this results in the following:

D:\VER_13\_AI\ComfyUI_windows_portable_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_2_1\hy3dpaint\DifferentiableRenderer>compile_mesh_painter_auto_2019.bat
Γ£ö Found python_embeded:
    "D:\VER_13\_AI\ComfyUI_windows_portable_3D\python_embeded"

Γ£ö Found pybind11 include:
    "D:\VER_13\_AI\ComfyUI_windows_portable_3D\python_embeded"\Lib\site-packages\pybind11\include

------------------------------------------------------
Compiling using MSVC 2019...
------------------------------------------------------
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30159 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

mesh_inpaint_processor.cpp
Microsoft (R) Incremental Linker Version 14.29.30159.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:mesh_inpaint_processor.dll
/dll
/implib:mesh_inpaint_processor.lib
/OUT:mesh_inpaint_processor.pyd
"/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\lib\x64"
"/LIBPATH:C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64"
"/LIBPATH:C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64"
mesh_inpaint_processor.obj
LINK : fatal error LNK1104: cannot open file 'python310.lib'

------------------------------------------------------
Γ£ö Done If there are no errors, your .pyd was compiled successfully.
------------------------------------------------------
Press any key to continue . . .

PrometheusDante avatar Nov 26 '25 15:11 PrometheusDante

@PrometheusDante do you have Windows 11 and Python 3.12 in this environment? Please tell me your exact versions.

If you are on Python 3.12, download this file, rename the extension to .pyd, place it in the same folder, and restart ComfyUI:

mesh_inpaint_processor.cp312-win_amd64.txt (rename to mesh_inpaint_processor.pyd)

DenisKochetov avatar Nov 27 '25 10:11 DenisKochetov

Yes, I have Windows 11 and Python 3.12.10 in this environment.

Placing your provided mesh_inpaint_processor.pyd into

D:\VER_13\_AI\ComfyUI_windows_portable_3D\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_2_1\hy3dpaint\DifferentiableRenderer

allowed it to run without the name 'meshVerticeInpaint' is not defined error

PrometheusDante avatar Nov 27 '25 16:11 PrometheusDante