Repository navigation
Add a way to attach metadata to the websocket messages of a prompt. - #16763
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
workflow_metadatadict can be passed when queueing a prompt and its key/values are included in every json websocket message of that prompt. Limited to 256 bytes; messages without aprompt_id(status, logs, asset events) are left alone.Lets the frontend tell which workflow a message belongs to without tracking prompt ids itself: Comfy-Org/ComfyUI_frontend#20045 sends the field, Comfy-Org/ComfyUI_frontend#20050 consumes it.
If a client sends no metadata but its prompt carries a workflow in
extra_pnginfo, that workflow'sidis used instead, which is the same id/api/jobsreports. This is the only part that reads the prompt body, and it is what keeps core and the cloud backend on one contract rather than two. Happy to drop it if you would rather it not.Earlier attempts, for context: #13684 (reverted in #13901), #13905, #13979, #13643.
Test approach to verify it works:
progress_state,progress,executing,executed,execution_start,execution_cachedandexecution_success.status.nodeorprompt_idby naming them in metadata.Not covered: binary preview frames are not stamped, since they are not json.