Turning a single image into a GLB model
Image-to-3D is useful when a project needs a fast 3D starting point instead of a manually built model from scratch.
Tencent’s Hunyuan3D 2.1 is an open-source image-to-3D system. Given a source image, it can generate a mesh and export a result in GLB format. That makes it relevant for product prototypes, web-based 3D previews, game-prop experiments, and early AR concepts.
The result should be treated as a starting asset, not a finished production model. The model has to infer surfaces that are not visible in the input image, so quality still depends heavily on the source image and the final use case.
Official project:
https://github.com/Tencent-Hunyuan/Hunyuan3D-2.1 Start with the right image
For an initial test, choose an image with:
pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 \
--index-url [https://download.pytorch.org/whl/cu124](https://download.pytorch.org/whl/cu124)
pip install -r requirements.txt
The full texture-generation workflow includes additional dependencies. For a first test, it is better to validate that shape generation works before spending time on texture generation and rendering settings.
Run the local interface
Hunyuan3D 2.1 includes a local Gradio interface. After the environment and model files are ready, launch it with:
python3 gradio_app.py \
--model_path tencent/Hunyuan3D-2.1 \
--subfolder hunyuan3d-dit-v2-1 \
--texgen_model_path tencent/Hunyuan3D-2.1 \
--low_vram_mode
Upload a single image, generate the initial model, and export the output as GLB.
The first goal is not to create the perfect asset. It is to confirm that the full path works:
Start the server:
python api_server.py
Then open the local API documentation:
http://localhost:8081/docs A minimal Python request can look like this:
import base64import requestswith open("input_image.png", "rb") as file: image_data = base64.b64encode(file.read()).decode()payload = { "image": image_data, "texture": True, "seed": 42, "type": "glb"}response = requests.post( "http://localhost:8081/generate", json=payload, timeout=600)response.raise_for_status()with open("output_model.glb", "wb") as file: file.write(response.content) The seed is useful when comparing changes. Keep it fixed while testing a new image or parameter, then change it only when you want alternative results.
What to check after export
A generated GLB file can look good from the source angle but still have issues elsewhere. Before using it in a project, inspect:
That is why a sensible first test is:
A cleaner image with one obvious object will usually save more time than endlessly changing parameters. Once the first GLB file is generated, inspect it in the actual environment where it will be used and treat it as an editable starting point.
Official API reference:
https://github.com/Tencent-Hunyuan/Hunyuan3D-2.1/blob/main/API_DOCUMENTATION.md Disclosure: I’m building GanAI360, a Chinese-language AI resource site. I also collected a more detailed Hunyuan3D guide covering image-to-3D generation, ComfyUI workflows, model setup, and GLB export here:https://ganai360.com/news/comfyui-hunyuan3d-2-1-workflow/