ltdrdata / ComfyUI-Impact-Pack

Custom nodes pack for ComfyUI This custom node helps to conveniently enhance images through Detector, Detailer, Upscaler, Pipe, and more.
GNU General Public License v3.0
1.44k stars 144 forks source link

'Sam' object has no attribute 'sam_wrapper' #657

Closed vararth closed 5 days ago

vararth commented 6 days ago

Not sure why this is happening.. everything was working fine till yesterday - here is the terminal log:

C:\ComfyUI_windows_portable>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --lowvram --listen --port 4200
[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2024-06-29 19:23:37.739887
** 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:\ComfyUI_windows_portable\python_embeded\python.exe
** ComfyUI Path: C:\ComfyUI_windows_portable\ComfyUI\main.py
** Log path: C:\ComfyUI_windows_portable\comfyui.log

#######################################################################
[ComfyUI-Manager] Starting dependency installation/(de)activation for the extension

Install: pip packages for 'C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\efficiency-nodes-comfyui'

[ComfyUI-Manager] Startup script completed.
#######################################################################

Prestartup times for custom nodes:
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy
   2.7 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 4096 MB, total RAM 32623 MB
pytorch version: 2.1.2+cu121
xformers version: 0.0.23.post1
Set vram state to: LOW_VRAM
Device: cuda:0 NVIDIA GeForce GTX 1050 Ti : cudaMallocAsync
Using xformers cross attention
[Allor]: 0 nodes were overridden.
[Allor]: 12 modules were enabled.
[Allor]: 98 nodes were loaded.
[AnimateDiff] - WARNING - xformers is enabled but it has a bug that can cause issue while using with AnimateDiff.
Total VRAM 4096 MB, total RAM 32623 MB
pytorch version: 2.1.2+cu121
xformers version: 0.0.23.post1
Set vram state to: LOW_VRAM
Device: cuda:0 NVIDIA GeForce GTX 1050 Ti : cudaMallocAsync
### Loading: ComfyUI-Impact-Pack (V5.18.4)
### Loading: ComfyUI-Impact-Pack (Subpack: V0.6)
[Impact Pack] Wildcards loading done.
### Loading: ComfyUI-Inspire-Pack (V0.80.4)
### Loading: ComfyUI-Manager (V2.43)
### ComfyUI Revision: 2307 [fbb7a1f1] | Released on '2024-06-29'
Failed to auto update `Quality of Life Suit`
QualityOfLifeSuit_Omar92_DIR: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-QualityOfLifeSuit_Omar92
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ReActor] - STATUS - Running v0.5.0-b4 in ComfyUI
Torch version: 2.1.2+cu121
Imported node: DT_Flatten_Colors
Imported node: DT_FontText
Imported node: DT_GenerateNoise
Imported node: DT_Glitch_This
Imported node: DT_Hue_Rotation
Imported node: DT_Load_Picture_Index
Imported node: DT_PILGram
Imported node: DT_Pixel_Sort
Imported node: DT_Play_Sound_At_Execution
Imported node: DT_PromptGen
Imported node: DT_Solid_Color
Imported node: DT_Swap_Color_Mode
Imported node: DT_Flatten_Colors
Imported node: DT_FontText
Imported node: DT_GenerateNoise
Imported node: DT_Glitch_This
Imported node: DT_Hue_Rotation
Imported node: DT_Load_Picture_Index
Imported node: DT_PILGram
Imported node: DT_Pixel_Sort
Imported node: DT_Play_Sound_At_Execution
Imported node: DT_PromptGen
Imported node: DT_Solid_Color
Imported node: DT_Swap_Color_Mode
(pysssss:WD14Tagger) [DEBUG] Available ORT providers: TensorrtExecutionProvider, CUDAExecutionProvider, CPUExecutionProvider
(pysssss:WD14Tagger) [DEBUG] Using ORT providers: CUDAExecutionProvider, CPUExecutionProvider
------------------------------------------
Comfyroll Studio v1.76 :  175 Nodes Loaded
------------------------------------------
** For changes, please see patch notes at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/blob/main/Patch_Notes.md
** For help, please see the wiki at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki
------------------------------------------
[comfyui_controlnet_aux] | INFO -> Using ckpts path: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux\ckpts
[comfyui_controlnet_aux] | INFO -> Using symlinks: False
[comfyui_controlnet_aux] | INFO -> Using ort providers: ['CUDAExecutionProvider', 'DirectMLExecutionProvider', 'OpenVINOExecutionProvider', 'ROCMExecutionProvider', 'CPUExecutionProvider', 'CoreMLExecutionProvider']
DWPose: Onnxruntime with acceleration providers detected
### [START] ComfyUI AlekPet Nodes ###
Node -> ArgosTranslateNode [Loading]
Node -> DeepTranslatorNode [Loading]
Node -> ExtrasNode [Loading]
Node -> GoogleTranslateNode [Loading]
Node -> PainterNode [Loading]
Node -> PoseNode [Loading]
### [END] ComfyUI AlekPet Nodes ###
FizzleDorf Custom Nodes: Loaded
--------------
*ComfyUI_Jags_VectorMagic- nodes_loaded*
--------------
[comfy_mtb] | INFO -> loaded 77 nodes successfuly
[comfy_mtb] | INFO -> Some nodes (2) could not be loaded. This can be ignored, but go to http://None:4200/mtb if you want more information.
FaceDetailer: Model directory already exists
FaceDetailer: Model already exists
Efficiency Nodes: Attempting to add Control Net options to the 'HiRes-Fix Script' Node (comfyui_controlnet_aux add-on)...Success!
Patching UNetModel.forward
UNetModel.forward has been successfully patched.

