Cupid3D Turns One Photo Into a 3D Mesh and the Camera That Shot It
Cupid3D wraps CUPID in a ComfyUI node: one photo in, a 3D mesh plus the matching camera out, so the render drops straight back onto the plate.
CUPID's own examples: input image (top left), estimated camera and mesh, then the input re-rendered from the model. Source: CUPID
What it does
The node takes an image and an optional mask, and returns a mesh plus camera_info. Geometry comes back with vertex colours and normals rather than a baked texture.
The camera is the interesting half. Point it at Preview3D, Load3D or NKD Preview 3D and the render lines up with the plate: same frame, no padding or letterboxing. That is what makes the two shipped compositing workflows possible, where the subject is cut out, the photo is repainted empty, and the mesh is dropped back in.
Cupid3D Reconstruct: image and optional mask in, mesh and camera out.
Run it
cd ComfyUI/custom_nodes
git clone https://github.com/Nekodificador/ComfyUI-Cupid3D
pip install spconv-cu126 easydict
pip install "utils3d @ git+https://github.com/EasternJournalist/utils3d.git@9a4eb15e4021b67b12c460c7057d642626897ec8"You need an NVIDIA GPU with the CUDA 12.x toolkit installed. Peak VRAM was about 11.5 GB on a 719 x 719 input. The ~7 GB of weights download from hbb1/Cupid on first run, and DINOv2 comes through torch.hub.
Three workflows ship with the pack and appear under Templates when you search "Cupid". The first uses core nodes only; the two scene-integration ones also need the NKD packs, RES4LYF and comfyui_controlnet_aux.
The shipped workflow: reconstruct, then render the mesh back through its own predicted camera to check the alignment.
Scene integration with Klein 3 removal: the subject is painted out of the photo and the mesh is placed back into the plate.
Settings and limits
| Control | Default | Notes |
|---|---|---|
steps / seed | 25 / 42 | Drive both sampling stages |
cfg_strength | 5.0 | |
crop_to_content | on | Crops to the subject, then corrects the camera back to the full frame |
place_on_ground | on | Rests the mesh on y = 0 and moves the camera with it |
mask | none | White on black; LoadImage's own mask is inverted, so put InvertMask in between. With no mask, rembg clears the background |
- No baked texture. Run the mesh through core's
UnwrapMeshandBakeTextureFromViewsif you need UVs. - One image per run. Extra batch items are ignored, because the node emits a single camera.
- Single subjects only. Multi-object scenes need upstream's MoGe and pytorch3d path, which is not included.
- Experimental. Verified on Windows 11 with torch 2.10+cu130 on an RTX 5090; exclude the pack if you run a hot-reloader.
Comments
Sign in with GitHub to join the discussion.