Skip to content

Commit aac78f4

Browse files
committed
Added variant support.
1 parent 7bedd65 commit aac78f4

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

hunyuan_3d_node.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Hunyuan3DImageTo3D:
2020
def INPUT_TYPES(s):
2121
models = [
2222
'tencent/Hunyuan3D-2/hunyuan3d-dit-v2-0',
23-
'tencent/Hunyuan3D-2/hunyuan3d-dit-v2-0-fast',
23+
'tencent/Hunyuan3D-2/hunyuan3d-dit-v2-0-fast[variant=fp16]',
2424
]
2525
return {
2626
"required": {
@@ -37,7 +37,7 @@ def INPUT_TYPES(s):
3737
"tooltip": "Paint needs a lot more VRAM",
3838
}),
3939
"model": (models, {
40-
"tooltip": "huggingface id of model. ie. author/name/subfolder",
40+
"tooltip": "huggingface id of model(author/name/subfolder)", # noqa: E501
4141
}),
4242
}
4343
}
@@ -140,6 +140,12 @@ def process(
140140
# if 'HY3DGEN_MODELS' not in os.environ:
141141
# os.environ['HY3DGEN_MODELS'] = checkpoint_dir
142142

143+
variant = None
144+
variant_m = re.match(r"^(.*)\[variant=([^\]]+)\]$", model)
145+
if variant_m is not None:
146+
model = variant_m.group(1)
147+
variant = variant_m.group(2)
148+
143149
subfolder = None
144150
subfolder_m = re.match(r"^([^/]+/[^/]+)/(.+)$", model)
145151
if subfolder_m is not None:
@@ -167,6 +173,7 @@ def process(
167173
pipeline = Hunyuan3DDiTFlowMatchingPipeline.from_pretrained(
168174
model,
169175
subfolder=subfolder,
176+
variant=variant
170177
)
171178

172179
output_3d_file = Hunyuan3DImageTo3D.get_spare_filename(
@@ -186,7 +193,6 @@ def process(
186193
from hy3dgen.texgen import Hunyuan3DPaintPipeline
187194
pipeline = Hunyuan3DPaintPipeline.from_pretrained(
188195
model,
189-
subfolder=subfolder,
190196
)
191197
mesh = pipeline(mesh, image=input_image_file)
192198

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "comfyui-hunyuan-3d-2"
33
description = "Image to 3D using Hunyuan-3D-2"
4-
version = "0.9.2"
4+
version = "0.9.3"
55
license = {text = "MIT License"}
66

77
[project.urls]

0 commit comments

Comments
 (0)