Skip to main content

One post tagged with "generate"

View All Tags

Updated Generate tool for better AI diagrams

· 5 min read

The Generate tool has been overhauled so that it is more flexible and more customisable via the draw.io configuration dialog.
The updated Generate tool in draw.io with a chat list on the left, generated diagram previews in the middle, and a query text box at the bottom

  • Start a New Chat in the Generate dialog to generate a new or different diagram.
  • Edit the query, or Send a clarification query to make changes to an already generated diagram. Apply those changes to the diagram you had already added to the drawing canvas.
  • Change the default initial LLM instructions, set specific LLM models, and use your own LLM API keys via the draw.io configuration.
Generate a UML sequence diagram from a text description via the diagram generate dialog in draw.io

Which LLM models?

The most appropriate LLM model for the diagram type you specified in your query will be chosen automatically. The model list that draw.io uses changes frequently - currently, OpenAI, Claude and Gemini are used.

Using multiple AI generators supports a wide range of diagrams, including interface mock-ups, infrastructure diagrams, Mermaid diagrams and more.

You can also set specific instructions and configurations for each action and/or model in the draw.io editor configuration.
customise the AI models used in diagram generation in draw.io via Extras > Configuration

Set specific AI models

Add your own LLM API keys to choose specific models from the Claude, Gemini and GPT families in the Generate dialog, instead of using the free hosted draw.io backend.

  1. Select Extras > Configuration from the menu.
  2. Enter your API keys in the AI configuration section, then click Apply.
    Add your own LLM API keys in the draw.io configuration to choose specific AI models in the Generate dialog

The model selector in the Generate dialog will list your configured models. Via the configuration options, you can also add new or self-hosted models with compatible APIs, customise the system prompts, or disable the AI features completely.

Tip: The Clipboard backend needs no API key - it copies your request to the clipboard so you can paste it into an external AI tool, then paste the response back into the Generate dialog.

Generate a diagram

  1. Click on the Generate tool (sparkle button) in the toolbar, or select Arrange > Insert > Generate from the menu.
    Click on the Generate tool in the draw.io toolbar to open the Generate diagram dialog
  2. Describe your diagram, starting with the type of diagram you want, then press Enter or click on Send.
  3. Click + to add the generated diagram to the drawing canvas.
    Insert the generated diagram on the drawing canvas in draw.io

The diagram will be added to the drawing canvas, where you can edit its shapes, connectors, text and styles as in any other draw.io diagram.

Tips: Hover over a diagram in the dialog to see a larger preview, and click on the microphone to dictate your query instead of typing it. Click + Chat to start a new chat for each new diagram - see examples of generated diagrams.

Share your diagram data with the LLM

Do you want the Generate tool to make changes to an existing diagram, page, or selected shapes and connectors?

Click on the + in the lower left of the query text box and attach the diagram File, the current diagram Page, or just the Selection of shapes and connectors.
Share your draw.io diagram file, the current diagram page or the selected shapes and connectors with the Generate tool via the + in the bottom left of the query text box

The Generate tool will return an updated version of your diagram.

  • Click on the tick to Apply the changes to the diagram on the drawing canvas.
  • Click on the + to Add the new version to the drawing canvas in addition to any existing shapes and connectors.
    Apply the suggested changes to your diagram on the drawing canvas, or add the new version alongside the existing shapes

Note: The Generate tool only has access to the diagram data that it has generated in that chat and anything you have explicitly shared with it. Learn more about AI diagram generation.

Generate diagrams in your AI chats

If you prefer to work in your AI tool instead, use the draw.io MCP server. The MCP server lets LLMs create draw.io diagrams and open them in the draw.io editor. With AI services that support MCP Apps, such as Claude.ai and VSCode, diagram previews will appear inline in your AI chat.