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

Add a Gradio websocket API interface example for running api workflows with previews/progress/interrupt #5024

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RandomGitUser321
Copy link
Contributor

A simple interface demo showing how you can link Gradio and ComfyUI together. I know there are obviously alternatives like Forge, but being able to make complex custom api workflows and then run them from a simple UI is always great, plus Gradio works really well from phones and tablets. I left a lot of notes to help explain things. I'm sure it's not the prettiest coding, but it works and handles most of the edge cases that I could think of.

Also features: Interrupting, progress and previews.

Working previews:
image
Final image:
image

I personally recommend using the following to handle loading workflows, instead of having the mess within the code:

with open("/path/to/workflow.json", "r", encoding="utf-8") as f:
    prompt = json.load(f)

@mcmonkey4eva
Copy link
Collaborator

Not necessarily a bad project idea, but probably doesn't belong in the core comfy repo?

@RandomGitUser321
Copy link
Contributor Author

Yeah I didn't really know where to throw it. Since it was websocket API related, I figured here would be a decent spot for it since this is also an examples folder. But since it's a more focused use case, maybe in ComfyUI_examples?

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

Successfully merging this pull request may close these issues.

2 participants