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

this is can use api ? #115

Open
rookiexjl opened this issue Aug 10, 2023 · 9 comments
Open

this is can use api ? #115

rookiexjl opened this issue Aug 10, 2023 · 9 comments
Labels
enhancement New feature or request

Comments

@rookiexjl
Copy link

comfyUI use api ?

@ljleb
Copy link
Contributor

ljleb commented Aug 10, 2023

Please clarify your question. by any chance is your request for comfyui to make api requests to the a1111 webui to generate images?

@rookiexjl
Copy link
Author

rookiexjl commented Aug 11, 2023 via email

@ljleb
Copy link
Contributor

ljleb commented Aug 11, 2023

Sorry, I do not understand.

Please forgive me if I am not correct, but it seems that you are not fluent in english. You can ask your request in the language of your preference and I will translate it online before replying back to you in english, if that is okay with you of course.

@rookiexjl
Copy link
Author

是的,可以吗 用sd的api调用comfyui

@ljleb
Copy link
Contributor

ljleb commented Aug 11, 2023

Okay, now I believe I understand. IIUC, you want an API route in the webui for the comfyui extension, that will enable setting the workflows in the comfyui accordion of the txt2img and img2img tabs, when making txt2img or img2img calls respectively. This is so that you can control which workflow types (preprocess, preprocess_latent, postprocess, postprocess_latent, etc.) will run when calling the API.

Is that correct?

For making requests to comfyui directly, you should already be able to do that by using the address where the comfyui server resides (by default, this is http://localhost:8189).

@ljleb
Copy link
Contributor

ljleb commented Aug 11, 2023

Or sorry, not a dedicated API route, but rather allow to pass the workflows to the alwayson_scripts property?

@rookiexjl
Copy link
Author

rookiexjl commented Aug 11, 2023 via email

@ljleb
Copy link
Contributor

ljleb commented Aug 11, 2023

If you mean to ask whether there are any API at the moment, well there is NO API in the webui for this extension currently. We can add this feature in the future, if this is something you would want to use.

What would be a simple use case for you? I think there are many ways this extension could be used through the API. One way we could implement it in the future, could be something like this (note that this is not currently functioning code, I am just trying to define the feature more clearly):

hypothetical POST /sdapi/v1/txt2img

{
    "prompts": ["a majestic landscape"],
    ...
    "alwayson_scripts": {
        "comfyui": {
            "args": [{
                "id": "postprocess",
                "workflow": {...}
            }, {
                "id": "preprocess",
                "workflow": {...}
            }]
        }
    }
    ...
}

Again, this is not something that works currently, but it could work in the future when we implement it.

Is this what you want? Or is what you want to do not covered by this suggestion?

@rookiexjl
Copy link
Author

rookiexjl commented Aug 11, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants