What Shap-E is
Shap-E generates a 3D object from a text prompt by generating a function: the weights of a small MLP that maps any point in space to a signed distance, a density and a colour. That one function can be drawn as a textured mesh or rendered as a neural radiance field. Shap-E is trained in two stages: an encoder learns to turn 3D assets into such weights, and a diffusion model learns to generate the encoder's outputs from text.
The page runs OpenAI's released model through diffusers on two prompts, a shark and a bowl of vegetables, with seed 0. Its parts are a 316 M-parameter prior transformer, a 124 M CLIP text encoder and a 226 M projection from latent to weights; sampling takes 64 Heun steps with guidance 15, and the prior predicts the clean latent directly.
The prompt as one CLIP vector
The Text panel shows the condition. CLIP ViT-L/14's text tower reads the prompt, and its projection at the end token is one 768-number vector , trained by CLIP to point the same way as the embeddings of matching images. The pipeline rescales it to a fixed length, . For classifier-free guidance the empty condition is a vector of zeros, not the embedding of an empty prompt.
The prior transformer
The diffusion model denoises a latent of 1,024 rows × 1,024 numbers. The Prior transformer panel lays out its input as one sequence of 1,026 tokens: the condition (a Linear 768 → 1,024 of ), the timestep's embedding, and the 1,024 rows of the noisy latent, each a Linear 1,024 → 1,024 plus a learned position. A LayerNorm and 24 pre-norm blocks of self-attention over all tokens (no mask) and GELU MLPs follow. The last 1,024 outputs go through a Linear 1,024 → 2,048; the first 1,024 numbers of each are the prediction of and the rest, a variance, is dropped.
Shap-E adopts Point-E's transformer with latent rows in place of points. Like DALL·E 2's diffusion prior (diffusers runs both with the same PriorTransformer class), it reads its conditions as extra tokens rather than through cross-attention, and predicts rather than the noise. Guidance mixes two predictions and clamps the result:
The attention heat map shows, for every layer and every latent row, the share of its attention on the condition token or on the timestep token, against 0.10 % if attention were spread evenly over the 1,026 tokens. The Guidance at step … panel shows the two predictions and their mix.
Noise levels and the Heun sampler
Training uses an exponential schedule over 1,024 steps, , shown in the Noise schedule panel. Sampling follows Karras et al.: the noise level is written as , the latent as (fed to the prior as , with the that maps back to), and 64 levels are spaced evenly in from 403.4 down. Each step is a Heun step, a second-order solver of the probability-flow ODE:
The correction needs a second prior call at , except at the last step, where and the Euler step lands on : 64 steps cost 127 calls, each on the prompt and the empty condition together. The Denoising the latent strip follows , and a render of at every step.
The latent is an MLP
The finished latent is never decoded into a picture: it is the first four weight matrices of an MLP. The Latent → MLP weights panel shows how: each of its 1,024 rows has its own Linear 1,024 → 93 or 256, a LayerNorm and a bias, and becomes one row of (256 × 93) or of , , (256 × 256 each). The latent's 1,048,576 numbers become 220,416 weights; the MLP's other 148,748 parameters, every bias and to , are the same for every prompt.
Treating one weight row as one token is what lets a sequence transformer generate network weights: the prior sees 1,024 tokens, and each token is decoded independently into its row.
The 3D function and its two renderings
The The 3D function panel draws the MLP. A point enters as itself plus the sines and cosines of to times each coordinate, 93 numbers; seven layers of width 256 with SiLU between them give 12 outputs: a signed distance, two densities and three colours, one each for the mesh and for the coarse and fine radiance fields. Slices through show the signed distance or the density on a plane.
- Mesh. Marching cubes on the signed distance, sampled at 128³, extracts the surface where it crosses zero: 9,250 vertices and 18,484 faces for the shark, 59,036 and 118,076 for the bowl, coloured by the mesh colour output.
- Radiance field. Volume rendering marches along each camera ray, 64 + 128 samples per ray, and blends the colours by the densities over segment lengths ; the NeRF renders panel shows 20 cameras at 64 × 64.
Where it came from
Point-E (2022) generated point clouds with the same kind of transformer. Shap-E (Jun and Nichol, 2023) moved the diffusion model from points to the weights of an implicit function, which can be meshed and rendered; its paper reports that it converges faster than Point-E and reaches comparable or better quality. TRELLIS later separated where an object is from what it looks like, generating sparse voxels first and a latent on each (see the TRELLIS tab).
Papers
- Shap-E: Generating Conditional 3D Implicit Functions The model this tab records: an encoder from 3D assets to MLP weights rendered as NeRF and STF, and a diffusion transformer over those latents.
- Point-E: A System for Generating 3D Point Clouds from Complex Prompts The predecessor whose transformer-based diffusion architecture Shap-E adopts, with latent rows in place of points.
- Hierarchical Text-Conditional Image Generation with CLIP Latents DALL·E 2's diffusion prior: a decoder-only transformer over condition, timestep and noisy-latent tokens that predicts the clean latent.
- NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis An MLP from position to density and colour, rendered by volume rendering with positional encodings, as Shap-E's renders are.
- Elucidating the Design Space of Diffusion-Based Generative Models The Karras noise levels and the Heun sampler the page runs.
- Learning Transferable Visual Models From Natural Language Supervision CLIP, whose ViT-L/14 text embedding is the condition.
- Marching cubes: A high resolution 3D surface construction algorithm Extracting a triangle mesh from a sampled field, used here on the signed distance at 128³.