Comfyui-CraftsMan3DWrapper
A wrapper for CraftsMan
Nodes (6)
The CraftsMan all-in-one
Turning shape latents into triangles (octree depth is the dial)
Where every CraftsMan workflow actually starts
Clean the photo before CraftsMan looks at it
Sampling CraftsMan's shape latents
Getting the CraftsMan mesh onto disk (obj, glb, or ply)
ComfyUI-CraftsMan3DWrapper
This custom node package provides nodes for ComfyUI to generate 3D coarse meshes from images using the CraftsMan3D model, specifically the version utilizing DoraVAE.
Note: This wrapper currently only implements the coarse mesh generation stage described in the CraftsMan3D paper. The second-stage refinement using multi-view normal maps is not included in the underlying library code provided here.
Features
- All-in-One Node:
CraftsMan Generator (All-in-One)for a simple image-to-mesh workflow. - Staged Nodes: For more granular control:
Load CraftsMan Pipeline: Loads the model checkpoint.Preprocess Image (CraftsMan): Prepares the input image (background removal, resizing, padding).Sample CraftsMan Latents: Generates the 3D shape latents using diffusion.Decode CraftsMan Latents: Converts latents into mesh vertices and faces.Save CraftsMan Mesh (OBJ): Saves the mesh data to a file (OBJ, GLB, or PLY).
Installation
-
Clone or Download: Place the
ComfyUI-CraftsMan3DWrapperfolder inside yourComfyUI/custom_nodes/directory. -
Install Dependencies: Open a terminal/command prompt, navigate to your ComfyUI installation directory (activate your virtual environment if needed), and run: (Ensure
pipcorresponds to the Python environment used by ComfyUI).For Portable/Standalone ComfyUI: You need to run pip using the Python executable included with the portable version. Open a command prompt/terminal, navigate to this custom node's directory, and run the install command using the relative path to the embedded Python:
cd ComfyUI\custom_nodes\ComfyUI-CraftsMan3DWrapper ..\..\..\python_embeded\python.exe -m pip install -r requirements.txt(Adjust the relative path to
python.exe(..\..\..) if your portable version structure or custom node location is different). -
Download Model: Safetensors conversions of the original model, to
ComfyUI/checkpoints/CraftsMan3D(subfolder optional):https://huggingface.co/Kijai/craftsman3d_safetensors/tree/mainOriginal model:
https://pub-c7137d332b4145b6b321a6c01fcf8911.r2.dev/craftsman-DoraVAE/model.ckpt
Usage
All-in-One Node
- Connect an
IMAGEoutput to theimageinput. - Set the
model_pathto either the local directory containingconfig.yamlandmodel.ckpt(e.g.,D:\models\craftman-DoraVAE) or the Hugging Face Hub ID (e.g.,craftsman3d/craftsman-doravae). - Adjust generation parameters (seed, steps, guidance, etc.).
- The output
mesh_pathwill be the path to the generated.objfile in your ComfyUIoutputdirectory.
Staged Nodes
- Load CraftsMan Pipeline: Provide the
model_path(local directory or HF ID). Outputs apipelineobject. - Preprocess Image (CraftsMan): Connect the
pipelineand anIMAGE. Outputs animage_tensor(for preview) andimage_pil(for sampling). - Sample CraftsMan Latents: Connect the
pipelineandimage_pil. Set generation parameters. Outputsshape_latents. - Decode CraftsMan Latents: Connect the
pipelineandshape_latents. Setoctree_depth. Outputsmesh_vf(vertices/faces data). - Save CraftsMan Mesh (OBJ): Connect
mesh_vf. Choosefile_typeand other options. Outputs the finalmesh_path(in the ComfyUIoutputdirectory).
Notes
- Input Image: Providing an image with a transparent background (RGBA) generally works best. If not provided, background removal will be attempted using
rembg. - Resolution: The model expects images around 518x518 internally. The preprocessing node handles resizing.
- Memory: 3D generation can be memory-intensive. Ensure you have sufficient VRAM/RAM.
Acknowledgements
Based on the CraftsMan3D and Dora projects. Please cite their original work if you use these nodes in your research.