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.
app.registerExtension({ name: "MyExtension", // Define commands commands: [ { id: "myCommand", label: "My Command", function: () => { alert("Command executed!"); } } ], // Add commands to menu menuCommands: [ { path: ["Extensions", "My Extension"], commands: ["myCommand"] } ]});
Command definitions follow the same pattern as in the Commands and Keybindings API. See that page for more detailed information about defining commands.
{ id: string, // Unique identifier for the command label: string, // Display name for the command function: () => void // Function to execute when command is triggered}