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

Sam Detector from Load Image doesn't have a CPU only option #3375

Closed
Maveyyl opened this issue Apr 29, 2024 · 2 comments
Closed

Sam Detector from Load Image doesn't have a CPU only option #3375

Maveyyl opened this issue Apr 29, 2024 · 2 comments

Comments

@Maveyyl
Copy link

Maveyyl commented Apr 29, 2024

Sam Detector from Load Image doesn't have a CPU only option, which makes it impossible to run on an AMD card.

@shawnington
Copy link
Contributor

Sam Detector from Load Image doesn't have a CPU only option, which makes it impossible to run on an AMD card.

This would be an issue for @ltdrdata but from my looking through the code, you can definitely set it to run cpu only.

@server.PromptServer.instance.routes.post("/sam/detect")
async def sam_detect(request):
    global sam_predictor
    with sam_lock:
        if sam_predictor is not None:
            if impact.config.get_config()['sam_editor_cpu']:
                device = 'cpu'
            else:
                device = comfy.model_management.get_torch_device()

            sam_predictor.model.to(device=device)

@Maveyyl
Copy link
Author

Maveyyl commented May 11, 2024

My bad, it is a feature of Impact pack not of main ComfyUI! I modified the .ini file from impact folder and could make it work. Many thanks @shawnington

@Maveyyl Maveyyl closed this as completed May 11, 2024
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