Nodes/ComfyUI-BespokeAI-3D/BespokeAI 3D Preview
ComfyUI Node

BespokeAI 3D Preview

A 3D viewer in your canvas — and it's not just for BespokeAI output

By SofianeAlla·Created 9 months ago·Updated 9 months ago· 1
BespokeAI 3D Preview
      model_fileNone
      glb_path

      The generation nodes hand you a file path and a model URL, which is useful to exactly nobody until you can actually see the mesh. That's what BespokeAI 3D Preview is for: it's the pack's output node that renders a 3D model right on the canvas so you can spin it, zoom it, and check whether the reconstruction actually looks like your input. You run it, and a Three.js viewer materializes in the node's body with orbit controls and a grid floor. No external viewer, no Blender, no exporting just to eyeball the result.

      Under the hood it's a bit smarter than a dumb file picker. When you wire the generation node's mesh_path into its glb_path input, it copies that freshly-downloaded GLB into ComfyUI/input/3d/ (so the web server can serve it) and tells the frontend to render it. The frontend half is a small custom extension that pulls Three.js 0.160 straight from the jsDelivr CDN and loads the model through GLTFLoader.

      Inputs

      Only two, and one is optional:

      • glb_path - the important one. It's a STRING with forced input, which is just ComfyUI-speak for "wire something into me." Connect the generation node's mesh_path here and the model shows up automatically.
      • model_file - a dropdown of .glb, .gltf, .obj, .fbx, and .stl files found in ComfyUI/input/3d/. This is the fallback (and a genuinely handy one): drop any 3D file into that folder and it becomes available to view, even if it never came from BespokeAI.

      Where people get burned

      Three things, all traceable to the code. First, the viewer needs internet: Three.js is loaded dynamically from jsDelivr, so a fully offline ComfyUI shows "Failed to load model" no matter how valid your mesh is. Second, the model_file dropdown is built once when the node is created - files you add to input/3d/ afterward won't appear until you delete and re-add the node. Third, and this one's sneaky: the dropdown lists OBJ, FBX, and STL, but the viewer only ever instantiates a GLTFLoader. Realistically GLB and glTF render; OBJ/FBX/STL are accepted but won't display. If your file isn't appearing, convert it to GLB rather than assuming the node is broken.

      There are no outputs - it's a pure display node, so it should sit at the end of your branch. The refresh behavior is worth knowing too: it re-executes every run so a new glb_path from a fresh generation always triggers a reload, which means you can re-run the upstream node and immediately see the new model.

      Install

      Same pack, same steps as the generation nodes: git clone https://github.com/SofianeAlla/ComfyUI-BespokeAI-3D into ComfyUI/custom_nodes, pip install -r requirements.txt, restart - or ComfyUI Manager, searching "BespokeAI". The heavy lifting here is JavaScript, not Python, so the requirements file stays trivial (requests, Pillow, numpy). No models, no VRAM. You'll find all three nodes under BespokeAI/3D.

      CategoryBespokeAI/3D

      Inputs (2)

      NameTypeDefaultDescription
      model_fileCOMBONone1 options: None
      glb_pathoptSTRING

      Outputs (0)

      No outputs