Skip to content

Hotkeys

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.

  • Browse all available hotkeys organized by category (App, Canvas, Gallery, Workflows, etc.).
  • Search for specific hotkeys using the search bar.
  • See the current key combination for each action.

When customizing hotkeys, use the following formats:

  • Valid Modifiers: mod (Ctrl on Windows/Linux, Cmd on Mac), ctrl, shift, alt
  • Valid Keys: Letters (a-z), Numbers (0-9), Function keys (f1-f12), Special keys (enter, space, tab, backspace, delete, escape), Arrow keys (up, down, left, right)
  • Multiple alternatives: Separate with commas (e.g., 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)

  • Stores custom hotkey mappings in Redux state.
  • Persisted to IndexedDB using redux-remember.
  • Provides actions to change, reset individual, or reset all hotkeys.

To add a new hotkey to the system, follow these steps:

  1. Add Translation Strings In invokeai/frontend/web/public/locales/en.json:

    {
    "hotkeys": {
    "app": {
    "myAction": {
    "title": "My Action",
    "desc": "Description of what this hotkey does"
    }
    }
    }
    }
  2. Register the Hotkey In invokeai/frontend/web/src/features/system/components/HotkeysModal/useHotkeyData.ts:

    // Inside the appropriate category builder function
    addHotkey('app', 'myAction', ['mod+k']); // Default binding
  3. Use 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]
});
This site was designed and developed by Aether Fox Studio.