Package Information
Documentation
n8n-nodes-chinese-name-comparator
This is an n8n community node that allows you to compare Chinese names rendered with different fonts using Gemini LLM for visual analysis.
n8n is a fair-code licensed workflow automation platform.
Installation
Operations
Compatibility
Usage
Workflow Example
Resources
Installation
Follow the installation guide in the n8n community nodes documentation.
Manual Installation
- Go to your n8n installation directory
- Navigate to
customfolder (create if it doesn't exist) - Clone or copy this repository
- Run
npm installin the node directory - Run
npm run build - Restart n8n
NPM Installation
npm install n8n-nodes-chinese-name-comparator
Operations
This node supports the following operation:
Render and Compare Names
Renders two Chinese names with different fonts and prepares them for comparison with Gemini LLM.
Input Parameters:
- Name 1: First Chinese name to compare
- Name 2: Second Chinese name to compare
- Font 1: Font file for the first name (TTF or OTF format as base64)
- Font 2: Font file for the second name (TTF or OTF format as base64)
- Font 1 Name: Name to use for font 1 registration (default: "font1")
- Font 2 Name: Name to use for font 2 registration (default: "font2")
Output:
name1: The first name providedname2: The second name providedprompt: Formatted prompt for Gemini LLMimage1: Base64-encoded PNG image of name1image2: Base64-encoded PNG image of name2geminiPrompt: Prompt ready for Gemini LLM nodegeminiImages: Array of base64 images for Gemini LLM- Binary data:
image1andimage2as PNG files
Compatibility
- Minimum n8n version: 1.0.0
- Requires
canvasmodule support - Tested with n8n version: 1.0.0
Usage
Basic Workflow Setup
Chinese Name Font Comparator Node
- Add this node to your workflow
- Enter the two Chinese names you want to compare
- Provide font files as base64 strings (or use a previous node to read them)
- Execute the node
Gemini LLM Node (connect to the output)
- Use the
geminiPromptfield for the prompt - Use the
geminiImagesfield for the images - The Gemini LLM will analyze the visual differences
- Use the
Process Results
- Add additional nodes to handle the Gemini response
Workflow Example
Here's a complete example workflow:
1. Chinese Name Font Comparator Node
Input:
- Name 1: "張偉"
- Name 2: "张伟"
- Font 1: [base64 of traditional Chinese font]
- Font 2: [base64 of simplified Chinese font]
2. Gemini LLM Node
Input:
- Prompt: {{$json.geminiPrompt}}
- Images: {{$json.geminiImages}}
3. IF Node
Check Gemini's confidence level and determine if names match
4. Send Notification
Email or Slack notification with results
Handling Font Files
Since font files need to be provided as base64 strings, you have several options:
Option 1: HTTP Request Node
// Fetch font from URL
// The HTTP Request node will provide binary data
// Connect to a Function node to convert to base64
Option 2: Function Node
// Convert binary font data to base64
const fontBuffer = $binary.data;
const base64Font = fontBuffer.toString('base64');
return { font1: base64Font };
Option 3: Read Binary File Node
// If fonts are local files
// Use Read Binary File node
// Then convert to base64 using Function node
Technical Details
This node uses:
- canvas library for rendering Chinese characters with custom fonts
- Temporary file storage for font registration
- Base64 encoding for font input and image output
- Integration with Gemini LLM for visual comparison
The node creates 400x200px PNG images with:
- White background
- Black text
- 48px font size
- Centered text alignment
Example Use Cases
- Traditional vs Simplified Chinese: Compare traditional and simplified versions of the same name
- Font Compatibility: Check if different fonts render names correctly
- Name Verification: Verify if two names are the same despite different fonts
- Document Processing: Validate names extracted from documents with different fonts