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

Hunyuan3D_V2: No module named 'custom_rasterizer' running sample workflow

Open rob-ack opened this issue 11 months ago • 8 comments

2025-01-27T16:01:15.779580 - !!! Exception during processing !!! No module named 'custom_rasterizer'
2025-01-27T16:01:15.780628 - Traceback (most recent call last):
  File "I:\ComfyUI\ComfyUI\execution.py", line 327, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "I:\ComfyUI\ComfyUI\execution.py", line 202, in get_output_data
    return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "I:\ComfyUI\ComfyUI\execution.py", line 174, in _map_node_over_list
    process_inputs(input_dict, i)
  File "I:\ComfyUI\ComfyUI\execution.py", line 163, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "I:\ComfyUI\ComfyUI\custom_nodes\comfyui-3d-pack\nodes.py", line 1514, in load_diffusers_pipe
    pipe = diffusers_pipeline_class.from_pretrained(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "I:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_V2\hy3dgen\texgen\pipelines.py", line 70, in from_pretrained
    return cls(Hunyuan3DTexGenConfig(delight_model_path, multiview_model_path))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "I:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_V2\hy3dgen\texgen\pipelines.py", line 76, in __init__
    self.render = MeshRender(
                  ^^^^^^^^^^^
  File "I:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_V2\hy3dgen\texgen\differentiable_renderer\mesh_render.py", line 155, in __init__
    import custom_rasterizer as cr
ModuleNotFoundError: No module named 'custom_rasterizer'

comparing with the original repo: the py code was left out in ComfyUI-3D-Pack.

rob-ack avatar Jan 27 '25 15:01 rob-ack

2025-01-27T16:01:15.779580 - !!! Exception during processing !!! No module named 'custom_rasterizer'
2025-01-27T16:01:15.780628 - Traceback (most recent call last):
  File "I:\ComfyUI\ComfyUI\execution.py", line 327, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "I:\ComfyUI\ComfyUI\execution.py", line 202, in get_output_data
    return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "I:\ComfyUI\ComfyUI\execution.py", line 174, in _map_node_over_list
    process_inputs(input_dict, i)
  File "I:\ComfyUI\ComfyUI\execution.py", line 163, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "I:\ComfyUI\ComfyUI\custom_nodes\comfyui-3d-pack\nodes.py", line 1514, in load_diffusers_pipe
    pipe = diffusers_pipeline_class.from_pretrained(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "I:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_V2\hy3dgen\texgen\pipelines.py", line 70, in from_pretrained
    return cls(Hunyuan3DTexGenConfig(delight_model_path, multiview_model_path))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "I:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_V2\hy3dgen\texgen\pipelines.py", line 76, in __init__
    self.render = MeshRender(
                  ^^^^^^^^^^^
  File "I:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Hunyuan3D_V2\hy3dgen\texgen\differentiable_renderer\mesh_render.py", line 155, in __init__
    import custom_rasterizer as cr
ModuleNotFoundError: No module named 'custom_rasterizer'

comparing with the original repo: the py code was left out in ComfyUI-3D-Pack.

Please follow wheel install instructions here https://github.com/kijai/ComfyUI-Hunyuan3DWrapper?tab=readme-ov-file#installation I was having the same error, installing them from the wheels fixed it on my Windows 11 setup 🙏🏼

serkansokmen avatar Feb 04 '25 16:02 serkansokmen

Done already but wont any user run into this issue since the pack does not include the rasterizer? Shouldn't that step be run by the pack init.

rob-ack avatar Feb 04 '25 17:02 rob-ack

Hm, guys, can you help with it? I have the same problem but on linux mint 22 :(

small-jeeper avatar Feb 05 '25 08:02 small-jeeper

Oh, it's hard to do, I've encountered it, but my py is from 3.11 version, do I still hope to use it? I still can't install it, please ask for an answer

GAO-SHIQING avatar Feb 18 '25 11:02 GAO-SHIQING

There is a solution:

  1. get the repo. 'https://github.com/Tencent/Hunyuan3D-2'
  2. locate to Hunyuan3D_V2\hy3dgen\texgen\custom_rasterizer
  3. build the 'custom_rasterizer', there recomand: python setup.py bdist_wheel (build to whl package), then pip install the pkg to your comyui env.

bazaha avatar Mar 02 '25 05:03 bazaha

Hi everybody, after spending 5+ hours in one day, i got the answer, thanks to the reddit comment- > https://imgur.com/a/kijai-comfyui-hunyuan3dwrapper-instructions-3TSVBCE

Solution-> as mentioned in the {1} in the reademe section where it sats as "If this doesn't work or there isn't a suitable wheel available for your system. you need to compile yourself:" You have to blindly follow the steps, in my case the section option worked, where another link {2} i have to follow which simply installed something like python.h and after that i come back to readme file of {1} and again exectued the same command and viola!! everything worked as it should be,

While it was not solved, it seemed to me as if everyone was able to access such powerfull model leaving me behind 😂, Also i am having GTX 4050 6GB Vram, and the Hanyuan paint-3d model, in the purple section of the node where it finally paints the model, is taking huge time, please let me know what was your experience with your PC specs.

If you find the helpful please follow me on github - {3}

{1} -> https://github.com/kijai/ComfyUI-Hunyuan3DWrapper?tab=readme-ov-file {2} -> https://github.com/woct0rdho/triton-windows?tab=readme-ov-file#8-special-notes-for-comfyui-with-embeded-python {3} -> https://github.com/KrishnaGupta0405

KrishnaGupta0405 avatar Mar 25 '25 13:03 KrishnaGupta0405

im struggling with the command needed for apple computers to install the whl for custom_raster.

rachelcenter avatar Apr 23 '25 21:04 rachelcenter

git clone https://github.com/kijai/ComfyUI-Hunyuan3DWrapper.git %cd ./ComfyUI-Hunyuan3DWrapper/hy3dgen/texgen/custom_rasterizer/ !python setup.py bdist_wheel !pip install dist/custom_rasterizer*.whl

mohamed-em2m avatar May 10 '25 05:05 mohamed-em2m

This is my successful way suggested by Gemini.

Step-by-Step Instructions

C:\ComfyUI-aki-v1.4\python\python.exe -m pip install --upgrade pip setuptools wheel ninja

After that command completes successfully, try the original installation command again.

C:\ComfyUI-aki-v1.4\python\python.exe -m pip install . --no-build-isolation

This should now work.

JK04522 avatar Jun 11 '25 16:06 JK04522

there are now wheels for custom rasterizer for windows cuda 12.8

DenisKochetov avatar Jun 13 '25 20:06 DenisKochetov