Skip to content

KeyError in cache_update #10402

@v3i1y

Description

@v3i1y

Custom Node Testing

Expected Behavior

no errors

Actual Behavior

I started to recently get following errors randomly after upgrading to the latest comfyui

    self._target(*self._args, **self._kwargs)

  File "/root/comfy/ComfyUI/main.py", line 195, in prompt_worker

    e.execute(item[2], prompt_id, item[3], item[4])

  File "/root/comfy/ComfyUI/execution.py", line 655, in execute

    asyncio.run(self.execute_async(prompt, prompt_id, extra_data, execute_outputs))

  File "/opt/conda/lib/python3.11/asyncio/runners.py", line 190, in run

    return runner.run(main)

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

  File "/opt/conda/lib/python3.11/asyncio/runners.py", line 118, in run

    return self._loop.run_until_complete(task)

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

  File "/opt/conda/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete

    return future.result()

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

  File "/root/comfy/ComfyUI/execution.py", line 701, in execute_async

    result, error, ex = await execute(self.server, dynamic_prompt, self.caches, node_id, extra_data, executed, prompt_id, execution_list, pending_subgraph_results, pending_async_nodes)

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

  File "/root/comfy/ComfyUI/execution.py", line 409, in execute

    execution_list.cache_update(unique_id, caches.outputs.get(unique_id))

  File "/root/comfy/ComfyUI/comfy_execution/graph.py", line 220, in cache_update

    self.execution_cache[to_node_id][node_id] = value

    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^

KeyError: '7'

I saw the code in the error is from some very recent commit, that might have introduced some bug?

Steps to Reproduce

it happens randomly not really sure how to reproduce consistently

Debug Logs

provided above

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Potential BugUser is reporting a bug. This should be tested.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions