Hunyuan3D-2 icon indicating copy to clipboard operation
Hunyuan3D-2 copied to clipboard

'ModelWorker' object has no attribute 'pipeline_t2i'. Did you mean: 'pipeline_tex'?

Open DrCyanide opened this issue 6 months ago • 2 comments

I'm trying to run the api_server.py locally, and started it with the following commands: python api_server.py --host 0.0.0.0 --port 8080 --model_path tencent/Hunyuan3D-2mini --tex_model_path tencent/Hunyuan3D-2 --enable_tex

From the Blender Addon, I am able to Generate 3D Model and use the Generate Texture features. However, when I try to use the Text Prompt, I get this error:

2025-06-11 13:07:03 | INFO | stdout | Caught Unknown Error 'ModelWorker' object has no attribute 'pipeline_t2i'
2025-06-11 13:07:03 | ERROR | stderr | Traceback (most recent call last):
2025-06-11 13:07:03 | ERROR | stderr |   File "D:\Documents\AI\2D-to-3D\Hunyuan3D-2\api_server.py", line 250, in generate
2025-06-11 13:07:03 | ERROR | stderr |     file_path, uid = worker.generate(uid, params)
2025-06-11 13:07:03 | ERROR | stderr |   File "D:\Documents\AI\2D-to-3D\Hunyuan3D-2\venv\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
2025-06-11 13:07:03 | ERROR | stderr |     return func(*args, **kwargs)
2025-06-11 13:07:03 | ERROR | stderr |   File "D:\Documents\AI\2D-to-3D\Hunyuan3D-2\api_server.py", line 194, in generate
2025-06-11 13:07:03 | ERROR | stderr |     image = self.pipeline_t2i(text)
2025-06-11 13:07:03 | ERROR | stderr | AttributeError: 'ModelWorker' object has no attribute 'pipeline_t2i'. Did you mean: 'pipeline_tex'?

Looking at api_server.py it looks like pipeline_t2i initialization was indeed commented out, but further down in the code it's still trying to use it. It's unclear if this was intentional to optimize load times, or if something got missed when refactoring the code.

Trying to just uncomment the initialization code results in a different set of errors:

2025-06-11 15:21:03 | ERROR | stderr | Traceback (most recent call last):
2025-06-11 15:21:03 | ERROR | stderr |   File "D:\Documents\AI\2D-to-3D\Hunyuan3D-2\api_server.py", line 314, in <module>
2025-06-11 15:21:03 | ERROR | stderr |     worker = ModelWorker(model_path=args.model_path, device=args.device, enable_tex=args.enable_tex,
2025-06-11 15:21:03 | ERROR | stderr |   File "D:\Documents\AI\2D-to-3D\Hunyuan3D-2\api_server.py", line 166, in __init__
2025-06-11 15:21:03 | ERROR | stderr |     self.pipeline_t2i = HunyuanDiTPipeline(
2025-06-11 15:21:03 | ERROR | stderr |   File "D:\Documents\AI\2D-to-3D\Hunyuan3D-2\hy3dgen\text2image.py", line 37, in __init__
2025-06-11 15:21:03 | ERROR | stderr |     self.pipe = AutoPipelineForText2Image.from_pretrained(
2025-06-11 15:21:03 | ERROR | stderr |   File "D:\Documents\AI\2D-to-3D\Hunyuan3D-2\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
2025-06-11 15:21:03 | ERROR | stderr |     return fn(*args, **kwargs)
2025-06-11 15:21:03 | ERROR | stderr |   File "D:\Documents\AI\2D-to-3D\Hunyuan3D-2\venv\lib\site-packages\diffusers\pipelines\auto_pipeline.py", line 443, in from_pretrained
2025-06-11 15:21:03 | ERROR | stderr |     return text_2_image_cls.from_pretrained(pretrained_model_or_path, **kwargs)
2025-06-11 15:21:03 | ERROR | stderr |   File "D:\Documents\AI\2D-to-3D\Hunyuan3D-2\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
2025-06-11 15:21:03 | ERROR | stderr |     return fn(*args, **kwargs)
2025-06-11 15:21:03 | ERROR | stderr |   File "D:\Documents\AI\2D-to-3D\Hunyuan3D-2\venv\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 961, in from_pretrained
2025-06-11 15:21:03 | ERROR | stderr |     loaded_sub_model = load_sub_model(
2025-06-11 15:21:03 | ERROR | stderr |   File "D:\Documents\AI\2D-to-3D\Hunyuan3D-2\venv\lib\site-packages\diffusers\pipelines\pipeline_loading_utils.py", line 709, in load_sub_model
2025-06-11 15:21:03 | ERROR | stderr |     raise ValueError(
2025-06-11 15:21:03 | ERROR | stderr | ValueError: The component <class 'transformers.models.t5.tokenization_t5._LazyModule.__getattr__.<locals>.Placeholder'> of <class 'diffusers.pipelines.pag.pipeline_pag_hunyuandit.HunyuanDiTPAGPipeline'> cannot be loaded as it does not seem to have any of the loading methods defined in {'ModelMixin': ['save_pretrained', 'from_pretrained'], 'SchedulerMixin': ['save_pretrained', 'from_pretrained'], 'DiffusionPipeline': ['save_pretrained', 'from_pretrained'], 'OnnxRuntimeModel': ['save_pretrained', 'from_pretrained'], 'PreTrainedTokenizer': ['save_pretrained', 'from_pretrained'], 'PreTrainedTokenizerFast': ['save_pretrained', 'from_pretrained'], 'PreTrainedModel': ['save_pretrained', 'from_pretrained'], 'FeatureExtractionMixin': ['save_pretrained', 'from_pretrained'], 'ProcessorMixin': ['save_pretrained', 'from_pretrained'], 'ImageProcessingMixin': ['save_pretrained', 'from_pretrained'], 'ORTModule': ['save_pretrained', 'from_pretrained']}.

So I'm not sure what the next steps are for getting this feature to work.

DrCyanide avatar Jun 11 '25 21:06 DrCyanide

same issue

hireshBrem avatar Nov 09 '25 03:11 hireshBrem

also facing the same issue

cbulacan9 avatar Nov 26 '25 22:11 cbulacan9

same here, this simply does not work...

e9169 avatar Dec 07 '25 07:12 e9169