Skip to content

SAMModelLoader (segment anything) PytorchStreamReader failed reading zip archive: failed finding central directory #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3231684124 opened this issue Sep 29, 2024 · 1 comment

Comments

@3231684124
Copy link

here is the report

ComfyUI Error Report

Error Details

  • Node Type: SAMModelLoader (segment anything)
  • Exception Type: RuntimeError
  • Exception Message: PytorchStreamReader failed reading zip archive: failed finding central directory

Stack Trace

  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 317, 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 "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 192, 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 "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)

  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))

  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui_segment_anything\node.py", line 269, in main
    sam_model = load_sam_model(model_name)

  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui_segment_anything\node.py", line 86, in load_sam_model
    sam = sam_model_registry[model_type](checkpoint=sam_checkpoint_path)

  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\segment_anything\build_sam.py", line 15, in build_sam_vit_h
    return _build_sam(

  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\segment_anything\build_sam.py", line 105, in _build_sam
    state_dict = torch.load(f)

  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\torch\serialization.py", line 1004, in load
    with _open_zipfile_reader(opened_file) as opened_zipfile:

  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\torch\serialization.py", line 456, in __init__
    super().__init__(torch._C.PyTorchFileReader(name_or_buffer))

System Information

  • ComfyUI Version: v0.1.3-22-gd4aeefc
  • Arguments: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\main.py --auto-launch --preview-method auto --disable-cuda-malloc
  • OS: nt
  • Python Version: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
  • Embedded Python: false
  • PyTorch Version: 2.3.1+cu121

Devices

  • Name: cuda:0 NVIDIA GeForce RTX 3080 : cudaMallocAsync
    • Type: cuda
    • VRAM Total: 10736893952
    • VRAM Free: 9513730048
    • Torch VRAM Total: 0
    • Torch VRAM Free: 0

Logs

2024-09-29 21:47:55,948 - root - INFO - Total VRAM 10240 MB, total RAM 40800 MB
2024-09-29 21:47:55,948 - root - INFO - pytorch version: 2.3.1+cu121
2024-09-29 21:47:57,064 - root - INFO - xformers version: 0.0.27
2024-09-29 21:47:57,065 - root - INFO - Set vram state to: NORMAL_VRAM
2024-09-29 21:47:57,065 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 3080 : cudaMallocAsync
2024-09-29 21:47:57,207 - root - INFO - Using xformers cross attention
2024-09-29 21:47:57,832 - root - INFO - [Prompt Server] web root: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\web
2024-09-29 21:47:59,395 - root - INFO - Total VRAM 10240 MB, total RAM 40800 MB
2024-09-29 21:47:59,395 - root - INFO - pytorch version: 2.3.1+cu121
2024-09-29 21:47:59,395 - root - INFO - xformers version: 0.0.27
2024-09-29 21:47:59,395 - root - INFO - Set vram state to: NORMAL_VRAM
2024-09-29 21:47:59,395 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 3080 : cudaMallocAsync
2024-09-29 21:48:03,326 - root - INFO - 
Import times for custom nodes:
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\websocket_image_save.py
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ControlNet-LLLite-ComfyUI
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\AIGODLIKE-ComfyUI-Translation
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\FreeU_Advanced
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\stability-ComfyUI-nodes
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_TiledKSampler
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_experiments
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-WD14-Tagger
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\PowerNoiseSuite
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\images-grid-comfy-plugin
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Custom-Scripts
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_UltimateSDUpscale
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\Derfuu_ComfyUI_ModdedNodes
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\rgthree-comfy
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Advanced-ControlNet
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\efficiency-nodes-comfyui
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_IPAdapter_plus
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-AnimateDiff-Evolved
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui_controlnet_aux
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui-workspace-manager
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-KJNodes
2024-09-29 21:48:03,326 - root - INFO -    0.0 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_Comfyroll_CustomNodes
2024-09-29 21:48:03,326 - root - INFO -    0.1 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Inspire-Pack
2024-09-29 21:48:03,326 - root - INFO -    0.1 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Crystools
2024-09-29 21:48:03,327 - root - INFO -    0.2 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui_segment_anything
2024-09-29 21:48:03,327 - root - INFO -    0.2 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Marigold
2024-09-29 21:48:03,327 - root - INFO -    0.2 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_FizzNodes
2024-09-29 21:48:03,327 - root - INFO -    0.5 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Manager
2024-09-29 21:48:03,327 - root - INFO -    0.9 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Impact-Pack
2024-09-29 21:48:03,327 - root - INFO -    2.6 seconds: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_Custom_Nodes_AlekPet
2024-09-29 21:48:03,327 - root - INFO - 
2024-09-29 21:48:03,342 - root - INFO - Starting server

2024-09-29 21:48:03,342 - root - INFO - To see the GUI go to: http://127.0.0.1:8188
2024-09-29 21:48:09,732 - root - INFO - got prompt
2024-09-29 21:48:09,741 - comfyui_segment_anything - WARNING - using extra model: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\models\sams\sam_vit_h_4b8939.pth
2024-09-29 21:48:13,538 - root - ERROR - !!! Exception during processing !!! PytorchStreamReader failed reading zip archive: failed finding central directory
2024-09-29 21:48:13,541 - root - ERROR - Traceback (most recent call last):
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 317, 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 "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 192, 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 "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui_segment_anything\node.py", line 269, in main
    sam_model = load_sam_model(model_name)
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui_segment_anything\node.py", line 86, in load_sam_model
    sam = sam_model_registry[model_type](checkpoint=sam_checkpoint_path)
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\segment_anything\build_sam.py", line 15, in build_sam_vit_h
    return _build_sam(
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\segment_anything\build_sam.py", line 105, in _build_sam
    state_dict = torch.load(f)
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\torch\serialization.py", line 1004, in load
    with _open_zipfile_reader(opened_file) as opened_zipfile:
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\torch\serialization.py", line 456, in __init__
    super().__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

2024-09-29 21:48:13,542 - root - INFO - Prompt executed in 3.81 seconds
2024-09-29 21:55:27,860 - root - INFO - got prompt
2024-09-29 21:55:27,870 - comfyui_segment_anything - WARNING - using extra model: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\models\sams\sam_vit_h_4b8939.pth
2024-09-29 21:55:30,857 - root - ERROR - !!! Exception during processing !!! PytorchStreamReader failed reading zip archive: failed finding central directory
2024-09-29 21:55:30,858 - root - ERROR - Traceback (most recent call last):
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 317, 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 "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 192, 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 "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui_segment_anything\node.py", line 269, in main
    sam_model = load_sam_model(model_name)
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui_segment_anything\node.py", line 86, in load_sam_model
    sam = sam_model_registry[model_type](checkpoint=sam_checkpoint_path)
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\segment_anything\build_sam.py", line 15, in build_sam_vit_h
    return _build_sam(
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\segment_anything\build_sam.py", line 105, in _build_sam
    state_dict = torch.load(f)
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\torch\serialization.py", line 1004, in load
    with _open_zipfile_reader(opened_file) as opened_zipfile:
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\torch\serialization.py", line 456, in __init__
    super().__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

2024-09-29 21:55:30,859 - root - INFO - Prompt executed in 3.00 seconds
2024-09-29 21:56:37,767 - root - INFO - got prompt
2024-09-29 21:56:37,773 - comfyui_segment_anything - WARNING - using extra model: C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\models\sams\sam_vit_h_4b8939.pth
2024-09-29 21:56:40,724 - root - ERROR - !!! Exception during processing !!! PytorchStreamReader failed reading zip archive: failed finding central directory
2024-09-29 21:56:40,724 - root - ERROR - Traceback (most recent call last):
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 317, 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 "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 192, 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 "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui_segment_anything\node.py", line 269, in main
    sam_model = load_sam_model(model_name)
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui_segment_anything\node.py", line 86, in load_sam_model
    sam = sam_model_registry[model_type](checkpoint=sam_checkpoint_path)
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\segment_anything\build_sam.py", line 15, in build_sam_vit_h
    return _build_sam(
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\segment_anything\build_sam.py", line 105, in _build_sam
    state_dict = torch.load(f)
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\torch\serialization.py", line 1004, in load
    with _open_zipfile_reader(opened_file) as opened_zipfile:
  File "C:\ComfyUI-aki-v1.4\ComfyUI-aki-v1.4\python\lib\site-packages\torch\serialization.py", line 456, in __init__
    super().__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

2024-09-29 21:56:40,725 - root - INFO - Prompt executed in 2.96 seconds

Attached Workflow

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

{"last_node_id":54,"last_link_id":128,"nodes":[{"id":53,"type":"GroundingDinoModelLoader (segment anything)","pos":{"0":-529,"1":106,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"size":{"0":541.800048828125,"1":58},"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"GROUNDING_DINO_MODEL","type":"GROUNDING_DINO_MODEL","links":[127],"shape":3,"label":"GROUNDING_DINO_MODEL"}],"properties":{"Node name for S&R":"GroundingDinoModelLoader (segment anything)"},"widgets_values":["GroundingDINO_SwinB (938MB)"]},{"id":48,"type":"LoadImage","pos":{"0":-355,"1":228,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"size":{"0":315,"1":314},"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[125],"slot_index":0,"shape":3,"label":"IMAGE"},{"name":"MASK","type":"MASK","links":null,"slot_index":1,"shape":3,"label":"MASK"}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["pasted/image.png","image"]},{"id":51,"type":"GroundingDinoSAMSegment (segment anything)","pos":{"0":117,"1":131,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"size":{"0":529.199951171875,"1":122},"flags":{},"order":3,"mode":0,"inputs":[{"name":"sam_model","type":"SAM_MODEL","link":126,"label":"sam_model"},{"name":"grounding_dino_model","type":"GROUNDING_DINO_MODEL","link":127,"label":"grounding_dino_model"},{"name":"image","type":"IMAGE","link":125,"label":"image"}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[128],"slot_index":0,"shape":3,"label":"IMAGE"},{"name":"MASK","type":"MASK","links":null,"shape":3,"label":"MASK"}],"properties":{"Node name for S&R":"GroundingDinoSAMSegment (segment anything)"},"widgets_values":["man",0.3]},{"id":54,"type":"PreviewImage","pos":{"0":711,"1":99,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"size":{"0":210,"1":26},"flags":{},"order":4,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":128,"label":"images"}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"}},{"id":52,"type":"SAMModelLoader (segment anything)","pos":{"0":-355,"1":-7,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"size":{"0":415.8000183105469,"1":58},"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"SAM_MODEL","type":"SAM_MODEL","links":[126],"shape":3,"label":"SAM_MODEL"}],"properties":{"Node name for S&R":"SAMModelLoader (segment anything)"},"widgets_values":["sam_vit_h (2.56GB)"]}],"links":[[125,48,0,51,2,"IMAGE"],[126,52,0,51,0,"SAM_MODEL"],[127,53,0,51,1,"GROUNDING_DINO_MODEL"],[128,51,0,54,0,"IMAGE"]],"groups":[],"config":{},"extra":{"ds":{"scale":1.2100000000000006,"offset":[579.009865201351,234.11006343854206]}},"version":0.4}

Additional Context

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

@snakeye888
Copy link

I also have this problem, how can I solve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants