Skip to content

'Hunyuan3DDiTFlowMatchingPipeline' object has no attribute 'scheduler' — but only on a SECOND run #546

@seletskiy

Description

@seletskiy

This is a weird issue. I've managed to install and was able to run the code, it successfully generated 3d shape and textured it using Hunyuan3D 2.1, but when I've tried to run same pipeline a second time (e.g. by hitting 'Run' again), I've got this:

!!! Exception during processing !!! 'Hunyuan3DDiTFlowMatchingPipeline' object has no attribute 'scheduler'
Traceback (most recent call last):
  File "/comfy/execution.py", line 510, in execute
    output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/comfy/execution.py", line 324, in get_output_data
    return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/comfy/execution.py", line 298, in _async_map_node_over_list
    await process_inputs(input_dict, i)
  File "/comfy/execution.py", line 286, in process_inputs
    result = f(**inputs)
             ^^^^^^^^^^^
  File "/comfy/.venv312/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/comfy/custom_nodes/ComfyUI-3D-Pack/nodes.py", line 5432, in generate
    outputs = shapegen_pipe(
              ^^^^^^^^^^^^^^
  File "/comfy/.venv312/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/comfy/custom_nodes/ComfyUI-3D-Pack/Gen_3D_Modules/Hunyuan3D_2_1/hy3dshape/hy3dshape/pipelines.py", line 740, in __call__
    self.scheduler,
    ^^^^^^^^^^^^^^
AttributeError: 'Hunyuan3DDiTFlowMatchingPipeline' object has no attribute 'scheduler'

I've put print(dir(self)) before offending line, and yes, indeed there is no scheduler attribute in the class anymore (it was there on the first run):
['__call__', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_exclude_from_cpu_offload', '_execution_device', '_export', 'compile', 'conditioner', 'device', 'dtype', 'enable_flashvdm', 'enable_model_cpu_offload', 'encode_cond', 'from_pretrained', 'from_single_file', 'get_guidance_scale_embedding', 'image_processor', 'kwargs', 'maybe_free_model_hooks', 'model', 'model_cpu_offload_seq', 'prepare_extra_step_kwargs', 'prepare_image', 'prepare_latents', 'set_surface_extractor', 'to']

What's even funnier is that object address stays the same accross two runs, so I can't even imagine what may cause one attribute to magically disappear:

<hy3dshape.pipelines.Hunyuan3DDiTFlowMatchingPipeline object at 0x7fc360768470>
...
<hy3dshape.pipelines.Hunyuan3DDiTFlowMatchingPipeline object at 0x7fc360768470>

I've briefly inspected the code, but was unable to find any way it could be erased from existence. I've tried some stupid things such as renaming class attributes to see whether or not it would help, but it just stopped worked entirely (e.g. just hanging on diffuse step without any error whatsoever).

Any ideas how to even approach that?

I don't have much, but here is a donut I've generated:

0001-0360.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions