Add a Gradio websocket API interface example for running api workflows with previews/progress/interrupt #5024
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Final image:
I personally recommend using the following to handle loading workflows, instead of having the mess within the code: