I get this DEPRECATION message when I start ComfyUI: "UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead."
Author: corvo4791
Pull request: no

### System Info

WARNING:tensorflow:From C:\Users\Aldo\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\commands\env.py:52: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2024-02-29 02:29:47.644675: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE SSE2 SSE3 SSE4.1 SSE4.2 AVX AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.

Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.

- `transformers` version: 4.25.1
- Platform: Windows-10-10.0.19045-SP0
- Python version: 3.10.6
- Huggingface_hub version: 0.20.3
- PyTorch version (GPU?): 2.2.1+cu118 (True)
- Tensorflow version (GPU?): 2.13.0 (False)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>

### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

Just launch ComfyUI

### Expected behavior

C:\code\ComfyUI_windows_portable>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
** ComfyUI startup time: 2024-02-21 23:15:26.226000
** Platform: Windows
** Python version: 3.11.6 (tags/v3.11.6:8b6ee5b, Oct 2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)]
** Python executable: C:\code\ComfyUI_windows_portable\python_embeded\python.exe
** Log path: C:\code\ComfyUI_windows_portable\comfyui.log

Prestartup times for custom nodes:
0.0 seconds: C:\code\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 12282 MB, total RAM 65378 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4070 Ti : cudaMallocAsync
VAE dtype: torch.bfloat16

C:\code\ComfyUI_windows_portable\python_embeded\Lib\site-packages\transformers\utils\generic.py:441: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
_torch_pytree._register_pytree_node(
Using pytorch cross attention
Adding extra search path checkpoints C:/code/SD/models/Stable-diffusion
Adding extra search path configs C:/code/SD/models/Stable-diffusion
Adding extra search path vae C:/code/SD/models/VAE
Adding extra search path loras C:/code/SD/models/Lora
Adding extra search path loras C:/code/SD/models/LyCORIS
Adding extra search path upscale_models C:/code/SD/models/ESRGAN
Adding extra search path upscale_models C:/code/SD/models/RealESRGAN
Adding extra search path upscale_models C:/code/SD/models/SwinIR
Adding extra search path embeddings C:/code/SD/embeddings
Adding extra search path hypernetworks C:/code/SD/models/hypernetworks
Adding extra search path controlnet C:/code/SD/models/ControlNet
[Allor]: 0 nodes were overridden.
[Allor]: 12 modules were enabled.
[Allor]: 98 nodes were loaded.
Loading: ComfyUI-Impact-Pack (V4.79)
Loading: ComfyUI-Impact-Pack (Subpack: V0.4)
[Impact Pack] Wildcards loading done.

C:\code\ComfyUI_windows_portable\python_embeded\Lib\site-packages\transformers\utils\generic.py:309: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
_torch_pytree._register_pytree_node(

C:\code\ComfyUI_windows_portable\python_embeded\Lib\site-packages\transformers\utils\generic.py:309: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
_torch_pytree._register_pytree_node(

Comments:
Hey! This seems orthogonal to transformers, the warning was fixed on main!

> Hey! This seems orthogonal to transformers, the warning was fixed on main!

Sorry, but I don't know what you mean.

@ArthurZucker I get a similar warning from `transformers`:


```/home/mifs/ac2123/.local/share/virtualenvs/??????/lib/python3.10/site-packages/transformers/utils/generic.py:441
: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_n
ode instead.
  _torch_pytree._register_pytree_node(
/home/mifs/ac2123/.local/share/virtualenvs/??????/lib/python3.10/site-packages/transformers/utils/generic.py:309
: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_n
ode instead.```

My env is as follows:

```- `transformers` version: 4.35.2
- Platform: Linux-5.4.0-148-generic-x86_64-with-glibc2.27
- Python version: 3.10.11
- Huggingface_hub version: 0.19.4
- Safetensors version: 0.4.0
- Accelerate version: 0.24.1
- Accelerate config: 	not found
- PyTorch version (GPU?): 2.2.1+cu118 (True)
```
Which release contains the fix?

@ArthurZucker apologies for the noise, I'll upgrade to 4.37.x and check this warning is no longer displayed.

I solved doing this:
1) Delete the 2 folders "transformers" and "transformers-4.36.0.dist-info" (you may have a different version; delete it anyway) from folder "...\ComfyUI_windows_portable\python_embeded\Lib\site-packages"
2) Go to folder "...\ComfyUI_windows_portable\python_embeded\" and launch CMD from there (click on the path bar in the upper side of the windows explorer window, type CMD and click ENTER to do it)
3) Reinstall Trasformers with this command line "python.exe -m pip install transformers" and the updated version of transformers will be installed. 

The Deprecation message will be no longer displayed.

Hello 
When using command : python.exe -m pip install transformers got this and nothing is installed

EDIT : FIXED 👍 

I managed to fix this by changing code in outputs.py as follow :
https://github.com/huggingface/diffusers/commit/38e7954fed08831f70fbafd3a953690b23ef4229

`PS D:\ComfyUI_windows_portable\python_embeded> python.exe -m pip install transformers
Requirement already satisfied: transformers in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (4.39.1)
Requirement already satisfied: filelock in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers) (3.9.0)
Requirement already satisfied: huggingface-hub<1.0,>=0.19.3 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers) (0.22.0)
Requirement already satisfied: numpy>=1.17 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers) (1.26.3)
Requirement already satisfied: packaging>=20.0 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers) (23.2)
Requirement already satisfied: pyyaml>=5.1 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers) (6.0.1)
Requirement already satisfied: regex!=2019.12.17 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers) (2023.12.25)
Requirement already satisfied: requests in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers) (2.31.0)
Requirement already satisfied: tokenizers<0.19,>=0.14 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers) (0.15.2)
Requirement already satisfied: safetensors>=0.4.1 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers) (0.4.2)
Requirement already satisfied: tqdm>=4.27 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers) (4.66.1)
Requirement already satisfied: fsspec>=2023.5.0 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from huggingface-hub<1.0,>=0.19.3->transformers) (2024.3.1)
Requirement already satisfied: typing-extensions>=3.7.4.3 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from huggingface-hub<1.0,>=0.19.3->transformers) (4.4.0)
Requirement already satisfied: colorama in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from tqdm>=4.27->transformers) (0.4.6)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from requests->transformers) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from requests->transformers) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from requests->transformers) (2.2.0)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\kankan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from requests->transformers) (2023.11.17)
PS D:\ComfyUI_windows_portable\python_embeded>`


> I solved doing this:
> 
> 1. Delete the 2 folders "transformers" and "transformers-4.36.0.dist-info" (you may have a different version; delete it anyway) from folder "...\ComfyUI_windows_portable\python_embeded\Lib\site-packages"
> 2. Go to folder "...\ComfyUI_windows_portable\python_embeded" and launch CMD from there (click on the path bar in the upper side of the windows explorer window, type CMD and click ENTER to do it)
> 3. Reinstall Trasformers with this command line "python.exe -m pip install transformers" and the updated version of transformers will be installed.
> 
> The Deprecation message will be no longer displayed.

You are not in the folder: "...\ComfyUI_windows_portable\python_embeded\Lib\site-packages"

Follow these instructions STEP BY STEP

- Delete the 2 folders "transformers" and "transformers-4.36.0.dist-info" (you may have a different version; delete it anyway) from folder "...\ComfyUI_windows_portable\python_embeded\Lib\site-packages"
- 
- Go to folder "...\ComfyUI_windows_portable\python_embeded" and launch CMD from there (click on the path bar in the upper side of the windows explorer window, type CMD and click ENTER to do it)
- 
- Reinstall Trasformers with this command line "python.exe -m pip install transformers" and the updated version of transformers will be installed.



I am, i deleted the two folders there.
then get back two levels to folder \python_embeded and opened a CMD from there and got this message...

> I am, i deleted the two folders there. then get back two levels to folder \python_embeded and opened a CMD from there and got this message...

Did you put the folder ".../ComfyUI_windows_portable\python_embeded\Scripts" in the PATH of environment variables?

Sorry but don t know how to do that, i just opened a terminal CMD in folder \python_embeded

> Sorry but don t know how to do that, i just opened a terminal CMD in folder \python_embeded

Windows 10 and Windows 8
In Search, search for and then select: System (Control Panel)
Click the Advanced system settings link.
Click Environment Variables. In the section System Variables find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.

Add both ".../ComfyUI_windows_portable\python_embeded\Scripts" and ".../ComfyUI_windows_portable\python_embeded" in PATH

After that do again the procedure above.

Thank you corvo4791 : i added the Path 'environement variable" : https://atelier-asus.fr/variables.png
But still same errors messages displayed, sorry

I managed to fix this by changing code in outputs.py as follow : 

https://github.com/huggingface/diffusers/pull/7008/commits/38e7954fed08831f70fbafd3a953690b23ef4229

> Thank you corvo4791 : i added the Path 'environement variable" : https://atelier-asus.fr/variables.png But still same errors messages displayed, sorry
> 
> I managed to fix this by changing code in outputs.py as follow :
> 
> [huggingface/diffusers@38e7954](https://github.com/huggingface/diffusers/commit/38e7954fed08831f70fbafd3a953690b23ef4229)

Try to put those links upper in the list

Anyway, it seems you solved in another way.

I have this same sort of error when running the kohya ss script to convert a diffusers model to safetensors on certain diffusers models, none of the ones trained in Onetrainer work with the conversion script tool work for me using kohya's `convert_diffusers20_original_sd.py` (When I put the converted .safetensor in comyui, SD forge, or auto1111)

I'm testing this because trying to diagnose for the Onetrainer dev here https://github.com/Nerogar/OneTrainer/issues/224 on why finetuning a likeness in Onetrainer's diffusers backups is much better resemblance at the same epoch than the .safetensors file. It seems during conversation something is changing there.

Here is the error again in kohya ss script conversion tool mentioned above when trying to convert a Onetrainer diffusers backup manually:

  ```
C:\users\newpc\downloads\kohya_convert\sd-scripts\venv\lib\site-packages\transformers\utils\generic.py:441: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  _torch_pytree._register_pytree_node(
C:\users\newpc\downloads\kohya_convert\sd-scripts\venv\lib\site-packages\transformers\utils\generic.py:309: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  _torch_pytree._register_pytree_node(
C:\users\newpc\downloads\kohya_convert\sd-scripts\venv\lib\site-packages\transformers\utils\generic.py:309: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  _torch_pytree._register_pytree_node(
C:\users\newpc\downloads\kohya_convert\sd-scripts\venv\lib\site-packages\diffusers\utils\outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
```