ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

stable-diffusion-3.5-medium: ImportError: cannot import name 'ERR_IGNORE' from 'numpy.core.umath'

Open manjunaths opened this issue 2 years ago • 1 comments

Expected Behavior

The given prompt was supposed to generate an output image.

Actual Behavior

Stopped the generation with this error,

2024-10-30 23:06:08,493 - root - INFO - loaded completely 0.0 319.7467155456543 True
2024-10-30 23:06:09,370 - root - ERROR - !!! Exception during processing !!! cannot import name 'ERR_IGNORE' from 'numpy.core.umath' (/home/manju/.local/lib/python3.10/site-packages/numpy/core/umath.py)
2024-10-30 23:06:09,407 - root - ERROR - Traceback (most recent call last):
  File "/mnt/d/projects/wsl_linux/ComfyUI/execution.py", line 323, 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 "/mnt/d/projects/wsl_linux/ComfyUI/execution.py", line 198, 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 "/mnt/d/projects/wsl_linux/ComfyUI/execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "/mnt/d/projects/wsl_linux/ComfyUI/execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
  File "/mnt/d/projects/wsl_linux/ComfyUI/nodes.py", line 1511, in save_images
    img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
  File "/home/manju/.local/lib/python3.10/site-packages/numpy/_core/fromnumeric.py", line 2341, in clip
    return _wrapfunc(a, 'clip', a_min, a_max, out=out, **kwargs)
  File "/home/manju/.local/lib/python3.10/site-packages/numpy/_core/fromnumeric.py", line 57, in _wrapfunc
    return bound(*args, **kwds)
  File "/home/manju/.local/lib/python3.10/site-packages/numpy/core/_methods.py", line 14, in <module>
    from numpy.core._ufunc_config import _no_nep50_warning
  File "/home/manju/.local/lib/python3.10/site-packages/numpy/core/_ufunc_config.py", line 11, in <module>
    from .umath import (
ImportError: cannot import name 'ERR_IGNORE' from 'numpy.core.umath' (/home/manju/.local/lib/python3.10/site-packages/numpy/core/umath.py)

Steps to Reproduce

Stable-diffusion-3.5-medium with the 3.5 workflow and default prompt.

Debug Logs

# ComfyUI Error Report
## Error Details
- **Node Type:** PreviewImage
- **Exception Type:** ImportError
- **Exception Message:** cannot import name 'ERR_IGNORE' from 'numpy.core.umath' (/home/manju/.local/lib/python3.10/site-packages/numpy/core/umath.py)
## Stack Trace

  File "/mnt/d/projects/wsl_linux/ComfyUI/execution.py", line 323, 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 "/mnt/d/projects/wsl_linux/ComfyUI/execution.py", line 198, 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 "/mnt/d/projects/wsl_linux/ComfyUI/execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)

  File "/mnt/d/projects/wsl_linux/ComfyUI/execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))

  File "/mnt/d/projects/wsl_linux/ComfyUI/nodes.py", line 1511, in save_images
    img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))

  File "/home/manju/.local/lib/python3.10/site-packages/numpy/_core/fromnumeric.py", line 2341, in clip
    return _wrapfunc(a, 'clip', a_min, a_max, out=out, **kwargs)

  File "/home/manju/.local/lib/python3.10/site-packages/numpy/_core/fromnumeric.py", line 57, in _wrapfunc
    return bound(*args, **kwds)

  File "/home/manju/.local/lib/python3.10/site-packages/numpy/core/_methods.py", line 14, in <module>
    from numpy.core._ufunc_config import _no_nep50_warning

  File "/home/manju/.local/lib/python3.10/site-packages/numpy/core/_ufunc_config.py", line 11, in <module>
    from .umath import (

System Information

  • ComfyUI Version: v0.2.6-1-g09fdb2b
  • Arguments: main.py --lowvram
  • OS: posix
  • Python Version: 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0]
  • Embedded Python: false
  • PyTorch Version: 2.1.2+rocm6.1.3

