ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

AttributeError: module 'tensorflow' has no attribute 'Tensor'

Open HeinzZysset opened this issue 9 months ago • 41 comments

AttributeError: module 'tensorflow' has no attribute 'Tensor'

Solution success:

def is_appropriate_type(self, tensor): return False

It works, but now appears follow message after rendering:

Prompt executed in 75.37 seconds Exception in callback _ProactorBasePipeTransport._call_connection_lost(None) handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)> Traceback (most recent call last): File "asyncio\events.py", line 84, in _run File "asyncio\proactor_events.py", line 165, in _call_connection_lost ConnectionResetError: [WinError 10054] Eine vorhandene Verbindung wurde vom Remotehost geschlossen

Any ideas for solve?

Originally posted by @HeinzZysset in #6154

HeinzZysset avatar May 02 '25 15:05 HeinzZysset

I just got hit with this myself after I updated.

DarkAlchy avatar May 07 '25 04:05 DarkAlchy

I just got hit with this myself after I updated.

Yes, i have exactly the same after update. But the rendering result is absolute correct. Anyway, its a error and must be solve.

HeinzZysset avatar May 09 '25 05:05 HeinzZysset

same error

gohan2091 avatar May 09 '25 20:05 gohan2091

I have a new one after I had to delete venv and start over. Transformers package not found. Please install with: pip install transformers torch. Ahem, I checked and torch is installed as is transformers.

DarkAlchy avatar May 10 '25 01:05 DarkAlchy

you have to change the ckpt in load checkpoint

nivaldoalmeida avatar May 10 '25 12:05 nivaldoalmeida

As a result of this bug, my ComfyUI copilot no longer works. The internet connection is completely interrupted. While ComfyUI attempts to reestablish the connection, it immediately terminates with the error message:

Exception in callback _ProactorBasePipeTransport._call_connection_lost(None) handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)> Traceback (most recent call last): File "asyncio\events.py", line 84, in _run File "asyncio\proactor_events.py", line 165, in _call_connection_lost ConnectionResetError: [WinError 10054] An existing connection was closed by the remote host.

Would it be too much to ask that someone finally take this bug seriously and come up with a solution? Honestly, I feel like the developers are screwing me over. I'm a user, not a programmer, and I can't dig through all the countless Python scripts to find bugs. Please only release fully tested nodes, not beta versions. I'm not a beta tester, just a user. :(

HeinzZysset avatar May 12 '25 00:05 HeinzZysset

I am pretty ignorant in all of this, i.e. , programs and expressions etc. So this might be ridiculous. but I went to reinstall tensorflow and said something about not working on windows native anymore. I had also noticed under gpu it said native on startup now, while it never had b4. So I just switched over to wsl and everything that wasn't working flux, f-lite, etc. Works great now. Might be overkill but couldn't figure anything else out. Great simple tutorial

https://github.com/alisson-anjos/ComfyUI_Tutoriais/blob/main/WSL/install.md

Two82 avatar May 13 '25 07:05 Two82

Same problem here, has anyone been able to find the solution?

Beltarm avatar May 15 '25 12:05 Beltarm

Yes, I had to roll back to my April 10 zip save of my entire ComfyUI folder and it works again. Apparently, Comfy expects us to use the .exe (I never ever will) or to have an old version installed (where Flux works) and a new version (where acestep works).

DarkAlchy avatar May 15 '25 15:05 DarkAlchy

pulled the latest version (1hr ago) issue persists. I'm seeing more and more people have this problem, its wide spread

pristinaai avatar May 22 '25 13:05 pristinaai

Precisely. Of course Comfy's stupid exe (I call it stupid but ymmv) didn't seem to have this issue. I would love to know where the real issue lies if it is upstream or in Comfy itself?

DarkAlchy avatar May 23 '25 06:05 DarkAlchy

Same issue (again)

gohan2091 avatar May 25 '25 23:05 gohan2091

Same problem :-((

SamplerCustomAdvanced module 'tensorflow' has no attribute 'Tensor'

ComfyUI Error Report

Error Details

  • Node ID: 398
  • Node Type: SamplerCustomAdvanced
  • Exception Type: AttributeError
  • Exception Message: module 'tensorflow' has no attribute 'Tensor'

Stack Trace


**Question: Is there a way to downgrade ComfyUI because that Error not exists with my workflows before.**

aprisma2008 avatar May 26 '25 10:05 aprisma2008

the error is within the stuff comfyui installs in the venv (you are using venv and not that portable thing, right?). Basically, you have to roll back to April-ish, delete the venv, then let it rip, but do not allow it to upgrade itself. Basically, pip install -r requirements.txt and activating the venv. If you are on portable then you are on your own with that one as I ditched it years ago now for this very exact reason.

DarkAlchy avatar May 26 '25 19:05 DarkAlchy

I made a lot of tests with differnt comfy-installation on my pc. It seems that I only have this problem if I install this:

507 ComfyUI-ituls-nodes 1.2.9 And even if I do a deinstall the error stays:

SamplerCustomAdvanced module 'tensorflow' has no attribute 'Tensor'

aprisma2008 avatar May 26 '25 22:05 aprisma2008

the error is within the stuff comfyui installs in the venv (you are using venv and not that portable thing, right?). Basically, you have to roll back to April-ish, delete the venv, then let it rip, but do not allow it to upgrade itself. Basically, pip install -r requirements.txt and activating the venv. If you are on portable then you are on your own with that one as I ditched it years ago now for this very exact reason.

Thank you. Can you tell me the rip command to go back? I did that long time ago but cant remember. And yes using venv. So the orginal comfyui windows install from comfy.org

aprisma2008 avatar May 26 '25 22:05 aprisma2008

I just find an older version (April) and git checkout that version then pip install -r requirements.txt.

I am not sure what changed, but supposedly (people are telling me this and I am, for one, not happy about it if true) ComfyAnon wants us on his exe. For me, that is not what opensource is about. OSS has always been to download the code then you control if to compile it/install it. Comes back from the 1990s for me and Linux. Pre compiled binaries are a security risk (regardless where they come from) which was drilled into me in the late 1990s and early 2k's from the open source community to now with this change in attitudes about it.

I hope this is false info because that is going down the road of, oh, say, OpenAI which is anything but open.

DarkAlchy avatar May 27 '25 12:05 DarkAlchy

Same issue but wih KSampler

ComfyUI Error Report

Error Details

  • Node ID: 3
  • Node Type: KSampler
  • Exception Type: AttributeError
  • Exception Message: module 'tensorflow' has no attribute 'Tensor'

Stack Trace

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\execution.py", line 349, 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:\SD\ComfyUI_windows_portable\ComfyUI\execution.py", line 224, 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:\SD\ComfyUI_windows_portable\ComfyUI\execution.py", line 196, in _map_node_over_list
    process_inputs(input_dict, i)

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\execution.py", line 185, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1516, in sample
    return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1483, in common_ksampler
    samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\sample.py", line 45, in sample
    samples = sampler.sample(noise, positive, negative, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 1139, in sample
    return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 1029, in sample
    return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 1014, in sample
    output = executor.execute(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\patcher_extension.py", line 111, in execute
    return self.original(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 982, in outer_sample
    output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 965, in inner_sample
    samples = executor.execute(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\patcher_extension.py", line 111, in execute
    return self.original(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 744, in sample
    samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\k_diffusion\sampling.py", line 161, in sample_euler
    denoised = model(x, sigma_hat * s_in, **extra_args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 396, in __call__
    out = self.inner_model(x, sigma, model_options=model_options, seed=seed)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 945, in __call__
    return self.predict_noise(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 948, in predict_noise
    return sampling_function(self.inner_model, x, timestep, self.conds.get("negative", None), self.conds.get("positive", None), self.cfg, model_options=model_options, seed=seed)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 376, in sampling_function
    out = calc_cond_batch(model, conds, x, timestep, model_options)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 206, in calc_cond_batch
    return executor.execute(model, conds, x_in, timestep, model_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\patcher_extension.py", line 111, in execute
    return self.original(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 325, in _calc_cond_batch
    output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\model_base.py", line 141, in apply_model
    return comfy.patcher_extension.WrapperExecutor.new_class_executor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\patcher_extension.py", line 111, in execute
    return self.original(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\model_base.py", line 174, in _apply_model
    model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\ComfyUI\comfy\ldm\flux\model.py", line 196, in forward
    img = rearrange(x, "b c (h ph) (w pw) -> b (h w) (c ph pw)", ph=patch_size, pw=patch_size)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\python_embeded\Lib\site-packages\einops\einops.py", line 600, in rearrange
    return reduce(tensor, pattern, reduction="rearrange", **axes_lengths)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\python_embeded\Lib\site-packages\einops\einops.py", line 527, in reduce
    backend = get_backend(tensor)
              ^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\python_embeded\Lib\site-packages\einops\_backends.py", line 33, in get_backend
    if backend.is_appropriate_type(tensor):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\SD\ComfyUI_windows_portable\python_embeded\Lib\site-packages\einops\_backends.py", line 358, in is_appropriate_type
    return isinstance(tensor, (self.tf.Tensor, self.tf.Variable))
                               ^^^^^^^^^^^^^^

inglob avatar May 28 '25 00:05 inglob

same issue

notahaxxor avatar May 28 '25 11:05 notahaxxor

Same problem. What's going on?

GlowSuperCat avatar Jun 05 '25 22:06 GlowSuperCat

The bigger question should be, "why the silence from the comfy team after all this?"

DarkAlchy avatar Jun 05 '25 23:06 DarkAlchy

crickets. not one developer chime in and acknowledge this major bug?

offmybach avatar Jun 06 '25 19:06 offmybach

having the same problem :(

angelika3377 avatar Jun 07 '25 09:06 angelika3377

same problem but in various nodes, Sampler is fine but after reaching some nodes (for example FaceParsing) in workflow it crash with this error...

tomiisp avatar Jun 09 '25 22:06 tomiisp

same one here, in fact it started after installing a custom node I have got the feel, however the log is gone apparently. Left over to share is only this:

[2025-06-11 16:23:58.194] !!! Exception during processing !!! module 'tensorflow' has no attribute 'Tensor' [2025-06-11 16:23:58.197] Traceback (most recent call last): File "E:\ComfyUI_windows_portable\ComfyUI\execution.py", line 349, 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 "E:\ComfyUI_windows_portable\ComfyUI\execution.py", line 224, 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 "E:\ComfyUI_windows_portable\ComfyUI\execution.py", line 196, in _map_node_over_list process_inputs(input_dict, i) File "E:\ComfyUI_windows_portable\ComfyUI\execution.py", line 185, in process_inputs results.append(getattr(obj, func)(**inputs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_windows_portable\ComfyUI\comfy_extras\nodes_wan.py", line 232, in encode reference_image = vae.encode(reference_image[:, :, :, :3]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_windows_portable\ComfyUI\comfy\sd.py", line 639, in encode out = self.first_stage_model.encode(pixels_in).to(self.output_device).float() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_windows_portable\ComfyUI\comfy\ldm\wan\vae.py", line 512, in encode out = self.encoder( ^^^^^^^^^^^^^ File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_windows_portable\ComfyUI\comfy\ldm\wan\vae.py", line 325, in forward x = layer(x, feat_cache, feat_idx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_windows_portable\ComfyUI\comfy\ldm\wan\vae.py", line 137, in forward x = rearrange(x, 'b c t h w -> (b t) c h w') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\einops\einops.py", line 600, in rearrange return reduce(tensor, pattern, reduction="rearrange", **axes_lengths) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\einops\einops.py", line 527, in reduce backend = get_backend(tensor) ^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\einops_backends.py", line 55, in get_backend if backend.is_appropriate_type(tensor): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\einops_backends.py", line 358, in is_appropriate_type return isinstance(tensor, (self.tf.Tensor, self.tf.Variable)) ^^^^^^^^^^^^^^ AttributeError: module 'tensorflow' has no attribute 'Tensor'

SimonTSorcerer avatar Jun 11 '25 14:06 SimonTSorcerer

having the same problem :( :( :( :( :( :( :(

adiresana avatar Jun 14 '25 02:06 adiresana

Fix for ComfyUI Error: module 'tensorflow' has no attribute 'Tensor' Issue Running a Flux model workflow in ComfyUI resulted in an AttributeError: module 'tensorflow' has no attribute 'Tensor' due to einops trying to access TensorFlow's Tensor attribute. Solution

Checked TensorFlow version:pip show tensorflow

Found version 2.17.1. Attempted to update TensorFlow:pip install --upgrade tensorflow

Encountered dependency conflicts with tensorflow-intel, ml-dtypes, protobuf, and tensorboard. Downgraded to TensorFlow 2.17.0:pip install tensorflow==2.17.0

Conflicts resolved, but error persisted. Uninstalled TensorFlow completely:pip uninstall tensorflow tensorflow-intel

Confirmed with pip show tensorflow. Installed einops version 0.8.0:pip install einops==0.8.0

Verified einops version:pip show einops

Re-ran the workflow, which worked.

Result Workflow ran successfully without the TensorFlow error.

timahhks avatar Jun 14 '25 21:06 timahhks

I need more reports of success as I been down that rabbit hole before, many, many times with ComfyUI, so I'll wait this one out. All these dependencies is why the rabbit hole exists. It actually leads to hades itself. Satan was alright, but I had to crawl out a few times (not easy).

DarkAlchy avatar Jun 15 '25 15:06 DarkAlchy

you have to change the ckpt in load checkpoint

Change with what?

Addepatat avatar Jun 29 '25 21:06 Addepatat

same thing happened to me. i scratched out my old comfyui folder, download a new one from github zip, extract, and run them again without problem. i hate it, but that's my usual way when things go south.

ps: before that, i even tried the update batch file from update folder, running all of them, and still with no change to the errors.

mrdion avatar Jul 16 '25 15:07 mrdion