Skip to content

Updated comfy-core- nodes_easycache.py produces error about 'Tensor' and 'tuple' - Type error? #12340

@GlamoramaAttack

Description

@GlamoramaAttack

Custom Node Testing

Expected Behavior

Yesterday my LTX2 workflow worked correct with the "LazyCache" (comfy-core Beta)- node. Today, after updating Comfy, it produced the error message, excerpt in debug log.

Bypassing the node let's the sampler (LTXV Normalizing Sampler) generate again without further failures.

I think it's not related to the sampler, but as the error message says a type error in ComfyUI\comfy_extras\nodes_easycache.py .

ChatGPT thinks it should be (from line 457 on):

def update_cache_diff(self, output, x):
    if isinstance(output, tuple):
        output = output[0]
    if isinstance(x, tuple):
        x = x[0]

    self.cache_diff = output - x

But that looks very different. And ChatGPT's self-assurance should be mistrusted - writing about an "update" as if there was only one:

Because since the update, ComfyUI returns multiple values ​​for some samplers.
However, EasyCache was written for the old API, which always returned only one tensor.
The patch:
doesn't break anything
is compatible with old and new ComfyUI versions

Actual Behavior

see above

Steps to Reproduce

I recreated the LazyCache node (0.10.0), it has now an updated version number (0.12.3), but it produces the same error message.

Debug Logs

Requested to load LTXAV (...)
Exception during processing !!! unsupported operand type(s) for -: 'Tensor' and 'tuple'
Traceback (most recent call last):
  File "D:\ComfyUI\execution.py", line 527, in execute
(...)
  File "D:\ComfyUI\execution.py", line 331, in get_output_data
(...)
  File "D:\ComfyUI\comfy_extras\nodes_easycache.py", line 150, in lazycache_predict_noise_wrapper
    easycache.update_cache_diff(output, next_x_prev)
  File "D:\ComfyUI\comfy_extras\nodes_easycache.py", line 458, in update_cache_diff
    self.cache_diff = output - x
                      ~~~~~~~^~~
TypeError: unsupported operand type(s) for -: 'Tensor' and 'tuple'

See also:
Comfy-Core type error in: #12331

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions