Skip to content

Conversation

@guill
Copy link
Member

@guill guill commented Jul 13, 2025

This change implements feature flag support on the frontend. When the frontend
establishes a websocket connection to the backend, it will send a feature flag message
informing the backend of available functionality. This allows the backend to be smarter
about sending messages that the frontend will understand.
We also receive a feature flag message from the backend and provide functions to query
available functionality on the backend. This allows custom nodes (and built-in code)
to gate functionality depending on whether the backend actually supports it.

This change was factored out of #4382

┆Issue is synchronized with this Notion page by Unito

A video showing that ComfyUI still works (no visible changes result from this PR.)
https://github.com/user-attachments/assets/d79b01f0-df5f-426c-b69a-b8a56e4a5453

guill added 3 commits July 12, 2025 21:01
This is to avoid having people muck with the values for now. We'll add
the ability to modify feature flags (in a way that won't conflict with
other custom nodes or future changes to core) later.
@guill guill marked this pull request as ready for review July 13, 2025 07:47
@guill guill requested review from a team as code owners July 13, 2025 07:47
webfiltered
webfiltered previously approved these changes Jul 13, 2025
Copy link
Contributor

@webfiltered webfiltered left a comment

Choose a reason for hiding this comment

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

Can you please note the need for the new interfaces to be any typed and merge?

If there isn't one (anymore/yet?), can we make them unknown instead? It makes the eventual enabling of "no implicit/explicit any type" rules easier.

Comment on lines 253 to 262
/**
* Alias for serverFeatureFlags for test compatibility.
*/
get feature_flags() {
return this.serverFeatureFlags
}

set feature_flags(value: Record<string, any>) {
this.serverFeatureFlags = value
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this do? If it's removed and the refs in the unit test replaced with serverFeatureFlags, everything still passes.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've removed it. Claude suggested it and I assumed it was related to how TypeScript stubs out functionality in unit tests. Not really sure though now 🤔

@guill
Copy link
Member Author

guill commented Jul 15, 2025

Can you please note the need for the new interfaces to be any typed and merge?

If there isn't one (anymore/yet?), can we make them unknown instead? It makes the eventual enabling of "no implicit/explicit any type" rules easier.

Had no idea unknown was a thing! Fixed 👍

@guill
Copy link
Member Author

guill commented Jul 15, 2025

output.mp4

A video showing that ComfyUI still works.

@guill guill requested a review from webfiltered July 15, 2025 22:25
Copy link
Contributor

@webfiltered webfiltered left a comment

Choose a reason for hiding this comment

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

The blurriness took me a second, but I managed to read your test prompt. Megapproved. 🤣

@webfiltered webfiltered merged commit 1200c07 into main Jul 15, 2025
13 checks passed
@webfiltered webfiltered deleted the js/feature_flags branch July 15, 2025 22:59
benceruleanlu pushed a commit that referenced this pull request Jul 24, 2025
@christian-byrne christian-byrne mentioned this pull request Jul 24, 2025
christian-byrne pushed a commit that referenced this pull request Aug 4, 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.

3 participants