Magic3DModel<T>

Models & Types · AiDotNet.Diffusion.ThreeD

Magic3D model for high-quality text-to-3D generation using score distillation.

Inheritance: DiffusionModelBase<T> → LatentDiffusionModelBase<T> → ThreeDDiffusionModelBase<T> → Magic3DModel<T>

For Beginners

Magic3D creates 3D models from text descriptions:

How Magic3D works:

  1. Coarse stage: Optimize a neural radiance field (NeRF) using SDS from a low-res diffusion model
  2. Fine stage: Convert NeRF to a mesh and optimize with SDS from a high-res latent diffusion model
  3. Result: High-quality textured 3D mesh

Key characteristics:

  • Two-stage coarse-to-fine optimization
  • Coarse stage: NeRF + low-res SDS (64x64 base model)
  • Fine stage: DMTet mesh + high-res SDS (latent diffusion)
  • 2x faster than DreamFusion
  • 8x higher resolution meshes than DreamFusion
  • Uses both pixel-space and latent-space diffusion guidance

Advantages:

  • High-quality textured 3D meshes
  • Much faster than DreamFusion
  • Better geometry through mesh refinement
  • Supports both NeRF and mesh representations

Limitations:

  • Multi-view consistency (Janus problem)
  • Optimization takes minutes per object
  • Quality depends on 2D diffusion prior

How It Works

Magic3D is a two-stage coarse-to-fine text-to-3D generation framework by NVIDIA. It uses Score Distillation Sampling (SDS) from a 2D diffusion model to optimize a 3D representation, first as a coarse NeRF then refined as a textured mesh.

Technical specifications:

  • Coarse stage: Instant-NGP NeRF, 64x64 diffusion guidance, ~40 min optimization
  • Fine stage: DMTet mesh, latent diffusion guidance, ~20 min optimization
  • Diffusion prior: eDiff-I (coarse) + Stable Diffusion (fine)
  • SDS guidance scale: 100 (coarse) → 7.5 (fine)
  • NeRF resolution: 128^3 hash grid
  • Mesh resolution: 512^3 DMTet grid

Reference: Lin et al., “Magic3D: High-Resolution Text-to-3D Content Creation”, CVPR 2023

Example

var magic3d = new Magic3DModel<float>();
var mesh = magic3d.GenerateMesh(
    prompt: "A blue poison dart frog sitting on a lily pad",
    resolution: 256,
    numInferenceSteps: 64,
    guidanceScale: 100.0,
    seed: 42);

Constructors

Constructor Summary
Magic3DModel(NeuralNetworkArchitecture<T> architecture, DiffusionModelOptions<T> options, INoiseScheduler<T> scheduler, UNetNoisePredictor<T> coarseUnet, UNetNoisePredictor<T> fineUnet, StandardVAE<T> vae, IConditioningModule<T> conditioner, int defaultPointCount, int? seed) Initializes a new instance of Magic3DModel with full customization support.

Properties

Property Summary
IConditioningModule<T> Conditioner { get; }
INoisePredictor<T> CoarseModel { get; } Gets the coarse-stage noise predictor (pixel-space SDS).
INoisePredictor<T> NoisePredictor { get; }
IVAEModel<T> VAE { get; }
bool SupportsMesh { get; }
bool SupportsNovelView { get; }
bool SupportsPointCloud { get; }
bool SupportsScoreDistillation { get; }
bool SupportsTexture { get; }
int LatentChannels { get; }

Methods

Method Summary
Mesh3D<T> ImageTo3D(Tensor<T> inputImage, int numViews, int numInferenceSteps, double guidanceScale, int? seed) Not supported: image-to-3D is not part of this model’s published pipeline.
ModelMetadata<T> GetModelMetadata()