Skip to content

Using --enable_t23d with the gradio app breaks #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
maunvz opened this issue May 23, 2025 · 1 comment
Open

Using --enable_t23d with the gradio app breaks #252

maunvz opened this issue May 23, 2025 · 1 comment

Comments

@maunvz
Copy link

maunvz commented May 23, 2025

Using one of the example gradio commands from the readme:

python3 gradio_app.py --model_path tencent/Hunyuan3D-2mini --subfolder hunyuan3d-dit-v2-mini --texgen_model_path tencent/Hunyuan3D-2 --low_vram_mode

The web page shows the following warning:

Warning: Text to 3D is disable. To activate it, please run python gradio_app.py --enable_t23d.

Adding that flag to the command as follows:

python3 gradio_app.py --model_path tencent/Hunyuan3D-2mini --subfolder hunyuan3d-dit-v2-mini --texgen_model_path tencent/Hunyuan3D-2 --low_vram_mode --enable_t23d

Results in a new round of downloads, and a failure to load the models with the following error:

~/git/Hunyuan3D-2 (main ✔) python3 gradio_app.py --model_path tencent/Hunyuan3D-2mini --subfolder hunyuan3d-dit-v2-mini --texgen_model_path tencent/Hunyuan3D-2 --low_vram_mode --enable_t23d
Loading example img list ...
Loading example txt list ...
Loading example mv list ...
Fetching 13 files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:00<00:00, 49255.60it/s]
Fetching 20 files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:00<00:00, 61908.55it/s]
Loading pipeline components...: 100%|██████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:00<00:00, 10.16it/s]
Loading pipeline components...:  33%|██████████████████████████████                                                            | 2/6 [00:00<00:00,  4.52it/s]
An error occurred while trying to fetch /home/nvz/.cache/huggingface/hub/models--tencent--Hunyuan3D-2/snapshots/34e28261f71c32975727be8db0eace439a280f82/hunyuan3d-paint-v2-0-turbo/vae: Error no file named diffusion_pytorch_model.safetensors found in directory /home/nvz/.cache/huggingface/hub/models--tencent--Hunyuan3D-2/snapshots/34e28261f71c32975727be8db0eace439a280f82/hunyuan3d-paint-v2-0-turbo/vae.
Defaulting to unsafe serialization. Pass `allow_pickle=False` to raise an error instead.
Loading pipeline components...: 100%|██████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:09<00:00,  1.50s/it]
Expected types for unet: (<class 'diffusers_modules.local.unet.modules.UNet2p5DConditionModel'>,), got <class 'diffusers_modules.local.modules.UNet2p5DConditionModel'>.
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00,  3.54it/s]
Loading pipeline components...:  43%|██████████████████████████████████████▌                                                   | 3/7 [00:00<00:01,  3.53it/s]
Traceback (most recent call last):
  File "/home/nvz/git/Hunyuan3D-2/gradio_app.py", line 717, in <module>
    t2i_worker = HunyuanDiTPipeline('Tencent-Hunyuan/HunyuanDiT-v1.1-Diffusers-Distilled', device=args.device)
  File "/home/nvz/git/Hunyuan3D-2/hy3dgen/text2image.py", line 37, in __init__
    self.pipe = AutoPipelineForText2Image.from_pretrained(
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        model_path,
        ^^^^^^^^^^^
    ...<2 lines>...
        pag_applied_layers=["blocks.(16|17|18|19)"]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ).to(device)
    ^
  File "/home/nvz/.local/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/nvz/.local/lib/python3.13/site-packages/diffusers/pipelines/auto_pipeline.py", line 443, in from_pretrained
    return text_2_image_cls.from_pretrained(pretrained_model_or_path, **kwargs)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nvz/.local/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/nvz/.local/lib/python3.13/site-packages/diffusers/pipelines/pipeline_utils.py", line 961, in from_pretrained
    loaded_sub_model = load_sub_model(
        library_name=library_name,
    ...<20 lines>...
        provider_options=provider_options,
    )
  File "/home/nvz/.local/lib/python3.13/site-packages/diffusers/pipelines/pipeline_loading_utils.py", line 709, in load_sub_model
    raise ValueError(
    ...<2 lines>...
    )
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']}.

This occurs on the latest main branch, commit 2ee4770

@uanu2002
Copy link

Hi @maunvz , I ran into the same issue. pip install sentencepiece works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants