Nodes/ComfyUI Stable3DGen/Stable-3D Preprocess Image
ComfyUI Node

Stable-3D Preprocess Image

Why Stable-3D makes you draw a normal map before it touches a mesh

By lerignoux·Created about a year ago·Updated 11 months ago· 4
Stable-3D Preprocess Image
  • hi3dgen_pipeline
  • normal_predictor
  • images
  • normal_images

Stable-3D Preprocess Image is the pack's middle child, and it's the node that makes the whole approach work. It takes your flat 2D image and turns it into a normal map - a picture where the RGB channels encode surface direction instead of colour. That's the "normal bridging" trick at the heart of Hi3DGen (the paper literally has it in the title): image → normal map → 3D. The mesh generator never sees your photo; it sees a description of what the object's surface is doing, which is a much easier job for it to turn into geometry.

What it actually does

For every image in your batch it runs two steps, and the order matters:

  1. Background removal first, using the BiRefNet model bundled into the hi3dgen pipeline. The image gets resized down to at most 1024px on its long side and padded, then BiRefNet cuts the subject out. If your input already carries a real alpha channel, that's used as-is and BiRefNet is skipped.
  2. Normal prediction second, via the StableNormal predictor - the YOSO-based model at 768px, matching your input resolution, predicting an object (not scene) normal map.

Each result is saved to ComfyUI's temp folder as a timestamped PNG - a genuinely useful side effect, since you get to inspect the normal maps on disk - then converted back into a tensor. Feed multiple images and they're resized to the first image's dimensions and stacked into one batch.

Inputs and outputs

All three inputs come from elsewhere in the graph, so you won't hand-type anything:

  • hi3dgen pipeline - carries the BiRefNet background-removal setup (from Load Models)
  • normal_predictor - the normal model (from Load Models)
  • images - your photo, from any Load Image node

There are no knobs on this node at all, which is honestly a relief. It's also flagged as an output node, so it drives workflow execution - think of it as the checkpoint in the middle.

Output: normal_images (IMAGE). Wire it into Generate 3D, and into a Preview Image node if you want to see the normal map. Those previews are a great debugging aid: weird colours mean a weird input.

The quality bottleneck

Here's the honest bit. This node is where most bad meshes are actually born, and it's not the generator's fault. BiRefNet decides what counts as the subject, so the quality of your cutout decides the quality of your normals, and the normals decide the mesh. Feed it a clean, single-object, well-lit shot with the subject against a contrasting background and you'll get usable results. Feed it flyaway hair, glass, or your subject tangled into the background and you'll get a mesh that looks like it was assembled by an accident. Same advice the background-removal literature keeps giving: fix the input, not the model. If you want multi-view conditioning, the pack's "Multiview" example workflow batches two Load Images through an ImageBatch first - preprocess handles a batch fine.

Install and gotchas

Standard pack install - ComfyUI Manager (search "Stable3DGen") or the clone:

cd ComfyUI/custom_nodes && git clone https://github.com/lerignoux/ComfyUI-Stable3DGen
cd ComfyUI-Stable3DGen && python -m pip install -r requirements.txt

Then restart. The heavy stuff lands on first run: the trellis pipeline, the yoso normal model, BiRefNet, plus torch.hub pulls for StableNormal and DINOv2 - gigabytes total, all CUDA-only. Two smaller gotchas: the batch gets resized to match the first image, so feed similar-sized views or the later ones get squeezed, and preprocessing a long batch churns the temp folder with normal PNGs. Harmless, just not quiet.

Categorystable_3d_gen

Inputs (3)

NameTypeDefaultDescription
hi3dgen_pipelineHI3DGEN_PIPELINEThe hi3dgen pipeline containing the remove background setup (BiRefNet).
normal_predictorSTABLE3D_NORMALThe normal predictor model to generate the image normal.
imagesIMAGE

Outputs (1)

NameTypeDescription
normal_imagesIMAGE