Skip to content

Conversation

@deepanjanroy
Copy link
Contributor

@deepanjanroy deepanjanroy commented Jul 9, 2025

The Comfy UI backend currently ignores the post body.

┆Issue is synchronized with this Notion page by Unito

@deepanjanroy deepanjanroy requested a review from a team as a code owner July 9, 2025 01:21
prompt,
remove: { name: 'Cancel', cb: () => api.interrupt() }
// prompt[1] is the prompt id
remove: { name: 'Cancel', cb: () => api.interrupt(prompt[1]) }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prompt[1] is not the most readable, but this bit of code is only used by the legacy UI and it's somewhat complicated to have nicer types here, so I did a low-effort thing.

@christian-byrne
Copy link
Contributor

christian-byrne commented Jul 9, 2025

Hi @deepanjanroy, will this change be later supported by a change to the /interrupt endpoint on the HTTP server? Or will the change be dependent on the backend type?

Currently, the /queue and /history endpoint allow cancelling or deleting items by id when passing delete key:

On the frontend, we create abstracted deleteItem method on our public api module:

/**
* Deletes an item from the specified list
* @param {string} type The type of item to delete, queue or history
* @param {number} id The id of the item to delete
*/
async deleteItem(type: string, id: string) {
await this.#postItem(type, { delete: [id] })
}

Is there a known limitation for these approaches? Or is this something specific for cloud?

@deepanjanroy
Copy link
Contributor Author

Hi @christian-byrne! We needed it for cloud yes, don't think we need to support it right now on regular Comfy backend. The regular comfy backend only supports running one task at a time so it doesn't need to know the prompt id. (cc @robinjhuang if I got anything wrong)

Re: why not use cancel queue / delete history: I think none of those cancel a currently executing task. That's exclusively handled by interrupt.

@robinjhuang
Copy link
Member

robinjhuang commented Jul 9, 2025

Yeah echoing what Deep said. Interrupt is meant to cancel currently running jobs, so the intention is different from cancel (cancel items in the queue). Is this a harmless change on FE (even if ComfyUI backend doesn't use it for now)? Or are there potential side effects? @christian-byrne

Edit: FYI this is not urgent at all so it can wait.

@robinjhuang
Copy link
Member

Looks like there's a PR to implement this in core too. https://github.com/comfyanonymous/ComfyUI/pull/8308/files

@christian-byrne christian-byrne force-pushed the dproy-prompt-id-interrupt branch from fd82ef5 to c51db04 Compare July 9, 2025 20:55
@christian-byrne
Copy link
Contributor

Okay makes sense, thanks for explanation.

I don't forsee side effects. This could be merged currently if necessary.

@github-actions github-actions bot requested review from a team, KarryCharon, Yorha4D and shinshin86 as code owners July 9, 2025 20:59
@deepanjanroy deepanjanroy force-pushed the dproy-prompt-id-interrupt branch from a558966 to b4a2459 Compare July 9, 2025 22:01
@deepanjanroy
Copy link
Contributor Author

@christian-byrne / any other code owners: would you mind approving the PR and merging it if there are no other blockers?

@webfiltered webfiltered merged commit 7cf5d1e into main Jul 11, 2025
13 of 14 checks passed
@webfiltered webfiltered deleted the dproy-prompt-id-interrupt branch July 11, 2025 00:24
@christian-byrne christian-byrne mentioned this pull request Jul 11, 2025
3 tasks
jtydhr88 pushed a commit that referenced this pull request Jul 12, 2025
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.

5 participants