Devices

  • Name: cuda:0 AMD Radeon RX 7900 GRE : native
    • Type: cuda
    • VRAM Total: 17112936448
    • VRAM Free: 8718559744
    • Torch VRAM Total: 6805258240
    • Torch VRAM Free: 1584818688

Logs

2024-10-30 23:00:02,366 - root - INFO - Total VRAM 16320 MB, total RAM 15571 MB
2024-10-30 23:00:02,367 - root - INFO - pytorch version: 2.1.2+rocm6.1.3
2024-10-30 23:00:02,369 - root - INFO - Set vram state to: LOW_VRAM
2024-10-30 23:00:02,369 - root - INFO - Device: cuda:0 AMD Radeon RX 7900 GRE : native
2024-10-30 23:00:03,325 - root - INFO - Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
2024-10-30 23:00:04,306 - root - INFO - [Prompt Server] web root: /mnt/d/projects/wsl_linux/ComfyUI/web
2024-10-30 23:00:04,686 - root - WARNING - Traceback (most recent call last):
  File "/mnt/d/projects/wsl_linux/ComfyUI/nodes.py", line 2006, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/mnt/d/projects/wsl_linux/ComfyUI/comfy_extras/nodes_audio.py", line 1, in <module>
    import torchaudio
  File "/home/manju/.local/lib/python3.10/site-packages/torchaudio/__init__.py", line 1, in <module>
    from . import (  # noqa: F401
  File "/home/manju/.local/lib/python3.10/site-packages/torchaudio/_extension/__init__.py", line 45, in <module>
    _load_lib("libtorchaudio")
  File "/home/manju/.local/lib/python3.10/site-packages/torchaudio/_extension/utils.py", line 64, in _load_lib
    torch.ops.load_library(path)
  File "/home/manju/.local/lib/python3.10/site-packages/torch/_ops.py", line 852, in load_library
    ctypes.CDLL(path)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libtorch_cuda.so: cannot open shared object file: No such file or directory

2024-10-30 23:00:04,687 - root - WARNING - Cannot import /mnt/d/projects/wsl_linux/ComfyUI/comfy_extras/nodes_audio.py module for custom nodes: libtorch_cuda.so: cannot open shared object file: No such file or directory
2024-10-30 23:00:04,911 - root - INFO - 
Import times for custom nodes:
2024-10-30 23:00:04,911 - root - INFO -    0.0 seconds: /mnt/d/projects/wsl_linux/ComfyUI/custom_nodes/websocket_image_save.py
2024-10-30 23:00:04,911 - root - INFO -    0.2 seconds: /mnt/d/projects/wsl_linux/ComfyUI/custom_nodes/ComfyUI-Manager
2024-10-30 23:00:04,911 - root - INFO - 
2024-10-30 23:00:04,911 - root - WARNING - WARNING: some comfy_extras/ nodes did not import correctly. This may be because they are missing some dependencies.

2024-10-30 23:00:04,911 - root - WARNING - IMPORT FAILED: nodes_audio.py
2024-10-30 23:00:04,912 - root - WARNING - 
This issue might be caused by new missing dependencies added the last time you updated ComfyUI.
2024-10-30 23:00:04,912 - root - WARNING - Please do a: pip install -r requirements.txt
2024-10-30 23:00:04,912 - root - WARNING - 
2024-10-30 23:00:04,920 - root - INFO - Starting server

2024-10-30 23:00:04,920 - root - INFO - To see the GUI go to: http://127.0.0.1:8188
2024-10-30 23:00:54,485 - root - INFO - got prompt
2024-10-30 23:00:55,851 - root - INFO - model weight dtype torch.float16, manual cast: None
2024-10-30 23:00:55,857 - root - INFO - model_type FLOW
2024-10-30 23:01:34,100 - root - INFO - Using split attention in VAE
2024-10-30 23:01:34,102 - root - INFO - Using split attention in VAE
2024-10-30 23:01:35,564 - root - WARNING - no CLIP/text encoder weights in checkpoint, the text encoder model will not be loaded.
2024-10-30 23:01:37,746 - root - INFO - Requested to load SD3ClipModel_
2024-10-30 23:01:37,746 - root - INFO - Loading 1 new model
2024-10-30 23:01:37,756 - root - INFO - loaded completely 0.0 10644.189453125 True
2024-10-30 23:02:04,641 - root - WARNING - clip missing: ['text_projection.weight']
2024-10-30 23:03:13,119 - root - INFO - got prompt
2024-10-30 23:03:13,156 - root - ERROR - Failed to validate prompt for output 50:
2024-10-30 23:03:13,156 - root - ERROR - * CheckpointLoaderSimple 4:
2024-10-30 23:03:13,157 - root - ERROR -   - Value not in list: ckpt_name: 'sd3.5_medium.safetensors' not in ['stable-diffusion-3.5-medium-ungated/sd3.5_medium.safetensors', 'stable-diffusion-3.5-medium-ungated/text_encoder/model.fp16.safetensors', 'stable-diffusion-3.5-medium-ungated/text_encoder/model.safetensors', 'stable-diffusion-3.5-medium-ungated/text_encoder_2/model.fp16.safetensors', 'stable-diffusion-3.5-medium-ungated/text_encoder_2/model.safetensors', 'stable-diffusion-3.5-medium-ungated/text_encoder_3/model-00001-of-00002.safetensors', 'stable-diffusion-3.5-medium-ungated/text_encoder_3/model-00002-of-00002.safetensors', 'stable-diffusion-3.5-medium-ungated/text_encoder_3/model.fp16-00001-of-00002.safetensors', 'stable-diffusion-3.5-medium-ungated/text_encoder_3/model.fp16-00002-of-00002.safetensors', 'stable-diffusion-3.5-medium-ungated/transformer/diffusion_pytorch_model.safetensors', 'stable-diffusion-3.5-medium-ungated/vae copy/diffusion_pytorch_model.safetensors', 'stable-diffusion-3.5-medium-ungated/vae/diffusion_pytorch_model.safetensors']
2024-10-30 23:03:13,157 - root - ERROR - * TripleCLIPLoader 11:
2024-10-30 23:03:13,157 - root - ERROR -   - Value not in list: clip_name3: 'sdv3/t5xxl_fp16.safetensors' not in ['clip_g.safetensors', 'clip_l.safetensors', 't5xxl_fp16.safetensors']
2024-10-30 23:03:13,157 - root - ERROR -   - Value not in list: clip_name2: 'sdv3/clip_l.safetensors' not in ['clip_g.safetensors', 'clip_l.safetensors', 't5xxl_fp16.safetensors']
2024-10-30 23:03:13,157 - root - ERROR -   - Value not in list: clip_name1: 'sdv3/clip_g.safetensors' not in ['clip_g.safetensors', 'clip_l.safetensors', 't5xxl_fp16.safetensors']
2024-10-30 23:03:13,157 - root - ERROR - Output will be ignored
2024-10-30 23:03:13,158 - root - WARNING - invalid prompt: {'type': 'prompt_outputs_failed_validation', 'message': 'Prompt outputs failed validation', 'details': '', 'extra_info': {}}
2024-10-30 23:03:42,720 - root - INFO - got prompt
2024-10-30 23:04:56,299 - root - INFO - got prompt
2024-10-30 23:05:08,387 - root - INFO - Requested to load SD3
2024-10-30 23:05:08,388 - root - INFO - Loading 1 new model
2024-10-30 23:05:12,509 - root - INFO - loaded completely 0.0 4278.5101318359375 True
2024-10-30 23:06:07,880 - root - INFO - Requested to load AutoencodingEngine
2024-10-30 23:06:07,880 - root - INFO - Loading 1 new model
2024-10-30 23:06:08,493 - root - INFO - loaded completely 0.0 319.7467155456543 True
2024-10-30 23:06:09,370 - root - ERROR - !!! Exception during processing !!! cannot import name 'ERR_IGNORE' from 'numpy.core.umath' (/home/manju/.local/lib/python3.10/site-packages/numpy/core/umath.py)
2024-10-30 23:06:09,407 - root - ERROR - Traceback (most recent call last):
  File "/mnt/d/projects/wsl_linux/ComfyUI/execution.py", line 323, 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 "/mnt/d/projects/wsl_linux/ComfyUI/execution.py", line 198, 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 "/mnt/d/projects/wsl_linux/ComfyUI/execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "/mnt/d/projects/wsl_linux/ComfyUI/execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
  File "/mnt/d/projects/wsl_linux/ComfyUI/nodes.py", line 1511, in save_images
    img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
  File "/home/manju/.local/lib/python3.10/site-packages/numpy/_core/fromnumeric.py", line 2341, in clip
    return _wrapfunc(a, 'clip', a_min, a_max, out=out, **kwargs)
  File "/home/manju/.local/lib/python3.10/site-packages/numpy/_core/fromnumeric.py", line 57, in _wrapfunc
    return bound(*args, **kwds)
  File "/home/manju/.local/lib/python3.10/site-packages/numpy/core/_methods.py", line 14, in <module>
    from numpy.core._ufunc_config import _no_nep50_warning
  File "/home/manju/.local/lib/python3.10/site-packages/numpy/core/_ufunc_config.py", line 11, in <module>
    from .umath import (
ImportError: cannot import name 'ERR_IGNORE' from 'numpy.core.umath' (/home/manju/.local/lib/python3.10/site-packages/numpy/core/umath.py)

2024-10-30 23:06:09,413 - root - INFO - Prompt executed in 314.88 seconds

Attached Workflow

Please make sure that workflow does not contain any sensitive information such as API keys or passwords.

{"last_node_id":300,"last_link_id":605,"nodes":[{"id":67,"type":"ConditioningZeroOut","pos":{"0":-126,"1":126},"size":{"0":211.60000610351562,"1":26},"flags":{},"order":8,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":597}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[90],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"ConditioningZeroOut"},"widgets_values":[]},{"id":71,"type":"CLIPTextEncode","pos":{"0":-1010,"1":252},"size":{"0":351.8130798339844,"1":195.57545471191406},"flags":{},"order":5,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":94}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[93,597],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":[""],"color":"#322","bgcolor":"#533"},{"id":6,"type":"CLIPTextEncode","pos":{"0":-1008,"1":2},"size":{"0":342.8335266113281,"1":177.20867919921875},"flags":{},"order":4,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":5}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[569],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["beautiful scenery nature glass bottle landscape, purple galaxy bottle,"],"color":"#232","bgcolor":"#353"},{"id":69,"type":"ConditioningCombine","pos":{"0":504,"1":126},"size":{"0":228.39999389648438,"1":46},"flags":{},"order":10,"mode":0,"inputs":[{"name":"conditioning_1","type":"CONDITIONING","link":91},{"name":"conditioning_2","type":"CONDITIONING","link":92}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[604],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"ConditioningCombine"},"widgets_values":[]},{"id":8,"type":"VAEDecode","pos":{"0":1386,"1":-504},"size":{"0":210,"1":46},"flags":{},"order":12,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":572},{"name":"vae","type":"VAE","link":605}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[274],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]},{"id":68,"type":"ConditioningSetTimestepRange","pos":{"0":126,"1":126},"size":{"0":317.4000244140625,"1":82},"flags":{},"order":9,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":90}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[91],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"ConditioningSetTimestepRange"},"widgets_values":[0.2,1]},{"id":70,"type":"ConditioningSetTimestepRange","pos":{"0":126,"1":252},"size":{"0":317.4000244140625,"1":82},"flags":{},"order":7,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":93,"slot_index":0}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[92],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"ConditioningSetTimestepRange"},"widgets_values":[0,0.2]},{"id":105,"type":"Note","pos":{"0":-1260,"1":-252},"size":{"0":210,"1":110.18948364257812},"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[],"properties":{"text":""},"widgets_values":["Make sure the resolution is multiple of 64 pixels and adds up to around 1 megapixel. "],"color":"#432","bgcolor":"#653"},{"id":135,"type":"EmptySD3LatentImage","pos":{"0":-1008,"1":-252},"size":{"0":315,"1":106},"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[598],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"EmptySD3LatentImage"},"widgets_values":[1280,768,1]},{"id":294,"type":"KSampler","pos":{"0":882,"1":-504},"size":{"0":378,"1":504},"flags":{},"order":11,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":568},{"name":"positive","type":"CONDITIONING","link":569},{"name":"negative","type":"CONDITIONING","link":604},{"name":"latent_image","type":"LATENT","link":598}],"outputs":[{"name":"LATENT","type":"LATENT","links":[572],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"KSampler"},"widgets_values":[877786984042426,"randomize",40,5.5,"dpmpp_2m","sgm_uniform",1]},{"id":13,"type":"ModelSamplingSD3","pos":{"0":-192,"1":-507},"size":{"0":315,"1":58},"flags":{"collapsed":false},"order":6,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":445}],"outputs":[{"name":"MODEL","type":"MODEL","links":[568],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"ModelSamplingSD3"},"widgets_values":[3]},{"id":11,"type":"TripleCLIPLoader","pos":{"0":-2016,"1":-252},"size":{"0":315,"1":106},"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"CLIP","type":"CLIP","links":[5,94],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"TripleCLIPLoader"},"widgets_values":["clip_g.safetensors","clip_l.safetensors","t5xxl_fp16.safetensors"]},{"id":4,"type":"CheckpointLoaderSimple","pos":{"0":-2016,"1":-504},"size":{"0":632.6060180664062,"1":98},"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[445],"slot_index":0,"shape":3},{"name":"CLIP","type":"CLIP","links":null,"shape":3},{"name":"VAE","type":"VAE","links":[605],"slot_index":2,"shape":3}],"properties":{"Node name for S&R":"CheckpointLoaderSimple"},"widgets_values":["stable-diffusion-3.5-medium-ungated/sd3.5_medium.safetensors"]},{"id":50,"type":"PreviewImage","pos":{"0":1764,"1":-504},"size":{"0":616.689697265625,"1":613.84130859375},"flags":{},"order":13,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":274}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"},"widgets_values":[]}],"links":[[5,11,0,6,0,"CLIP"],[90,67,0,68,0,"CONDITIONING"],[91,68,0,69,0,"CONDITIONING"],[92,70,0,69,1,"CONDITIONING"],[93,71,0,70,0,"CONDITIONING"],[94,11,0,71,0,"CLIP"],[274,8,0,50,0,"IMAGE"],[445,4,0,13,0,"MODEL"],[568,13,0,294,0,"MODEL"],[569,6,0,294,1,"CONDITIONING"],[572,294,0,8,0,"LATENT"],[597,71,0,67,0,"CONDITIONING"],[598,135,0,294,3,"LATENT"],[604,69,0,294,2,"CONDITIONING"],[605,4,2,8,1,"VAE"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.683013455365071,"offset":[-895.8738255401146,804.591664990583]}},"version":0.4}

Additional Context

(Please add any additional context or steps to reproduce the error here)



### Other

_No response_

manjunaths avatar Oct 30 '24 17:10 manjunaths

Sorry, when the requirements file was executed, the numpy had gotten upgraded to 2.x version. Downgrading it to 1.26.4 did the trick. The trick is to uninstall all version of numpy, purge the conda cache and re-download from the web and install again. There was a similar issue here, although not related to the error, when I checked the numpy version (by doing a find / -name numpy*), two version showed up and uninstall both and reinstalling from cache, threw up this error

AttributeError: module 'numpy' has no attribute 'ndarray'

But purging the cache and reinstalling the correct version fixed the issue. Also, I had to add the $HOME/.local/bin to the PATH and .bashrc too.

manjunaths avatar Oct 30 '24 18:10 manjunaths