CosmicLaca / ComfyUI_Primere_Nodes

ComfyUI node pack
GNU General Public License v3.0
107 stars 13 forks source link

KeyError: 'sams' #13

Closed Tobe2d closed 8 months ago

Tobe2d commented 8 months ago

It does installed correctly however, once comfyui start and opned the webui i get this error in the log:

[ERROR] An error occurred while retrieving information for the 'PrimereImageSegments' node.
Traceback (most recent call last):
  File "D:\Ai__Project\ComfyUI\server.py", line 414, in get_object_info
    out[x] = node_info(x)
             ^^^^^^^^^^^^
  File "D:\Ai__Project\ComfyUI\server.py", line 392, in node_info
    info['input'] = obj_class.INPUT_TYPES()
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Ai__Project\ComfyUI\custom_nodes\ComfyUI_Primere_Nodes\Nodes\Segments.py", line 134, in INPUT_TYPES
    sams = list(filter(lambda x: x.startswith('sam_vit'), folder_paths.get_filename_list("sams")))
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Ai__Project\ComfyUI\folder_paths.py", line 220, in get_filename_list
    out = get_filename_list_(folder_name)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Ai__Project\ComfyUI\folder_paths.py", line 187, in get_filename_list_
    folders = folder_names_and_paths[folder_name]
              ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'sams'

Any idea how to fix this?

CosmicLaca commented 8 months ago

@Tobe2d Hi, you need subdir with files under comfy's model folder like in the pics. I think comfy's model downloader save these files to right path automatically. 2024-03-24_22-28-33

Tobe2d commented 8 months ago

Thanks for the reply,

I do have them in the mentioned path: image

Tobe2d commented 8 months ago

quick note might help: I am not using comfyui portable but the manual installation using venv

CosmicLaca commented 8 months ago

@Tobe2d I have same type of installation. That interesting, no idea yet. I using to collect sam files comfy's internal function. Do you have latest Comfy? (git pull). I tested yesterday and working. Can you open this workflow for testing: [yourcomfy]/ComfyUI_Primere_Nodes/blob/master/Workflow/Primere_full_workflow.json This contains latest refiner nodes.

Tobe2d commented 8 months ago

I can confirm the workflow is working but the error in the log is not fixed though ;-)

very strange as it was all working but after one of the updates last week it start showing this error in the log

CosmicLaca commented 8 months ago

@Tobe2d If the detailers working on workflow, the another workflow deprecated because the node development. But not sure what happen, the default prompt of full workflow refine the character's eye?

CosmicLaca commented 7 months ago

@Tobe2d That was really interesting failure. Some installed custom node solved the existing problem in my system. But if I deleted 3rd party nodes, I can saw the problem. Solved with last update, just a git pull needed.