$ show NVIDIA-AI-Blueprints/3d-object-generation
This repository implements an end-to-end 3D object generation application that takes natural language descriptions and produces 3D mesh models (GLB format). It orchestrates three generative AI models: an LLM (Qwen3 or Llama) for scene planning, a diffusion model (SANA Sprint) for 2D image generation, and Microsoft TRELLIS for 3D generation. The system presents a Gradio web interface for user interaction and includes a Blender addon for direct import of generated assets. It supports two deployment modes: native PyTorch models (for local development) and NIM containers (for scalable inference). Key architectural patterns include a singleton GPU memory manager that coordinates model loading/unloading across VRAM-constrained GPUs, a guardrail service for content safety, and a conditional service abstraction that transparently switches between native and NIM backends based on configuration. The repository is well-structured with modular UI components and comprehensive installation scripts, though it is Windows-only and has complex event chains in the main UI file. The code is actively maintained with recent commits and pinned dependencies, but the heavy reliance on patched versions of TRELLIS and a specific Gradio version introduces some maintenance risk.
The LLM identified 5 files worth highlighting for reuse:
Singleton GPU memory manager that pre-loads all models (LLM, SANA, TRELLIS) at startup, moves inactive models to CPU, and unloads SANA before TRELLIS to free VRAM. Provides a reusable pattern for coordinating multiple large models on a single GPU with limited memory.
Isolated content safety service using a HuggingFace NSFW Prompt Detector. Runs on CPU to avoid GPU contention and blocks inappropriate prompts and generated images. Demonstrates how to decouple safety checks from the main generation pipeline, making it independently reusable in other AI applications.
Conditional import module that selects between native PyTorch and NIM container implementations for LLM, image generation, and 3D services based on configuration flags. This pattern enables deployment flexibility without changing service consumers, and can be extracted for any application needing cloud/on-prem switching.
Self-contained function that creates and returns the chat interface Gradio component, including input, output, and event handlers. The component is isolated from the rest of the UI, making it easy to reuse in other Gradio applications or replace with alternative chat widgets.
Modular gallery component that displays generated images with actions for 3D conversion, deletion, and refresh. It uses a grid layout and updates dynamically. Its design pattern of encapsulating both layout and event bindings in a single function is reusable for any image- or asset-browsing UI.