View All Hotkeys
See all available keyboard shortcuts organized by category in one place.
InvokeAI allows you to customize all keyboard shortcuts (hotkeys) to match your workflow preferences. This guide covers how to use and customize hotkeys as a user, as well as providing technical documentation for developers.
View All Hotkeys
See all available keyboard shortcuts organized by category in one place.
Customize Any Hotkey
Change any shortcut to your preference, or assign multiple key combinations to the same action.
Smart Validation
Built-in validation prevents invalid combinations.
Persistent Settings
Your custom hotkeys are safely stored and restored across sessions.
Press Shift + ? or click the keyboard icon in the application to open the Hotkeys Modal.
When customizing hotkeys, use the following formats:
mod (Ctrl on Windows/Linux, Cmd on Mac), ctrl, shift, alta-z), Numbers (0-9), Function keys (f1-f12), Special keys (enter, space, tab, backspace, delete, escape), Arrow keys (up, down, left, right)mod+enter, ctrl+enter)The hotkeys system allows developers to centrally define, manage, and validate hotkeys throughout the application. It is built on top of react-hotkeys-hook.
The customizable hotkeys feature comprises the following components:
Hotkeys State Slice (hotkeysSlice.ts)
redux-remember.useHotkeyData Hook (useHotkeyData.ts)
HotkeyEditor.tsx: Inline editor with live preview, validation, and modifier insertion.HotkeysModal.tsx: The modal interface supporting View/Edit modes, searching, and categories.To add a new hotkey to the system, follow these steps:
Add Translation Strings
In invokeai/frontend/web/public/locales/en.json:
{ "hotkeys": { "app": { "myAction": { "title": "My Action", "desc": "Description of what this hotkey does" } } }}Register the Hotkey
In invokeai/frontend/web/src/features/system/components/HotkeysModal/useHotkeyData.ts:
// Inside the appropriate category builder functionaddHotkey('app', 'myAction', ['mod+k']); // Default bindingUse the Hotkey in Components
import { useRegisteredHotkeys } from 'features/system/components/HotkeysModal/useHotkeyData';
const MyComponent = () => { const handleAction = useCallback(() => { // Your action here }, []);
// Automatically uses custom hotkeys if configured useRegisteredHotkeys({ id: 'myAction', category: 'app', // 'app', 'canvas', 'viewer', 'gallery', 'workflows' callback: handleAction, options: { enabled: true, preventDefault: true }, dependencies: [handleAction] });
// ...};Only enable hotkeys when certain conditions are met:
useRegisteredHotkeys({ id: 'save', category: 'app', callback: handleSave, options: { enabled: hasUnsavedChanges && !isLoading, // Only when valid preventDefault: true }, dependencies: [hasUnsavedChanges, isLoading, handleSave]});Ensure hotkeys are only active when a specific region is focused:
import { useFocusRegion } from 'common/hooks/focus';
const MyComponent = () => { const focusRegionRef = useFocusRegion('myRegion');
// Hotkey only works when this region has focus useRegisteredHotkeys({ id: 'myAction', category: 'app', callback: handleAction, options: { enabled: true } });
return <div ref={focusRegionRef}>...</div>;};Provide multiple alternatives for the same action:
// In useHotkeyData.tsaddHotkey('canvas', 'redo', ['mod+shift+z', 'mod+y']); // Two alternatives