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

how can I restart ComfyUI via the API? #44

Open
vesper8 opened this issue Jul 4, 2024 · 1 comment
Open

how can I restart ComfyUI via the API? #44

vesper8 opened this issue Jul 4, 2024 · 1 comment
Assignees

Comments

@vesper8
Copy link

vesper8 commented Jul 4, 2024

I have this custom extension that I added to ComfyUI Manager


import { app } from "../../scripts/app.js";
import { api } from "../../scripts/api.js"

app.registerExtension({
	name: "Comfy.ManagerMenu.extra.restart",
    async setup() {
        const menu = document.querySelector(".comfy-menu");

        const restartButton = document.createElement("button");
        restartButton.textContent = "Restart";
        restartButton.style.color = "#d72756";
        restartButton.onclick = () => {
            api.fetchApi("/manager/reboot");
        };

        const swlocaleBtn = document.getElementById("swlocale-button");
        menu.insertBefore(restartButton, swlocaleBtn.nextSibling);
    }
});

It adds a convenient restart button so you can save a click. It also shows how easy it is to access the internal api.

I am constantly having to manually restart ComfyUI whenever a workflow fails, or sometimes when I am switching workflows, some workflows will only work after restarting ComfyUI.

I would really like to be able to perform these commands by hitting the API that you expose in this package.

Is there any possibility to do that already? If not, why not? Is there another way to restart via API?

Many thanks!

@TimPietrusky
Copy link
Member

@vesper8 thanks for bringing this up.

There is no way in the runpod-worker-comfy to restart the API yet. Does "/manager/reboot" come from the ComfyUI Manager? This is not standard ComfyUI, right?

Would you mind to share your use case? I would love to understand, why this feature would be needed in the real world. Does this happen locally when you are developing or do you also need this when the serverless API is deployed on RunPod?

@TimPietrusky TimPietrusky self-assigned this Jul 29, 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