Instructions to use OzzyGT/hunyuan3d_2mini_turbo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use OzzyGT/hunyuan3d_2mini_turbo with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("OzzyGT/hunyuan3d_2mini_turbo", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Hunyuan3D-2mini Turbo
Generated with the code below (seed 42, 30 steps, octree resolution 380).
This is tencent/Hunyuan3D-2mini, the step-distilled turbo checkpoint (hunyuan3d-dit-v2-mini-turbo), repacked into the Diffusers format with the original fp16 weights. It runs as a Modular Diffusers pipeline with the Hunyuan3D-2mini custom blocks and generates an untextured 3D shape from a single image.
Note: You need diffusers>=0.41.0 and scikit-image. The example also uses trimesh to save the mesh.
Usage
The custom blocks load the model code shipped in this repository, hence trust_remote_code and trust_components_code.
Note: both flags run Python code downloaded from the Hub: trust_remote_code=True runs the code of the blocks repository, and trust_components_code=True runs the code shipped in the components_repo. Only use them with repositories you trust, and review their code before passing different ones.
import torch
import trimesh
from diffusers import ModularPipelineBlocks
from diffusers.utils import load_image
blocks = ModularPipelineBlocks.from_pretrained(
"OzzyGT/hunyuan3d_2mini_custom_blocks",
trust_remote_code=True,
components_repo="OzzyGT/hunyuan3d_2mini_turbo",
trust_components_code=True,
)
pipe = blocks.init_pipeline()
pipe.load_components(dtype=torch.float16)
pipe.to("cuda")
image = load_image(
"https://huggingface.co/datasets/OzzyGT/diffusers-examples/resolve/main/hunyuan3d_2mini/20261016231355.png",
convert_method=lambda image: image.convert("RGBA"),
)
mesh = pipe(
image=image,
num_inference_steps=30,
octree_resolution=380,
generator=torch.Generator().manual_seed(42),
output="meshes",
)[0]
trimesh.Trimesh(mesh["vertices"], mesh["faces"]).export("shape.glb")
The input is an image of a single object with a transparent background.
License
This model is released under the Tencent Hunyuan 3D 2.0 Community License, the same as the original; see also the NOTICE. The license does not apply in the European Union, the United Kingdom and South Korea. Powered by Tencent Hunyuan.
- Downloads last month
- 1
Model tree for OzzyGT/hunyuan3d_2mini_turbo
Base model
tencent/Hunyuan3D-2mini