Fannovel16 / comfyui_controlnet_aux

ComfyUI's ControlNet Auxiliary Preprocessors
Apache License 2.0
2.14k stars 202 forks source link

Metric3D Run error #358

Closed liulsg closed 4 months ago

liulsg commented 4 months ago

Version: commit d84683b Error content: Error occurred when executing Metric3D-NormalMapPreprocessor:

name 'plt' is not defined

File "G:\AI\ComfyUI_M\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\AI\ComfyUI_M\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 "G:\AI\ComfyUI_M\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\AI\ComfyUI_M\ComfyUI\custom_nodes\comfyui_controlnet_aux\node_wrappers\metric3d.py", line 44, in execute out = common_annotator_call(cb, image, resolution=resolution, fx=fx, fy=fy, depth_and_normal=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\AI\ComfyUI_M\ComfyUI\custom_nodes\comfyui_controlnet_aux\utils.py", line 85, in common_annotator_call np_result = model(np_image, output_type="np", detect_resolution=detect_resolution, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\AI\ComfyUI_M\ComfyUI\custom_nodes\comfyui_controlnet_aux\node_wrappers\metric3d.py", line 43, in cb = lambda image, kwargs: model(image, kwargs)[1] ^^^^^^^^^^^^^^^^^^^^^^ File "G:\AI\ComfyUI_M\ComfyUI\custom_nodes\comfyui_controlnet_aux\src\controlnet_aux\metric3d__init.py", line 110, in call depth_map, normalmap, = predict_depth_normal(self.model, self.cfg, input_image, fx=fx, fy=fy) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\AI\ComfyUI_M\ComfyUI\custom_nodes\comfyui_controlnet_aux\src\controlnet_aux\metric3d__init__.py", line 73, in predict_depth_normal pred_color = gray_to_colormap(pred_depth, 'Greys') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\AI\ComfyUI_M\ComfyUI\custom_nodes\comfyui_controlnet_aux\src\controlnet_aux\metric3d\init__.py", line 44, in gray_to_colormap norm = plt.Normalize(vmin=0, vmax=1.1) # Use plt.Normalize instead of matplotlib.colors.Normalize ^^^ Version: f111b7796c9ad9ba68c8c234896f4208fd283689 This version works correctly

knowknow0 commented 4 months ago

I'm getting the same error as you.

Fannovel16 commented 4 months ago

@knowknow0 @liulsg Try git pull to get commit https://github.com/Fannovel16/comfyui_controlnet_aux/commit/8e51eb352411212bcdda0bba8ddf69f889e6c23c

Moltes74 commented 3 months ago

Hi,

I got the quite the same error :

Error occurred when executing Metric3D-DepthMapPreprocessor: Failed to find function: controlnet_aux.metric3d.mono.model.backbones.vit_small_reg File "/Users/arthurmontessuit/Documents/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurmontessuit/Documents/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 "/Users/arthurmontessuit/Documents/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurmontessuit/Documents/ComfyUI/custom_nodes/comfyui_controlnet_aux/node_wrappers/metric3d.py", line 20, in execute model = Metric3DDetector.from_pretrained(filename=f"metricdepth{backbone.replace('-', '_')}_800k.pth").to(model_management.get_torch_device()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurmontessuit/Documents/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/controlnet_aux/metric3d/init.py", line 99, in from_pretrained model, cfg = load_model(f'vit-{backbone}', model_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurmontessuit/Documents/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/controlnet_aux/metric3d/init.py", line 29, in load_model model = get_configured_monodepth_model(cfg, ) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurmontessuit/Documents/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/controlnet_aux/metric3d/mono/model/monodepth_model.py", line 36, in get_configured_monodepth_model model = get_monodepth_model(cfg) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurmontessuit/Documents/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/controlnet_aux/metric3d/mono/model/monodepth_model.py", line 20, in get_monodepth_model model = DepthModel(cfg, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurmontessuit/Documents/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/controlnet_aux/metric3d/mono/model/monodepth_model.py", line 7, in init super(DepthModel, self).init(cfg) File "/Users/arthurmontessuit/Documents/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/controlnet_aux/metric3d/mono/model/model_pipelines/base_model.py", line 10, in init__ self.depth_model = get_func('controlnet_aux.metric3d.mono.model.model_pipelines.' + model_type)(cfg) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurmontessuit/Documents/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/controlnet_aux/metric3d/mono/model/model_pipelines/dense_pipeline.py", line 9, in init__ self.encoder = get_func('controlnet_aux.metric3d.mono.model.' + cfg.model.backbone.prefix + cfg.model.backbone.type)(**cfg.model.backbone) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurmontessuit/Documents/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/controlnet_aux/metric3d/mono/utils/comm.py", line 161, in get_func raise RuntimeError(f'Failed to find function: {func_name}')