Latest news
Rhino 8 Guide to Offsetting Surfaces, Creating Shells, and Joining ObjectsExporting Images in Houdini Copernicus: An Image ROP GuideA Guide to Building a Remote Control Panel with Unreal EngineBlender Cycles Denoising Guide: Step-by-Step Settings for Cleaner RendersEmbedding Textures in Blender Projects: A Guide to Packing ResourcesBlender Face Picker released: Animate facial expressions without building a rigUnreal Engine Virtual Shadow Maps Guide: Shadow Quality with 8 SettingsBlender Light Linking Guide: Control Lighting by Object in Architectural ScenesCurve Sculpt 3D Applies Sculpting Brushes Along Surfaces in BlenderRendering in Blender from the Command Line: Still Frames and Animation
TutorialsHunyuan3D

How to Generate 3D Models and Textures from Images with Hunyuan3D 2.0

Hunyuan3D 2.0 is a two-stage system: it first generates a mesh based on an image, then produces a texture map for that mesh. This guide covers the basic workflow using Python examples from the official repository.

A 3D decorative object on a desk in an architecture studio workspaceAI image
Representative image, generated with AI.Image: 3dsınıfı / FCA AI

In brief

  1. Hunyuan3D 2.0 handles shape generation and texture synthesis in separate stages.
  2. Hunyuan3D-DiT generates a mesh from an image, while Hunyuan3D-Paint applies textures.
  3. The setup instructions cover PyTorch, a requirements file, and additional installation steps for the texturing components.
  4. The source says the output can be saved as GLB, OBJ, or another format.

What will you learn in this guide?

You’ll learn how to create a basic 3D mesh from a reference image with Hunyuan3D 2.0, then generate a texture for that mesh. Instead of generating geometry and texture in a single operation, the system splits the process into two stages: Hunyuan3D-DiT creates the shape, while Hunyuan3D-Paint synthesizes a texture for a generated or manually prepared mesh. This separation lets you inspect the geometry first, then focus on the material appearance.

The example here uses the Python API in the Hunyuan3D repository. The code takes an image file as input and returns a mesh object. This guide does not guarantee a particular level of output quality or that the process will work the same way for every architectural object. The source provides no specific figures for hardware requirements, VRAM, or model runtime, so these should not be estimated.

Requirements and preparation

The official repository instructs users to install PyTorch first, then install the other dependencies from the requirements.txt file. Texture generation also requires two additional components: custom_rasterizer and differentiable_renderer. The source does not specify a fixed PyTorch or Python version here. Check the repository’s latest setup instructions and the requirements for the model weights you plan to use before proceeding.

For this example, you’ll need access to a terminal, a Python environment, the repository code, and Hunyuan3D 2.0 model files. The source also notes that you can use the ready-made Gradio interface, but this guide uses the Python API to make each step explicit. The source does not say whether a user account is required. A local installation is available as an alternative to running the model as an online service, but the source provides no definitive hardware requirements.

Set the input image path to match your own file. The example uses assets/demo.png, which is a sample path in the repository and does not mean that the same file will be present in every installation. If you’re using your own image, make sure the file path is correct.

Step-by-step: generating a mesh from an image

1. Install the required dependencies. First, install PyTorch by following the official instructions. Then install the other requirements from the repository folder:

bash
pip install -r requirements.txt

If you also plan to generate textures, run the following installation steps. Your terminal needs to be in the repository’s root directory for the commands to work:

bash
cd hy3dgen/texgen/custom_rasterizer
python3 setup.py install
cd hy3dgen/texgen/differentiable_renderer
bash compile_mesh_painter.sh

The second cd command may not work when run relative to the first folder, so check your current directory as you execute each command. The source lists these steps but provides no alternative commands for different operating systems or Python environments.

2. Load the shape-generation pipeline. The example below starts the Hunyuan3D-DiT pipeline using the pretrained model in the repository. Replace the image path in the code with your own file:

python
from hy3dgen.shapegen import Hunyuan3DDiTFlowMatchingPipeline

pipeline = Hunyuan3DDiTFlowMatchingPipeline.from_pretrained(
    'tencent/Hunyuan3D-2'
)
mesh = pipeline(image='assets/demo.png')[0]

The pipeline object loads the model, and the image is processed through the image parameter. In this example, the first item in the result list is assigned to the mesh variable. According to the source, this output is a trimesh object. If you encounter model download or memory issues, check the setup and model access rather than randomly changing settings that the source does not specify.

3. Inspect the geometry. Once the mesh has been generated, evaluate it in your 3D software or a suitable viewer before moving on to texturing. The source says the output can be saved as GLB, OBJ, or another format, but the README does not provide a detailed save command for the code used here. Before choosing an export method for your project, verify that the trimesh object is compatible with the formats supported by your target application.

