{"slug": "building-an-image-to-glb-workflow-with-hunyuan3d-2-1", "title": "Building an Image-to-GLB Workflow with Hunyuan3D 2.1", "summary": "A developer documented a workflow for turning a single image into a GLB 3D model using Tencent's open-source Hunyuan3D 2.1, covering local setup with PyTorch 2.5.1, launching the bundled Gradio interface in low-VRAM mode, and calling the local API server to generate textured meshes. The writeup stresses that outputs should be treated as editable starting assets rather than finished production models, since the system must infer surfaces not visible in the source image, and recommends fixing the seed while testing and inspecting results in the target environment.", "body_md": "Turning a single image into a GLB model\n\nImage-to-3D is useful when a project needs a fast 3D starting point instead of a manually built model from scratch.\n\nTencent’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.\n\nThe 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.\n\nOfficial project:\n\n[https://github.com/Tencent-Hunyuan/Hunyuan3D-2.1](https://github.com/Tencent-Hunyuan/Hunyuan3D-2.1)\n\nStart with the right image\n\nFor an initial test, choose an image with:\n\npip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 \\\n\n  --index-url [https://download.pytorch.org/whl/cu124](https://download.pytorch.org/whl/cu124)\n\npip install -r requirements.txt\n\nThe 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.\n\nRun the local interface\n\nHunyuan3D 2.1 includes a local Gradio interface. After the environment and model files are ready, launch it with:\n\npython3 gradio_app.py \\\n\n  --model_path tencent/Hunyuan3D-2.1 \\\n\n  --subfolder hunyuan3d-dit-v2-1 \\\n\n  --texgen_model_path tencent/Hunyuan3D-2.1 \\\n\n  --low_vram_mode\n\nUpload a single image, generate the initial model, and export the output as GLB.\n\nThe first goal is not to create the perfect asset. It is to confirm that the full path works:\n\nStart the server:\n\npython api_server.py\n\nThen open the local API documentation:\n\n[http://localhost:8081/docs](http://localhost:8081/docs)\n\nA minimal Python request can look like this:\n\nimport 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](http://localhost:8081/generate)\",    json=payload,    timeout=600)response.raise_for_status()with open(\"output_model.glb\", \"wb\") as file:    file.write(response.content)\n\nThe 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.\n\nWhat to check after export\n\nA generated GLB file can look good from the source angle but still have issues elsewhere. Before using it in a project, inspect:\n\nThat is why a sensible first test is:\n\nA 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.\n\nOfficial API reference:\n\n[https://github.com/Tencent-Hunyuan/Hunyuan3D-2.1/blob/main/API_DOCUMENTATION.md](https://github.com/Tencent-Hunyuan/Hunyuan3D-2.1/blob/main/API_DOCUMENTATION.md)\n\nDisclosure: 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/](https://ganai360.com/news/comfyui-hunyuan3d-2-1-workflow/)", "url": "https://wpnews.pro/news/building-an-image-to-glb-workflow-with-hunyuan3d-2-1", "canonical_source": "https://dev.to/steve_019d4db7e87ce55ae3d/building-an-image-to-glb-workflow-with-hunyuan3d-21-4e3g", "published_at": "2026-11-26 09:35:14+00:00", "updated_at": "2026-11-26 09:43:17.268658+00:00", "lang": "en", "topics": ["artificial-intelligence", "generative-ai", "ai-tools", "computer-vision", "ai-products"], "entities": ["Tencent", "Hunyuan3D 2.1", "Gradio", "PyTorch", "GanAI360"], "also_reported_by": [], "takeaway": "Hunyuan3D 2.1 can turn a single image into an exported GLB via its local Gradio app or API server, but the mesh is only a starting asset—validate shape generation before texture generation and keep the seed fixed while testing.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/building-an-image-to-glb-workflow-with-hunyuan3d-2-1", "markdown": "https://wpnews.pro/news/building-an-image-to-glb-workflow-with-hunyuan3d-2-1.md", "text": "https://wpnews.pro/news/building-an-image-to-glb-workflow-with-hunyuan3d-2-1.txt", "jsonld": "https://wpnews.pro/news/building-an-image-to-glb-workflow-with-hunyuan3d-2-1.jsonld"}}