cannot access local variable 'act_fn' where it is not associated with a value
Expected Behavior
getting this when trying the FRAME PACK MODEL INSTEAD OF IT RUNNING
Actual Behavior
Steps to Reproduce
using the new frame pack model
Debug Logs
!!! Exception during processing !!! cannot access local variable 'act_fn' where it is not associated with a value
Traceback (most recent call last):
File "D:\comfyuistudio\V200\App\ComfyUI\execution.py", line 345, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyuistudio\V200\App\ComfyUI\execution.py", line 220, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyuistudio\V200\App\ComfyUI\execution.py", line 192, in _map_node_over_list
process_inputs(input_dict, i)
File "D:\comfyuistudio\V200\App\ComfyUI\execution.py", line 181, in process_inputs
results.append(getattr(obj, func)(**inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyuistudio\V200\App\ComfyUI\custom_nodes\ComfyUI-FramePackWrapper\nodes.py", line 200, in loadmodel
transformer = HunyuanVideoTransformer3DModelPacked(**config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyuistudio\V200\App\python_embeded\Lib\site-packages\diffusers\configuration_utils.py", line 665, in inner_init
init(self, *args, **init_kwargs)
File "D:\comfyuistudio\V200\App\ComfyUI\custom_nodes\ComfyUI-FramePackWrapper\diffusers_helper\models\hunyuan_video_packed.py", line 739, in __init__
self.context_embedder = HunyuanVideoTokenRefiner(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyuistudio\V200\App\ComfyUI\custom_nodes\ComfyUI-FramePackWrapper\diffusers_helper\models\hunyuan_video_packed.py", line 373, in __init__
self.token_refiner = HunyuanVideoIndividualTokenRefiner(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyuistudio\V200\App\ComfyUI\custom_nodes\ComfyUI-FramePackWrapper\diffusers_helper\models\hunyuan_video_packed.py", line 320, in __init__
[
File "D:\comfyuistudio\V200\App\ComfyUI\custom_nodes\ComfyUI-FramePackWrapper\diffusers_helper\models\hunyuan_video_packed.py", line 321, in <listcomp>
HunyuanVideoIndividualTokenRefinerBlock(
File "D:\comfyuistudio\V200\App\ComfyUI\custom_nodes\ComfyUI-FramePackWrapper\diffusers_helper\models\hunyuan_video_packed.py", line 280, in __init__
self.ff = FeedForward(hidden_size, mult=mlp_width_ratio, activation_fn="linear-silu", dropout=mlp_drop_rate)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyuistudio\V200\App\python_embeded\Lib\site-packages\diffusers\models\attention.py", line 1228, in __init__
self.net.append(act_fn)
^^^^^^
UnboundLocalError: cannot access local variable 'act_fn' where it is not associated with a value
Other
No response
Getting the same issue, using the example FramePack workflow.
Same here
I got around this by installing a newer version (0.33.1) of the diffusers library: https://github.com/kijai/ComfyUI-FramePackWrapper/blob/main/requirements.txt#L2
This is because this line https://github.com/kijai/ComfyUI-FramePackWrapper/blob/main/diffusers_helper/models/hunyuan_video_packed.py#L280 calls diffusers with 'activation_fn="linear-silu" that is not present here in the older versions: https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention.py#L1231
0.33.1 not work.
What Python version are you using?!
I changed to 3.10 and the error disappeared. It occurs with 3.11.
What Python version are you using?!
I changed to 3.10and the error disappeared. It occurs with 3.11.
This error is with Python 3.10.9 too: UnboundLocalError: local variable 'act_fn' referenced before assignment
It was running om python 3.12.9 for me, but I was trying to upgrade comfy version and front end versions today on some containers and now I'm getting this error as well.
The workflow does not work. It will stuck at the first node (Down)load FramePack Model or in Load FramePack Model
The error will appear on Comfy cannot access local variable 'act_fn' where it is not associated with a value
Full update ComfyUI and FramePack solved this error for me! Python 3.10.9
What Python version are you using?!
I changed to 3.10 and the error disappeared. It occurs with 3.11.
I also encountered the same problem. Whether it was replacing the model or updating the diffusers, (the Python version was 3.11.9, and the diffusers version was 0.35.1)
updating solved the problem.