SECAD-Net Fine-tune (Required!)
The node whose display name says '(Required!)' — and it's not lying
- model
- voxels
- latent_code
- optimized_latent
- status
Every other node in this pack has a calm, descriptive name. This one is named SECAD-Net Fine-tune (Required!) with an exclamation mark baked into the UI. That's the author telling you, in the only way a node name can, that the rough mesh you got from SECADNetInference is not what you came for. SECAD-Net is built around test-time optimization: the encoder only produces an initialization, and the real quality comes from fine-tuning the latent code against your specific voxel shape. Skip this node and the whole pack underdelivers.
How it works
This is also the most technically interesting node in the pack, because it has to fight ComfyUI to exist. ComfyUI wraps everything in torch.inference_mode(), which means the model weights you loaded are "inference tensors" that refuse to participate in backprop. The node's workaround: it re-creates the decoder and generator inside inference_mode(False), clones the weights to get normal tensors, and makes the latent code a learnable parameter. Then it runs an Adam optimizer (betas 0.5/0.999) that nudges three things at once - the latent code, the decoder, and the generator - to minimize MSE between the predicted occupancy and the ground-truth occupancy sampled from your voxel grid.
Every epoch, it randomly samples num_samples points from the 64³ grid, maps them to the (-0.5, 0.5) unit cube, and checks whether the network thinks each point is inside the shape. It tracks the best latent it finds along the way and hands that back to you.
Inputs that matter
model(SECADNET_MODEL) andvoxels(VOXEL_GRID) - same sources as Inference: the loader and MeshToVoxel.latent_code(SECADNET_LATENT) - the output ofSECADNetInference. This is the whole point of the previous node's second output.num_epochs(default 200, up to 2000) - the tooltip says 200–500 for good results. Start at 200; push higher only if the mesh still looks wrong.num_samples(default 8192) - points sampled per epoch. Higher = better gradients, slower. Drop to 2048–4096 for quick previews.learning_rate(default 0.0005) - lower (0.0001–0.001) is more stable, per the tooltip. If the loss explodes or the mesh degrades, halve it.
Outputs are optimized_latent (SECADNET_LATENT) - wire it into SECADNetLatentToMesh - and status (STRING) with the best loss.
What to expect
Patience, mostly. This is a real optimization loop, not a one-shot inference, and 200 epochs of point sampling takes a while even on a GPU. Console output prints progress every 100 epochs. The pack is honest about being unfinished (README says "Work in Progress"), so watch for the log line about the voxel shape if you fed in something that isn't 64³ - it warns and tries to squeeze anyway, with mixed results.
If you run into "inference tensor" errors, that's the ComfyUI inference_mode clash this node exists to dodge - make sure you're feeding it the SECADNET_MODEL and SECADNET_LATENT from this pack's own nodes, not some other pack's lookalikes. And a practical tip: when you're iterating on settings, run one short pass (like 50 epochs at low num_samples) to confirm the loss actually falls before committing to the full 500.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | SECADNET_MODEL | — | |
| voxels | VOXEL_GRID | — | |
| latent_code | SECADNET_LATENT | — | |
| num_epochsopt | INT | 20010–2000 | Number of optimization epochs. 200-500 recommended for good results. |
| num_samplesopt | INT | 81921024–65536 | Number of point samples per iteration. Higher = better but slower. |
| learning_rateopt | FLOAT | 0.00050.00001–0.01 | Learning rate for optimization. Lower values (0.0001-0.001) are more stable. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| optimized_latent | SECADNET_LATENT | — |
| status | STRING | — |