Skip to main content

Install and Configure the Plugin

1

Install the plugin

Log in to your Dify platform, navigate to ToolsPlugin Marketplace, search for SoMark, and add the plugin.
2

Configure plugin settings

After installation, open the plugin configuration page:
  • Base URL: For SoMark API, fill in https://somark.tech/api/v1; for self-hosted deployment, fill in your local Base URL.
  • API Key: Required for SoMark API; leave blank for self-hosted deployment.
The Dify plugin runtime must be able to access the configured Base URL. Check your network, proxy, and DNS settings. Do not append a specific endpoint path to Base URL; the plugin will call the corresponding endpoint automatically.
3

Save

Click Save — the plugin is now ready to use in workflows.dify-SoMark工具授权配置

Using SoMark in a Workflow

1

Add the SoMark Document Parser tool node

In the Dify workflow editor, click + to add a new node, choose Tool, then find and add the SoMark > SoMark Document Parser node.Add SoMark tool node in Dify
2

Configure input variables

Click the variable icon {x} in the File input field and select the file variable provided by an upstream node, such as sys.files from your Start node. You can also configure optional parameters (for example Output Formats, Image Format, Table Format) as needed. If you leave Output Formats empty, the node returns both Markdown and JSON by default. See Input Parameters below for details. Base URL and API Key are injected automatically from the plugin configuration. You do not need to enter them in the node.Configure input variable in Dify
3

Reference outputs in downstream nodes

Once the node executes, its output variables are available to all downstream nodes (LLM, text splitter, code node, etc.). Click {x} in any downstream node’s input field to select the SoMark node’s output variables.

Parameters and Outputs

Input Parameters

ParameterTypeRequiredDescription
FileFileSupported files: PDF, PNG, JPG, JPEG, BMP, TIFF, JP2, DIB, PPM, PGM, PBM, GIF, HEIC, HEIF, WEBP, XPM, TGA, DDS, XBM, DOC, DOCX, PPT, PPTX. Max 200 MB / 300 pages.
Output FormatsMulti-selectSelect one or more output formats. Supported options: Markdown, JSON. If left empty, the default outputs are Markdown and JSON.
Image FormatSingle-selectImage output format. Supported options: URL, Base64, None. Default: URL.
Formula FormatSingle-selectFormula output format. Supported options: LaTeX, MathML, ASCII. Default: LaTeX.
Table FormatSingle-selectTable output format. Supported options: HTML, Markdown, Image. Default: HTML. In Markdown mode, merged cells are expanded into individual cells with duplicated content.
Chemical Structure Formula FormatSingle-selectChemical structure output format. Supported options: Image. Default: Image.
Enable Text Cross PageTrue / FalseMerge text that spans across pages into a continuous paragraph. Default: False.
Enable Table Cross PageTrue / FalseMerge tables that span across pages into a continuous table. Default: False.
Enable Title Level RecognitionTrue / FalseRecognize heading hierarchy such as H1/H2/H3. Default: False.
Enable Inline ImageTrue / FalseReturn images embedded in text paragraphs. Default: False.
Enable Table ImageTrue / FalseReturn images embedded in table cells. Default: True.
Enable Image UnderstandingTrue / FalsePerform semantic understanding and structured description for images in the document. Default: True.
Keep Header FooterTrue / FalseKeep page headers and footers instead of filtering them out. Default: False.

Output Variables

VariableDescription
markdownParsed document content in Markdown format, preserving the original layout including headings, tables, lists, equations, and images
json_strParsed result as a JSON string, containing structured data such as text blocks, tables, equations, images, bounding boxes, and page numbers. Parse it in a code node for advanced processing
textDify built-in variable. This plugin does not populate it
filesDify built-in variable. This plugin does not populate it