Topbar Menu
The Topbar Menu API allows extensions to add custom menu items to the ComfyUI’s top menu bar. This is useful for providing access to advanced features or less frequently used commands.
Basic Usage
Command definitions follow the same pattern as in the Commands and Keybindings API. See that page for more detailed information about defining commands.
Command Configuration
Each command requires an id
, label
, and function
:
Menu Configuration
The menuCommands
array defines where to place commands in the menu structure:
The path
array specifies the menu hierarchy. For example, ["File", "Export"]
would add commands to the “Export” submenu under the “File” menu.
Menu Examples
Adding to Existing Menus
Creating Submenu Structure
Multiple Menu Locations
You can add the same command to multiple menu locations:
Commands can work with other ComfyUI APIs like settings. For more information about the Settings API, see the Settings API documentation.