Nodes/Comfyui-CraftsMan3DWrapper/Sample CraftsMan Latents
ComfyUI Node

Sample CraftsMan Latents

Sampling CraftsMan's shape latents

By hunzmusic·Created about a year ago·Updated about a year ago· 15
Sample CraftsMan Latents
  • pipeline
  • preprocessed_image
  • shape_latents
seed0
steps50
guidance_scale7.5

If the previous node in the chain cleans the photo, this is the node that does the actual magic. Sample CraftsMan Latents is the diffusion pass of the whole workflow: the preprocessed image goes in, and a set of shape latents comes out. It's here, not in the decode step, that the model invents the sides of the object it can't see - the back, the bottom, the hidden topology. Everything downstream just reads what this node decided.

It's also where the time goes. The preprocess is seconds, the decode is a chunk of VRAM, but the sampling loop is the minutes you'll watch the progress bar crawl.

How it works

CraftsMan's config calls this a "shape-rectified-flow-system," and the sampling is a fairly standard rectified-flow / diffusion denoise:

  • A DINOv2-with-registers encoder turns your image into a conditioning embedding.
  • For classifier-free guidance the sampler pairs it with an "empty image" embedding - that's what guidance_scale controls. Set it to 1.0 and CFG effectively switches off.
  • A PixArt-style denoiser iterates steps times, seeded by seed, un-denoising a random latent toward the shape conditioned on your image. eta is fixed at 0.0 from the config, so you don't get an eta knob.

What comes out is the DoraVAE latent space - a compact code the autoencoder was trained to decode into 3D geometry. It is not yet a mesh, and it isn't a normal image latent either, which is why the next node is mandatory.

Inputs that matter

  • pipeline - the loaded pipeline from Load CraftsMan Pipeline.
  • preprocessed_image (IMAGE_PIL) - this must come from Preprocess Image (CraftsMan). The type is a custom PIL socket; a plain IMAGE won't fit here, so don't try to bypass the preprocessor. If the subject wasn't cleaned up, this node faithfully diffuses the mess.
  • seed (0) - deterministic. Same seed, same image, same settings, same shape. When a silhouette comes out wrong, change this first - it's the cheapest knob you have.
  • steps (50, 1–200) - denoising iterations. 50 is the model's intended default and usually fine; 30 is noticeably faster with mild quality loss, and above 60 you're mostly paying for marginal gains.
  • guidance_scale (7.5, 1–20) - how hard the sampler sticks to your image. 7.5 is a good starting point; if the output drifts from the input, nudge it up.

The output

shape_latents (LATENT) - a standard ComfyUI latent dict, which is a neat bit of interop on the author's part. It's wired straight into Decode CraftsMan Latents, the node that turns it into actual vertices and faces.

Install and what to expect

Same pack install as the rest:

cd ComfyUI/custom_nodes
git clone https://github.com/hunzmusic/Comfyui-CraftsMan3DWrapper
cd ComfyUI-CraftsMan3DWrapper
pip install -r requirements.txt   # portable: ..\..\..\python_embeded\python.exe -m pip install -r requirements.txt

A few honest notes from running this stuff: the sampler puts real pressure on VRAM, so if a run dies with an out-of-memory error, this node is usually the culprit - drop steps, and make sure nothing else heavy is resident on the card. And remember the wrapper's big caveat: the model only generates the coarse shape here, so the latent encodes geometry, not texture. The white untextured look you eventually get isn't a sampler failure; it's the missing second stage of the full CraftsMan3D paper, which this pack doesn't implement.

Categorygeneration/3d/craftsman

Inputs (5)

NameTypeDefaultDescription
pipelineCRAFTSMAN_PIPELINE
preprocessed_imageIMAGE_PIL
seedINT00–18446744073709550000
stepsINT501–200
guidance_scaleFLOAT7.51–20

Outputs (1)

NameTypeDescription
shape_latentsLATENT