ShapeWords: Guiding Text-to-Image Synthesis with 3D Shape-Aware Prompts

Dmitry Petrov, Pradyumn Goyal, Divyansh Shivashok, Yuanming Tao, Melinos Averkiou, Evangelos Kalogerakis

TL;DR

ShapeWords is a novel framework that allows users to guide text-to-image synthesis using 3D shapes by embedding geometric information directly into the text prompt space. By representing 3D shapes as specialized "tokens" within a CLIP-based embedding, the method achieves superior compositionality and flexible, view-independent control compared to traditional 2D-map-based conditioning like ControlNet.

What Problem Does This Paper Address?

While text-to-image (T2I) models like Stable Diffusion are incredibly powerful, providing fine-grained control over the shape of generated objects remains a challenge. Current state-of-the-art methods typically rely on 2D spatial conditioning, such as depth maps or edge maps (e.g., ControlNet).

However, these 2D approaches have three major drawbacks:

  1. Viewpoint Dependence: They are locked to a single, fixed perspective. If you want to see the same object from a different angle, the 2D map doesn't help.
  2. Poor Compositionality: These models often struggle to balance the "hard" geometric constraint of a depth map with complex textual descriptions. For example, asking for "an airplane inside a snow globe" using a depth map of an airplane often results in just an airplane, ignoring the "snow globe" context.
  3. Lack of Design Flexibility: They don't allow for "soft" guidance where a user might want an image that resembles a target shape but allows for stylistic or structural variations.

Methods

The core innovation of ShapeWords is the Shape2CLIP module, which bridges the gap between 3D geometry and textual embeddings.

Figure 2. ShapeWords Training and Inference. During training (i), ShapeWords takes as input triplets of a shape, a prompt, and an image. The shape S and prompt T are encoded using the shape encoder PointBert and the text encoder OpenCLIP, respectively. The resulting embeddings are passed through a cross-attention-based Shape2CLIP module, which produces a prompt residual δT to guide the source prompt toward the target geometry. This modified prompt is then passed as input to a Text-to-Image Denoising UNet along with sampled noisy image latents and time step t. The Shape2CLIP module is optimized via Score Distillation Sampling. During inference (ii), the CLIP embeddings of the input prompt and the target embeddings of the test shape Stest are passed through the Shape2CLIP module. Optionally, the desired strength of the shape guidance is controlled by the user parameter λ.
  • Shape Encoding: The system takes a 3D point cloud and processes it through Point-BERT, a transformer-based encoder that extracts structure-aware geometric features.
  • Shape-Aware Tokens: Instead of using a separate conditioning branch, ShapeWords maps these 3D features into the OpenCLIP text embedding space. It generates a "prompt residual" ($\delta T$) that is added to specific tokens in the text prompt—specifically the object identifier (e.g., "[SHAPE-ID]") and the End-of-Sequence (EOS) token.
  • Why the EOS token? The authors found that updating the EOS token is critical because it captures the global context of the entire prompt, allowing the shape information to integrate naturally with the rest of the scene.
  • Training with SDS: The Shape2CLIP module is trained using Score Distillation Sampling (SDS). This allows the model to learn the mapping from 3D shapes to CLIP space by leveraging the gradients of a pre-trained Stable Diffusion model, ensuring the generated images remain aesthetically plausible.
  • Guidance Strength ($\lambda$): Users can adjust a parameter $\lambda$ to control how strictly the model follows the 3D shape, enabling everything from exact replicas to loose, stylized interpretations.

Datasets

  • ShapeNet: The primary source for 3D reference shapes across 55 categories.
  • Training Dataset: A massive synthetic dataset of 1.58 million triplets (shape, prompt, image). The images were generated using ControlNet on ShapeNet depth maps, then augmented with ChatGPT-generated prompts and background inpainting to ensure diversity and reduce bias.
  • Evaluation Benchmarks: The authors introduced two new test sets:
  • Simple Prompts Dataset: 2592 shapes with basic "a photo of a [SHAPE-ID]" prompts to test raw geometric adherence.
  • Compositional Prompts Dataset: Challenging prompts like "a craftsman working on a [SHAPE-ID]" to test how well the model handles complex interactions and contexts.

Key Insights and Ideas

  • Geometry as Language: By treating 3D shapes as specialized "words" in the CLIP space, the model can use its existing linguistic knowledge to handle composition. This is why ShapeWords succeeds at "an airplane in a snow globe" where depth-map methods fail—it understands the concept of the airplane's shape rather than just seeing a wall of pixels.
  • View-Independent Control: Because the embedding represents the full 3D structure, the model can generate the object from any viewpoint specified in the text or inferred by the diffusion process, without needing a new depth map for every angle.
  • Soft vs. Hard Constraints: Traditional conditioning is a "hard" constraint. ShapeWords provides "soft" structural guidance, which is often more useful for creative exploration and concept art.

Key Results

ShapeWords significantly outperforms ControlNet-based baselines in both quantitative metrics and human preference studies, particularly in complex scenarios.

Figure 1. ShapeWords enables 3D shape-aware text-to-image generation via mapping of shape geometries into CLIP space. Given an input 3D shape and text prompts describing desired appearance and context, our method generates images that maintain both shape fidelity and text compliance. Unlike existing methods that use view-dependent guidance like depth maps, ShapeWords generalizes to compositional settings (top row) and allows for exploration of target geometries with stylistic deviations aligned with the prompt (bottom row).
  • Quantitative: On compositional prompts, ShapeWords achieved a FID of 73.8 (lower is better) compared to ControlNet's 97.0, and a higher CLIP score of 31.5 vs 26.9, indicating much better alignment with text.
  • Shape Adherence: Even without explicit depth maps, ShapeWords@40 (using 40% guidance) achieved shape adherence comparable to the original ControlNet while maintaining much higher image quality.
  • User Study: In a study with 250 participants, ShapeWords was preferred 54.4% of the time for text matching and 57.1% for shape matching, consistently beating the best ControlNet variants.
User study results favoring ShapeWords.

Limitations and Future Work

  • Fine-Grained Details: The model sometimes struggles with very thin parts or intricate holes (e.g., the legs of a delicate chair), likely due to the resolution limits of the underlying OpenCLIP model (224px).
  • Appearance Biases: The authors noted some biases in color and saturation, which they attribute to the synthetic training data generated by ControlNet.
  • Future Directions: Promising next steps include training on larger, more diverse datasets and combining shape tokens with viewpoint-specific tokens to provide even more granular control over the final render.

Summary updated

Abstract

We introduce ShapeWords, an approach for synthesizing images based on 3D shape guidance and text prompts. ShapeWords incorporates target 3D shape information within specialized tokens embedded together with the input text, effectively blending 3D shape awareness with textual context to guide the image synthesis process. Unlike conventional shape guidance methods that rely on depth maps restricted to fixed viewpoints and often overlook full 3D structure or textual context, ShapeWords generates diverse yet consistent images that reflect both the target shape's geometry and the textual description. Experimental results show that ShapeWords produces images that are more text-compliant, aesthetically plausible, while also maintaining 3D shape awareness.
BibTeX
@inproceedings{petrov2025shapewords,
  author = {Dmitry Petrov and Pradyumn Goyal and Divyansh Shivashok and Yuanming Tao and Melinos Averkiou and Evangelos Kalogerakis},
  title = {{ShapeWords: Guiding Text-to-Image Synthesis with 3D Shape-Aware Prompts}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.01242},
}
Figure