4. Generate a texture for the mesh. In the texturing stage, the same reference image is passed to the Hunyuan3D-Paint pipeline along with the mesh:

python
from hy3dgen.texgen import Hunyuan3DPaintPipeline
from hy3dgen.shapegen import Hunyuan3DDiTFlowMatchingPipeline

shape_pipeline = Hunyuan3DDiTFlowMatchingPipeline.from_pretrained(
    'tencent/Hunyuan3D-2'
)
mesh = shape_pipeline(image='assets/demo.png')[0]

paint_pipeline = Hunyuan3DPaintPipeline.from_pretrained(
    'tencent/Hunyuan3D-2'
)
mesh = paint_pipeline(mesh, image='assets/demo.png')

The example first generates the shape, then passes the resulting mesh and image to the texturing pipeline. In your own workflow, you can use the mesh from the previous step; the key is to provide both the mesh and the image condition to the texturing pipeline. The source says Hunyuan3D-Paint can apply textures to generated or manually prepared meshes.

5. Alternatively, try the local interface. The source also offers the option to launch a local interface with the Gradio app for quick tests without writing code. Gradio is installed with the version pinned in the repository instructions, then the app is run:

bash
pip3 install gradio==3.39.0
python3 gradio_app.py

Whether this method works depends on having the repository files and dependencies installed. The source does not guarantee that the interface will run smoothly on every operating system or hardware configuration.

Common issues and implications for architectural workflows

The most basic mistake is running the example without changing the sample image path. If assets/demo.png cannot be found, the input cannot be loaded; check the file path and extension. Another common issue is skipping the installation steps for the texturing components. You may not need the texturing setup if you only plan to generate shapes, but the additional components listed in the source are important for the Hunyuan3D-Paint stage.

It can also be misleading to treat shape and texture generation as a single result. The system’s two-stage design lets you handle the geometry output separately from texture generation. Architecture, interior design, and archviz teams could explore it for testing objects or decorative elements at the concept stage. However, the source makes no claims about architectural accuracy, dimensional precision, BIM compatibility, or suitability as a production-ready file. Check format compatibility and inspect the geometry before using a generated mesh in a project.

Next steps

Once the basic workflow is working, try shape generation separately with different reference images, then add the texturing step. This makes it easier to tell whether an issue comes from the image input, geometry generation, or the texturing setup. For advanced options such as text-to-3D generation and texturing manually prepared meshes, the source points to the minimal_demo.py file. Review its parameters and the latest repository instructions before using these features.

For architectural production, it’s safer to treat the result as a starting asset that needs validation, not as a final model. The source provides no details about hardware, the commercial-use implications of the license, or compatibility with specific 3D software. Before adopting it in an office workflow, check the model license, your organization’s project requirements, and whether the exported file opens in the target software.

Source and license

This guide is adapted from the setup and API examples in the README of Tencent’s Hunyuan3D 2.0 Hugging Face repository. The source record is marked as open-licensed, but the README’s model card lists the license name as “Tencent Hunyuan Community License”. Review the license terms specified in the repository before using the model or its weights.

Sources

1 source
H(
huggingface.co (Apache-2.0)huggingface.co/tencent/Hunyuan3D-2/blob/fb35d48b9ceca5439d03a2b8345fd6fbffe02119/README.md
Summary

Source texts are not republished; short quotes are marked, everything else is our own summary and commentary.

3dsınıfı’s take
3dEditor’s assessment

For architecture and visualization teams in Turkey, this workflow could be useful for quickly testing concept objects and generating starter meshes from different references. Its two-stage design makes it easier to inspect shape and texture separately, but generated geometry should not be assumed to be dimensionally accurate, BIM-compatible, or ready for project delivery.

Before making a decision in an office, review the model license and commercial-use terms. If you plan to run it locally, verify the hardware requirements separately. Since the source provides no specific GPU or memory figures, it would be unwise to assume existing workstations will be sufficient. It’s best to start with a small test and check format compatibility with your target 3D software.

Frequently asked questions

How does Hunyuan3D 2.0 create a 3D model from an image?

Hunyuan3D-DiT first generates a mesh based on the image. Hunyuan3D-Paint can then synthesize a texture for that mesh.

Which file formats can Hunyuan3D 2.0 output be saved in?

The repository says the mesh can be saved as GLB, OBJ, or another format. The README does not provide detailed export code for the example used in this guide.

What setup steps are required for Hunyuan3D 2.0?

The source instructs users to install PyTorch first, then install the dependencies in the `requirements.txt` file. It also includes additional steps for the `custom_rasterizer` and `differentiable_renderer` components used for texture generation.

Comments and the forum are in Turkish.Join the discussion
+

Related news