Cupid3D Turns One Photo Into a 3D Mesh and the Camera That Shot It

ComfyUI Wikinews

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.

Cupid3D Reconstruct rebuilds the subject of one photo as a 3D mesh and works out the camera that took it. The camera describes your input frame exactly, so the mesh can be rendered on top of the original photo without reframing.
CUPID results: input image, estimated camera, reconstructed 3D model, re-render

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.

The Cupid3D Reconstruct node inputs and outputs

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 Cupid3D mesh and camera workflow

The shipped workflow: reconstruct, then render the mesh back through its own predicted camera to check the alignment.

Scene integration workflow: subject removed from the photo and rebuilt in 3D

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

ControlDefaultNotes
steps / seed25 / 42Drive both sampling stages
cfg_strength5.0
crop_to_contentonCrops to the subject, then corrects the camera back to the full frame
place_on_groundonRests the mesh on y = 0 and moves the camera with it
masknoneWhite 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 UnwrapMesh and BakeTextureFromViews if 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.

Loading comments…
Cupid3D Turns One Photo Into a 3D Mesh and the Camera That Shot It | ComfyUI Wiki