[rgthree] Loaded 41 fantastic nodes.
[rgthree] Will use rgthree's optimized recursive execution.

Searge-SDXL v4.3.1 in C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL
WAS Node Suite: OpenCV Python FFMPEG support is enabled
WAS Node Suite Warning: `ffmpeg_bin_path` is not set in `C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui\was_suite_config.json` config file. Will attempt to use system ffmpeg binaries if available.
WAS Node Suite: Finished. Loaded 216 nodes successfully.

        "Don't be pushed around by the fears in your mind. Be led by the dreams in your heart." - Roy T. Bennett

Import times for custom nodes:
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Dream-Interpreter
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\example_node.py
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\cg-use-everywhere
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\sdxl_prompt_styler
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\FreeU_Advanced
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-HQ-Image-Save
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-YOLO
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\custom_aspect.py
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-seamless-tiling
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Cutoff
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-WD14-Tagger
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-inpaint-nodes
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-animatediff
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-QualityOfLifeSuit_Omar92
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Advanced-ControlNet
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Video-Matting
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-KJNodes
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Custom-Scripts
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-IC-Light
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Frame-Interpolation
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Jags_VectorMagic
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy
   0.1 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Derfuu_ComfyUI_ModdedNodes
   0.1 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved
   0.1 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Comfyroll_CustomNodes
   0.1 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_essentials
   0.1 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-TiledDiffusion
   0.1 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Inspire-Pack
   0.1 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux
   0.1 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\efficiency-nodes-comfyui
   0.1 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\StableZero123-comfyui
   0.2 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_InstantID
   0.4 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager
   0.4 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_segment_anything
   0.5 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\DZ-FaceDetailer
   0.5 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_FizzNodes
   0.7 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite
   0.8 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node
   0.9 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-dynamicprompts
   1.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack
   1.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL
   1.4 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Allor
   2.3 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy_mtb
   2.4 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui
   2.8 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Vextra-Nodes
   9.2 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Custom_Nodes_AlekPet

Starting server

To see the GUI go to: http://0.0.0.0:4200
FETCH DATA from: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json [DONE]
HTTP Request: GET https://api.openai.com/v1/models "HTTP/1.1 401 Unauthorized"
Error: OpenAI API key is invalid OpenAI features wont work for you
QualityOfLifeSuit_Omar92::NSP ready
[comfy_mtb] | WARNING -> No styles found in the styles folder, place at least one csv file in the styles folder at the root of ComfyUI (for instance ComfyUI/styles/mystyle.csv)
got prompt
[rgthree] Using rgthree's optimized recursive execution.
[rgthree] First run patching recursive_output_delete_if_changed and recursive_will_execute.
[rgthree] Note: If execution seems broken due to forward ComfyUI changes, you can disable the optimization from rgthree settings in ComfyUI.
model_type EPS
Using xformers attention in VAE
Using xformers attention in VAE
Requested to load SD1ClipModel
Loading 1 new model
Requested to load BaseModel
Loading 1 new model
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:36<00:00,  1.83s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [01:52<00:00,  5.60s/it]
Using xformers attention in VAE
Using xformers attention in VAE
Requested to load AutoencoderKL
Loading 1 new model

0: 448x640 4 faces, 76.6ms
Speed: 2.5ms preprocess, 76.6ms inference, 109.1ms postprocess per image at shape (1, 3, 448, 640)

0: 448x640 4 persons, 46.7ms
Speed: 2.0ms preprocess, 46.7ms inference, 5.1ms postprocess per image at shape (1, 3, 448, 640)
Detailer: segment upscale for ((73.8985, 75.43009)) | crop region (221, 226) x 4.531620058327609 -> (1001, 1024)
Requested to load BaseModel
Loading 1 new model
 15%|████████████▍                                                                      | 3/20 [00:30<02:54, 10.26s/it]
Processing interrupted
Prompt executed in 196.06 seconds
got prompt
[rgthree] Using rgthree's optimized recursive execution.
using extra model: C:\ComfyUI_windows_portable\ComfyUI\models\sams\sam_vit_h_4b8939.pth

0: 448x640 4 faces, 319.7ms
Speed: 3.5ms preprocess, 319.7ms inference, 3.5ms postprocess per image at shape (1, 3, 448, 640)
!!! Exception during processing!!! 'Sam' object has no attribute 'sam_wrapper'
Traceback (most recent call last):
  File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\impact_pack.py", line 557, in doit
    enhanced_img, cropped_enhanced, cropped_enhanced_alpha, mask, cnet_pil_list = FaceDetailer.enhance_face(
                                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\impact_pack.py", line 496, in enhance_face
    sam_mask = core.make_sam_mask(sam_model_opt, segs, image, sam_detection_hint, sam_dilation,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\core.py", line 595, in make_sam_mask
    sam_obj = sam.sam_wrapper
              ^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1695, in __getattr__
    raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'Sam' object has no attribute 'sam_wrapper'

Prompt executed in 8.45 seconds

The problem occurs when I try to add a SAM model to the Facedetailer node.. please suggest how to fix this issue, many thanks in advance :)

image

May be of help - I am using the latest ComfyUI and ran a 'Update All' today only

ltdrdata commented 5 days ago

You have to use SAMLoader (Impact).

vararth commented 5 days ago

What node do I search for? There is no node called 'SAMLoader (Impact)' - or should I update again?

ltdrdata commented 5 days ago

image

If you cannot find this. Your ComfyUI is outdated, too.

vararth commented 5 days ago

Just did another git pull but this node doesn't seem to exist? I even tried searching for it manually by right clicking in the space and searching through the ImpactPack but couldn't find it...

image

image

ltdrdata commented 5 days ago

image

If you cannot find this. Your ComfyUI is outdated, too.

Don't add blank. between SAM and Loader.

vararth commented 5 days ago

Just tried as you suggested, updated comfyui as well - this is the node I am getting on searching for samloader (without spaces). Could you please suggest how I can browse to the node?

Screenshot 2024-06-30 204547

Screenshot 2024-06-30 204533

ltdrdata commented 5 days ago

Just tried as you suggested, updated comfyui as well - this is the node I am getting on searching for samloader (without spaces). Could you please suggest how I can browse to the node?

Screenshot 2024-06-30 204547

Screenshot 2024-06-30 204533

Oh.. I got it some custom node is overriding the Impact Pack's SAMLoader. That is the reason. The reason is ComfyUI-YOLO node.

vararth commented 5 days ago

Thank you! Disabled ComfyUI-YOLO for now, got the correct loader :)

image

With you on the Comfy.org team and this speed of assistance - I am happy that part of the future of AI is in right hands ;)

Thanks again for the speedy resolution :D