Skip to content
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

'Yoloworld_ESAM_Zho' has no attribute 'inference_sam_with_boxes'? #454

Open
Mike2100 opened this issue Aug 1, 2024 · 3 comments
Open
Assignees

Comments

@Mike2100
Copy link

Mike2100 commented Aug 1, 2024

Dears,
How to fix it?Belows are the error information.

!!! Exception during processing!!! type object 'Yoloworld_ESAM_Zho' has no attribute 'inference_sam_with_boxes' Traceback (most recent call last): File "D:\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "D:\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "D:\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "D:\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 "D:\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 "D:\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\core.py", line 699, in make_sam_mask detected_masks = sam_obj.predict(image, points, plabs, dilated_bbox, threshold) File "D:\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\core.py", line 593, in predict detected_masks = self.func_inference.inference_sam_with_boxes(image=image, xyxy=[bbox], model=self.model, device=self.device) AttributeError: type object 'Yoloworld_ESAM_Zho' has no attribute 'inference_sam_with_boxes'

@cyandddd
Copy link

cyandddd commented Sep 5, 2024

same error here

@Pu4
Copy link

Pu4 commented Feb 3, 2025

There's a different package involved. The error occurs because ComfyUI-Impact-Pack tries to call a method from ComfyUI-YoloWorld-EfficientSAM which isn't there. Here's an open pull request which is supposed to fix it
pr
If you need it right here right now you need to add

    @staticmethod
    def inference_sam_with_boxes(**kwargs):
        return inference_with_boxes(**kwargs)

to YOLO_WORLD_EfficientSAM.py in \ComfyUI\custom_nodes\ComfyUI-YoloWorld-EfficientSAM somewhere around line 106

@mr-september
Copy link

There's a different package involved. The error occurs because ComfyUI-Impact-Pack tries to call a method from ComfyUI-YoloWorld-EfficientSAM which isn't there. Here's an open pull request which is supposed to fix it pr If you need it right here right now you need to add

    @staticmethod
    def inference_sam_with_boxes(**kwargs):
        return inference_with_boxes(**kwargs)

to YOLO_WORLD_EfficientSAM.py in \ComfyUI\custom_nodes\ComfyUI-YoloWorld-EfficientSAM somewhere around line 106

Thanks, this worked for me. I put it in between class Yoloworld_ESAM_Zho: and the first@classmethod:

class Yoloworld_ESAM_Zho:
    def __init__(self):
        pass

    @staticmethod
    def inference_sam_with_boxes(**kwargs):
        return inference_with_boxes(**kwargs)
    
    @classmethod
    def INPUT_TYPES(cls):
        return {
            ... 

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

No branches or pull requests

5 participants