Moved logic of "post_prompt" endpoint to sub-function, allowed custom "prompt_id" #6129
+41
−33
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.
Relates to #6114
The changes do not break backward compatibility, all logic remains the same.
Allows having the class PromptServer which is returned by the
start_comfyui
function from the linked PR, without opening a websocket connection, to add tasks for execution to the Comfy engine.For everything to work together beautifully, there is missing ability to add custom own
event_callback
which will be called at the beginning of thePromptExecutor.add_message
method, so that without connecting to the websocket you can receive all messages from the Comfy engine and monitor the progress (I already have this locally).What do you say, @comfyanonymous, should I include this PR in the linked one and add the ability to call the callback in
add_message
, or will we merge both of these PRs, and I will open a third small one? (it depends on the first one because it changes the same files)