Automation
Add a Markdown-to-image tool to Dify
Import one OpenAPI schema and your Dify agents and workflows can render Markdown into images on their own — no code node, no external service to host.
Why
What people build with it
Let an agent turn its own Markdown answer into a shareable card without a separate manual step.
In a workflow, render retrieved documents as images for a report-style or slide-style output.
Give a knowledge-base bot the ability to return formatted tables and diagrams as pictures instead of raw Markdown text.
Setup
Connecting Dify
- 01
Create an API token under Profile → API tokens. It starts with mti_ and is shown only once.
- 02
In Dify, open Tools → Custom → Create Custom Tool.
- 03
In the schema field, switch to importing from a URL and paste this. Dify fetches the OpenAPI document and lists generate_image automatically.
https://markdowntoimage.com/api/v1/openapi.json
- 04
Set the authentication method to API Key, choose Bearer as the type, and paste your mti_ token as the value.
- 05
Save the tool. generate_image is now available to any agent, chatflow, or workflow node in that workspace.
Every parameter — themes, fonts, code styles, page size for PDF — is listed in the API reference.