Inpainting

Inpainting gives users the ability to let AI adjust parts of a piece of content without regenerating or impacting the whole. This makes collaboration with AI more predictable and controllable, reduces rework, and speeds iteration.

This pattern applies across all types of content, and can be used for interacting with existing content or remixing AI-generated content during a session.

For example,

  • When writing an essay: I may ask AI to adjust the tone of a paragraph that I feel I am not getting quite right to see how it would reflect back my overall tone to me.
  • When AI generates text: I can direct it to make changes in situ to the conversation itself.
  • When generating creative assets like visuals or audio, I can isolate a part of the interface and have the AI apply new tokens only to that area.
Adobe Firefly and Notion are two examples of tools that use inpainting effectively. The action is clearly identifiable from the interface with suggested prompts and nudges to help the user iterate on their generation

The discoverability and usability of this pattern depends on part on the existing paradigms of the underlying medium.

Image editors already come with an eraser brush to make spot edits, and associating the erased area with options to prompt for what should replace it may feel familiar.

Text editors don't have a similar paradigm of erasing content in situ to a highlight, so inline actions are used as an affordance to take action on the highlighted text.

In any case, you can maintain user agency over their experience by allowing them to verify generations before overwriting the original, making undo easy, and giving people the option to replace the original or add the new generation into the text inline.

Design considerations

  • Make it easy to find and view the area to be edited. Give users precision tools to select the precise area they wish to adjust. This might include a brush size slider in image tools, or a time-based selector in audio tools that goes down to the tenth of a second. Provide both quick, rough tools (brush, auto-select) and precision options (lasso, feathering) so users can choose the right level of control.
  • Anchor edits in surrounding context. Blend seamlessly with adjacent areas, but give users the option to widen or narrow the context window so they can prioritize realism or control.
  • Allow users to adjust the prompt. Give users full control to change the core prompt, parameters, model, references, and so on to get their intended result out of the action.
  • Provide variations. While subsequent prompts benefit from the surrounding context and generative history, the model still might not get it perfectly right. Providing variants speeds up the iterative process by letting users choose the option closest to their intent and move forward from there.
  • Verify to commit. For inpainting that occurs inline, such as a change to text or code, ensure the user verifies the change before overwriting their work.

Examples

Text in Jira tickets can be edited directly from the canvas. Users are asked to verify the AI’s work before it’s accepted
ElevenLabs breaks their constructed songs into standard sections like verse, pre-chorus, chorus, etc. Users can edit the overall style of the song or make surgical changes to lyrics and tokens within each section
Github Copilot allows users to adjust code directly within the IDE. Users have to verify the recommended code change, at which point it is integrated into the code
Lovable allows users to point at specific items on the canvas instead of relying on the chat bar to make changes. Updates to the targeted divs don’t impact the rest of the site
In Udio, use inpainting to select a segment of song to adjust. Change the style, tempo, lyrics, etc and regenerate. The rest of the song stays the same