Image-to-3D
Hunyuan3D-2
English
Chinese
text-to-3d

Run this model with HF Jobs

Run tencent/Hunyuan3D-2mini on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/tencent/Hunyuan3D-2mini. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/tencent/Hunyuan3D-2mini on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Request: DOI

#5
by nonnt66v2 - opened

this is an example of a kaggle notebook working to create a 3D shape using this model:

Local Inference on GPU

Model page: https://huggingface.co/tencent/Hunyuan3D-2.1

!pip install --upgrade pip
!hf auth login --token "HF_API_TOKEN"
!git clone https://github.com/Tencent-Hunyuan/Hunyuan3D-2.git
%cd "/kaggle/working/Hunyuan3D-2"
!pwd
!pip install -r requirements.txt
!pip install -e .

for texture

!cd hy3dgen/texgen/custom_rasterizer
!python3 setup.py install
!cd ../../..
!cd hy3dgen/texgen/differentiable_renderer
!python3 setup.py install
**provo inferenza con 30 step e 380 octree_resolution, modello: **

tencent/Hunyuan3D-2/hunyuan3d-dit-v2-0
import time

import torch
from PIL import Image

from hy3dgen.rembg import BackgroundRemover
from hy3dgen.shapegen import Hunyuan3DDiTFlowMatchingPipeline

image_path = '/kaggle/input/datasets/nonnt66/dataset3d1/3d-game-assets-kontext-dev-lora_create-3d-game.png'
image = Image.open(image_path).convert("RGBA")
if image.mode == 'RGB':
rembg = BackgroundRemover()
image = rembg(image)

pipeline = Hunyuan3DDiTFlowMatchingPipeline.from_pretrained(
'tencent/Hunyuan3D-2mini',
subfolder='hunyuan3d-dit-v2-mini-turbo',
variant='fp16'
)

start_time = time.time()
mesh = pipeline(image=image,
num_inference_steps=50,
octree_resolution=380,
num_chunks=20000,
generator=torch.manual_seed(12345),
output_type='trimesh'
)[0]
print("--- %s seconds ---" % (time.time() - start_time))
mesh.export(f'demo.glb')

Sign up or log in to comment