ComfyUI-WanVideoWrapper icon indicating copy to clipboard operation
ComfyUI-WanVideoWrapper copied to clipboard

cannot access local variable 'image' where it is not associated with a value

Open zhangfeifei0907 opened this issue 1 year ago • 2 comments

When I use wanvideo context options and wanvideo Slg together, an error:cannot access local variable 'image' where it is not associated with a value. but I load image,why it error this? my environment is 4060ti 16g windows11.and when I delete " wanvideo context options node",it work fine.

Image

self.previous_noise_pred_context.shape torch.Size([16, 15, 104, 60])

30%|████████████████████████▉ | 6/20 [03:17<07:40, 32.89s/it]

!!! Exception during processing !!! cannot access local variable 'image' where it is not associated with a value

Traceback (most recent call last):

File "G:\comfyui\v0.3.15ComfyUI_windows_portable_nvidia\ComfyUI\execution.py", line 327, 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 "G:\comfyui\v0.3.15ComfyUI_windows_portable_nvidia\ComfyUI\execution.py", line 202, 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 "G:\comfyui\v0.3.15ComfyUI_windows_portable_nvidia\ComfyUI\execution.py", line 174, in _map_node_over_list

process_inputs(input_dict, i)

File "G:\comfyui\v0.3.15ComfyUI_windows_portable_nvidia\ComfyUI\execution.py", line 163, in process_inputs

results.append(getattr(obj, func)(**inputs))

^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "G:\comfyui\v0.3.15ComfyUI_windows_portable_nvidia\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\nodes.py", line 1789, in process

partial_img_emb[:, 0, :, :] = torch.cat([image[0][:,0,:,:], mask], dim=0)

^^^^^

UnboundLocalError: cannot access local variable 'image' where it is not associated with a value

zhangfeifei0907 avatar Mar 15 '25 09:03 zhangfeifei0907

i also have the same problem

aurorascy avatar Mar 15 '25 16:03 aurorascy

It should work with the latest code.

kijai avatar Mar 15 '25 16:03 kijai