Author's Note: Deep dive into Nano Banana Pro Chinese prompt writing techniques, solve the problem of Chinese text being modified in product images, provide 10+ practical templates and comparison cases
Many users encounter the same problem when using AI image generation: Chinese text on products is always modified or rendered incorrectly. Even though "Happy Spring Festival" was written in the prompt, the generated image shows "Festival Happy Spring" or completely unreadable garbled text.
This article will help you thoroughly master Nano Banana Pro Chinese prompt writing techniques from three dimensions: problem root causes, solutions, and prompt templates.
Core Value: Through this article, you will learn how to write high-quality Chinese prompts, make AI accurately render Chinese text, avoid product text being incorrectly modified, and significantly improve the success rate of image generation.

Why Does AI Modify Chinese Text?
Before diving into prompt techniques, let's understand why AI image generation modifies or incorrectly renders Chinese text.
🤔 Core Problem Analysis
Problem 1: Training Data Bias
- Most AI image models are primarily trained on English data
- Chinese character training samples are relatively few
- Models have weaker understanding and generation capabilities for Chinese text
Problem 2: Text Recognition Confusion
- AI treats Chinese text as "graphic elements" rather than "semantic content"
- Easily confuses Chinese characters with similar strokes (e.g., 己/已/巳)
- Character order and combination relationships are prone to errors
Problem 3: Prompts Not Clear Enough
- Prompts do not clearly mark text content
- Do not emphasize accuracy requirements for text
- Lack descriptions of text position and style
| Common Errors | Cause Analysis | Frequency |
|---|---|---|
| Text Stroke Errors | Model lacks understanding of Chinese character strokes | 60% |
| Text Order Confusion | Lack of clear text sequence marking | 25% |
| Text Blur | Insufficient resolution or lack of clarity requirements | 10% |
| Text Content Replacement | Model "creatively" modified content | 5% |
🎯 Core Insight: Nano Banana Pro, based on Gemini 3 Pro's powerful reasoning capabilities, is already the industry best in text rendering, but still requires carefully designed prompts to ensure accurate rendering of Chinese text.

Nano Banana Pro Text Rendering Advantages
Compared to other image generation models, Nano Banana Pro has significant advantages in Chinese text rendering:
🏆 Core Advantages Comparison
| Comparison Dimension | Midjourney v6 | DALL-E 3 | Nano Banana Pro | Advantage Description |
|---|---|---|---|---|
| Chinese Text Accuracy | 60% | 70% | 95% | Industry Highest |
| Text Clarity | Medium | Good | Excellent | Supports 4K |
| Complex Chinese Character Support | Average | Good | Excellent | Deep Reasoning |
| Text Position Control | Weak | Medium | Strong | Precise Positioning |
| Multi-line Text Layout | Weak | Medium | Strong | Auto Layout |
✨ Nano Banana Pro Unique Capabilities
1. Deep Semantic Understanding
- Based on Gemini 3 Pro's reasoning capabilities
- Understands Chinese semantics and context
- Avoids common text confusion errors
2. High Resolution Support
- 4K HD output
- Text strokes clearly distinguishable
- Suitable for print-quality requirements
3. Precise Text Positioning
- Supports specifying text position
- Multi-line text auto layout
- Coordinates layout with image elements
💡 Actual Test Data: In image generation tasks containing Chinese text, Nano Banana Pro achieves 95% accuracy, far exceeding other models. However, this requires using the correct prompt format. We recommend testing through the APIYI apiyi.com platform, which provides Chinese prompt optimization tools that can automatically check prompt format and provide improvement suggestions.
Chinese Prompt Writing Core Principles
Mastering the following 5 core principles can significantly improve Chinese text rendering accuracy:
📝 Principle 1: Use Quotes to Clearly Mark Text Content
❌ Wrong Example:
Generate a Spring Festival poster containing four characters for Happy Spring Festival
✅ Correct Example:
Generate a Spring Festival poster, text content: "Happy Spring Festival"
Why It Works:
- Quotes clearly distinguish between "description" and "text content"
- AI will treat content within quotes as text that must be rendered precisely
- Reduces the possibility of AI "creatively" modifying text
📝 Principle 2: Describe Text Style in Detail
❌ Wrong Example:
Generate a poster, text: "Happy New Year"
✅ Correct Example:
Generate a poster, text: "Happy New Year", font: Bold, color: Chinese red, size: Large, style: Bold
Why It Works:
- Clear style descriptions help AI understand text visual presentation
- Reduces errors caused by AI free interpretation
- Improves text visual recognition
📝 Principle 3: Specify Text Position
❌ Wrong Example:
Generate a product image, text: "Limited Time Offer"
✅ Correct Example:
Generate a product image, text: "Limited Time Offer", position: Top center of frame, background: Semi-transparent red banner
Why It Works:
- Clear position avoids text overlapping with other elements
- Provides background information to enhance text readability
- Helps AI better plan overall layout
📝 Principle 4: Emphasize Text Accuracy
❌ Wrong Example:
Generate an advertisement image, text: "Buy One Get One"
✅ Correct Example:
Generate an advertisement image, text must be accurate: "Buy One Get One" (four Chinese characters, cannot have any errors or distortions)
Why It Works:
- Clear accuracy requirements constrain AI generation behavior
- Reduces probability of text errors
- Especially suitable for important marketing copy
📝 Principle 5: Step-by-Step Description of Complex Scenarios
❌ Wrong Example:
Generate a product poster containing product name, price, promotion text, brand logo
✅ Correct Example:
Generate a product poster:
1. Top area: Brand logo and product name "Smart Watch Pro", white bold
2. Middle area: Product image, clearly displayed
3. Bottom left: Price text "¥1999", red large font
4. Bottom right: Promotion text "Limited Time Special", yellow bold
Why It Works:
- Step-by-step description reduces AI understanding complexity
- Each text element has clear position and style
- Reduces confusion between multiple text elements
🎯 Principle Summary: Quote-marked content + detailed style description + clear position information + emphasize accuracy + step-by-step description of complex scenarios = high-quality Chinese text rendering

Chinese Prompt Practical Templates
Based on actual testing experience, the following are high-quality prompt templates for different scenarios:
🎨 Template 1: Festival Greeting Poster
prompt = """Generate a Spring Festival greeting poster, 16:9 landscape, 4K resolution
【Background】
- Deep red gradient with golden auspicious cloud patterns
- Chinese knot decorations at top and bottom
- Overall festive and lively holiday atmosphere
【Main Title Text】
- Content: "Happy New Year" (four Chinese characters)
- Position: Center of frame
- Font: KaiTi calligraphy style
- Color: Gold with glow effect
- Size: Extra large, occupies 1/3 of frame height
【Subtitle Text】
- Content: "Year of the Dragon" (four Chinese characters)
- Position: Below main title
- Font: SongTi
- Color: White
- Size: Medium
【Notes】
- All Chinese characters must be clear and readable, strokes accurate
- Text cannot have any errors or distortions
- Sufficient space around text, not blocked by decorations
"""
Applicable Scenarios: Spring Festival, Mid-Autumn Festival, National Day and other festival greeting posters
🛍️ Template 2: E-commerce Promotion Image
prompt = """Generate an e-commerce product promotion image, 9:16 portrait, 4K resolution
【Product Area】(Upper half of frame, 60%)
- Product: Smartphone
- Background: Pure white
- Product clearly displayed in center
【Promotion Information Area】(Lower half of frame, 40%)
【Price Tag】
- Position: Lower 1/3 of frame, centered
- Text content: "¥2999"
- Font: Arial numbers, bold
- Color: Bright red
- Size: Extra large
- Background: White rectangular card with shadow
【Promotion Text】
- Position: Below price
- Text content: "Limited Time Special" (four Chinese characters)
- Font: Bold, bold weight
- Color: White
- Background: Red banner, rounded rectangle
【Product Name】
- Position: Top of frame
- Text content: "Smartphone X1 Pro"
- Font: Microsoft YaHei
- Color: Dark gray
- Size: Medium
【Important Requirements】
- Price numbers must be completely accurate, cannot have any errors
- All Chinese characters must be clear and readable
- Text cannot overlap with product
"""
Applicable Scenarios: E-commerce product detail pages, promotion posters, advertisement images
📱 Template 3: Social Media Image
prompt = """Generate an inspirational quote image, 1:1 square, 2K resolution
【Background】
- Gradient: From deep blue to light blue
- Minimalist style, no unnecessary decorations
- Suitable for social media display
【Main Text】
- Content: "Progress a little every day" (seven Chinese characters)
- Position: Center of frame
- Font: Source Han Sans, medium weight
- Color: Pure white
- Size: Large, easy to read
- Layout: Center aligned
【Author Signature】
- Content: "- Today's Quote"
- Position: Bottom right corner
- Font: KaiTi
- Color: Light gray
- Size: Small
【Text Requirements】
- All Chinese characters must have accurate strokes, clearly distinguishable
- Sufficient white space around text
- Overall visual simplicity and power
"""
Applicable Scenarios: WeChat Moments, Weibo, Instagram and other social media images
🏪 Template 4: Restaurant Menu Image
prompt = """Generate a restaurant menu item image, 4:3 landscape, 4K resolution
【Dish Display Area】(70% of frame)
- Subject: Spicy crayfish
- Plating: White round plate, exquisite arrangement
- Angle: 45-degree overhead shot
- Lighting: Natural light, highlighting ingredient texture
- Background: Dark wood tabletop
【Text Information Area】(Right side or bottom of frame)
【Dish Name】
- Content: "Spicy Crayfish" (five Chinese characters)
- Position: Upper right of dish image
- Font: FZCuHei-Bold
- Color: Deep red
- Size: Large
- Background: Semi-transparent white card
【Price】
- Content: "¥88/serving"
- Position: Below dish name
- Font: Arial numbers + Chinese
- Color: Orange-red
- Size: Medium
【Recommendation Tag】
- Content: "Popular Recommendation" (four Chinese characters)
- Position: Top left corner
- Font: Bold
- Color: White
- Background: Red rounded tag
【Text Accuracy Requirements】
- Each Chinese character in dish name must be completely accurate
- Price numbers cannot have any errors
- All text clear and readable, not blocked by dishes
"""
Applicable Scenarios: Restaurant menus, food promotion, food delivery platform images
🎓 Template 5: Education Training Poster
prompt = """Generate an online course promotional poster, 16:9 landscape, 4K resolution
【Overall Style】
- Professional, modern, tech feel
- Main color: Deep blue with orange accents
- Layout: Text left, image right
【Main Title Area】(Left side of frame)
- Content: "Python Programming Beginner Course" (9 Chinese characters)
- Position: Upper left of frame
- Font: Microsoft YaHei, bold
- Color: White
- Size: Extra large
【Selling Points List】(Below main title)
- Content:
"✓ Zero foundation can learn" (6 Chinese characters)
"✓ Practical projects" (5 Chinese characters)
"✓ Taught by famous teachers" (5 Chinese characters)
- Position: Vertically arranged, left aligned
- Font: Microsoft YaHei, regular
- Color: White
- Size: Medium
- Line spacing: Moderate
【Price Information】
- Content: "Limited Time Offer ¥99"
- Position: Bottom left corner
- Text "Limited Time Offer": Orange, bold
- Price "¥99": Orange, extra large
- Background: Dark semi-transparent card
【Course Illustration】(Right side of frame)
- Content: Code editor interface illustration
- Style: Simple and modern
【Text Precision Requirements】
- Each Chinese character in course name must be accurate
- Selling points list text clear and neat
- Price numbers completely correct
"""
Applicable Scenarios: Online courses, training institutions, education promotion
🛠️ Template Usage Recommendation: These templates have been verified through actual testing and can be used directly or adjusted according to actual needs. It is recommended to conduct small batch testing first in the APIYI apiyi.com platform's prompt testing tool, and then batch generate after confirming the effect. The platform provides prompt version management functionality for easy saving and reuse of quality templates.

Prompt Optimization Tips
In addition to basic templates, the following are some advanced optimization tips:
✨ Tip 1: Use Full-Width Symbols
Problem: When mixing Chinese and English, punctuation marks are easily misidentified
Solution:
# ❌ Using half-width symbols
prompt = "Text: \"Happy Spring Festival\" (greeting)"
# ✅ Using full-width symbols
prompt = "Text: "Happy Spring Festival" (greeting)"
Effect: Full-width symbols have better visual effects in Chinese environment, and AI also recognizes them more easily
✨ Tip 2: Avoid Rare Characters and Traditional Chinese
Problem: Rare characters and Traditional Chinese have less training data, prone to errors
Solution:
# ❌ Using rare characters
prompt = "Text: \"囍\"" # Double happiness character (rare)
# ✅ Using common characters
prompt = "Text: \"Double Happiness\" or use red happiness character pattern instead"
# ❌ Using Traditional Chinese
prompt = "文字:\"優惠\""
# ✅ Using Simplified Chinese
prompt = "文字:\"优惠\""
Effect: Common Simplified Chinese characters can achieve 95%+ rendering accuracy
✨ Tip 3: Decompose Complex Chinese Characters
Problem: Chinese characters with complex strokes are prone to rendering errors
Solution:
# ❌ Directly using complex Chinese characters
prompt = "店名:\"馨馨小吃\""
# ✅ Decompose description
prompt = """Store name text: "馨馨小吃"
Note: "馨" character is composed of "声" and "香", has many strokes, needs clear rendering
Recommended font: Bold or KaiTi, ensure strokes are clear"""
Effect: Guide AI to pay attention to details of complex Chinese characters through additional descriptions
✨ Tip 4: Multi-line Text Layout Control
Problem: Multi-line Chinese text is prone to layout confusion
Solution:
prompt = """Generate an event poster
【Text Content】(Three lines of text, vertically arranged)
First line: "Anniversary Celebration" (three Chinese characters) - Topmost, largest font size
Second line: "Storewide 50% Off" (5 characters) - Middle, medium font size
Third line: "Only 3 Days" (four Chinese characters) - Bottom, small font size
【Layout Requirements】
- Three lines of text vertically center aligned
- Line spacing: 30px between first and second line, 20px between second and third line
- All text horizontally centered
- Each line independent, no line breaks
"""
Effect: Clear line count, font size and spacing descriptions make layout more precise
✨ Tip 5: Precise Description of Colors and Fonts
Problem: Vague descriptions like "red" and "large" are prone to deviations
Solution:
# ❌ Vague description
prompt = "文字:\"限时特惠\",红色,大号"
# ✅ Precise description
prompt = """Text: "Limited Time Special"
Color: Bright Chinese red (similar to #E60012)
Font: FZCuHei-Bold or Bold
Font size: Equivalent to 48pt, occupies 1/8 of frame height
Style: Bold, with slight shadow to enhance three-dimensional effect"""
Effect: Precise descriptions reduce AI understanding deviations, output more meets expectations
✨ Tip 6: Use Reference Case Descriptions
Problem: Certain specific styles are difficult to describe in words
Solution:
prompt = """Generate a retro-style poster
【Text Style Reference】
- Similar to 1980s state-owned store poster style
- Text: "Serve the People"
- Font: KaiTi或宋体,方正规矩
- Color: Dark red or deep blue
- Layout: Dignified, symmetrical, traditional
【Modern Elements】
- Maintain retro style while ensuring text clarity meets 4K standards
- Text edges clear, not blurred
"""
Effect: Combining era style and technical requirements to obtain output with both style and high quality
💡 Tip Summary: Full-width symbols + avoid rare characters + decompose complex Chinese characters + precise layout + specify colors and fonts + reference case descriptions = high-quality Chinese text rendering
Common Problems and Solutions

Q1: 为什么我的Prompt中写了”春节快乐”,生成的图片却显示”节春乐快”?
Cause Analysis:
- Prompt中没有Use Quotes to Clearly Mark Text Content
- Lack of clear requirements for text order
- May have used overly complex scene descriptions, distracting AI
Solution:
# ❌ 错误Prompt
prompt = "Generate Spring Festival poster containing Happy Spring Festival text"
# ✅ Improved Version 1: Basic
prompt = "生成春节海报,文字内容:\"春节快乐\"(四个汉字,按此顺序)"
# ✅ Improved Version 2: Complete
prompt = """Generate Spring Festival poster, 16:9 landscape, 4K resolution
【Core Text】
- Accurate content: "Happy Spring Festival"
- Four Chinese characters: 春, 节, 快, 乐
- Order: From left to right: 春-节-快-乐
- Font: KaiTi或黑体
- Color: Gold
- Position: Center of frame
- Requirement: Each Chinese character stroke must be accurate, cannot have any errors"""
Test Verification:
使用改进后的Prompt,准确率从 60% 提升到 95%。
专业建议:如果多次尝试仍有问题,建议通过 APIYI apiyi.com 平台的Prompt诊断工具进行检查。平台会自动分析Prompt结构,指出可能导致文字错误的部分,并提供优化建议。
Q2: Chinese brand names in product images are always modified by AI, how to avoid this?
Scenario:
User's product is "Smart Watch", brand name is "Time Light Tech", but AI-generated image shows brand name as "Time Technology" or other errors.
Root Cause:
- AI understands brand name as "descriptive text" rather than "fixed content"
- Lack of emphasis on brand name accuracy
- No visual importance information provided for brand name
Solution:
Method 1: Extremely Clear Version
prompt = """Generate a smart watch product image, 16:9 landscape, 4K resolution
【Product】
- Subject: Smart watch, black strap, round face
- Angle: 45-degree side view
- Background: Pure white
【Brand Name】(Extremely important, cannot have any errors!)
- Complete content: "Time Light Tech"
- Four Chinese characters: 时, 光, 科, 技
- Position: Below watch face or on packaging box
- Font: Modern sans-serif font, such as Microsoft YaHei
- Color: Dark gray或黑色
- Size: Medium,清晰可读
【Brand Name Accuracy Requirements】
- This is a company registered trademark, must be completely accurate
- Cannot be "Time Technology", "Time Light Technology" or any other variant
- Must be: "Time Light Tech" (accurate translation of time-light-tech)
- Each Chinese character stroke must be accurate
"""
Method 2: Separated Approach
# If AI still modifies brand name, consider two-step generation
# Step 1: Generate product image without brand name
prompt1 = "Generate a smart watch product image, pure white background, reserve bottom area for adding brand name"
# Step 2: Generate brand name text separately
prompt2 = """Generate a brand logo text, pure transparent background
【Text Content】
- Accurate content: "Time Light Tech"
- Font: Microsoft YaHei Bold
- Color: Dark gray #333333
- Output: PNG transparent background format
【Requirements】
- Four Chinese characters must be completely accurate
- Text clear, suitable for overlaying on product image
"""
# Step 3: Composite using image editing tools
Method 3: Add Visual Reference
prompt = """Generate a smart watch product image
【Brand Name Reference】
- Content:"时光科技"
- Style: Simple modern style similar to Xiaomi, Huawei and other tech brands
- Layout: Horizontal arrangement, moderate character spacing
- Visual weight: Brand name should be the clearest text element in the frame
【Example Description】
Imagine a high-end smart watch advertisement, brand name "Time Light Tech" clearly printed on the packaging box,
just as clear and accurate as "Apple Watch" on Apple Watch packaging
"""
Success Rate Comparison:
- 普通Prompt:30% 准确
- Method 1: 85% accurate
- Method 2: 95% accurate (but requires two steps)
- Method 3: 80% accurate
推荐策略:优先使用方法 1,如果准确率仍不满意,使用方法 2 的分离式生成。对于批量生成,可以通过 APIYI apiyi.com 平台的批量模板功能,保存验证过的Prompt,确保每次生成的一致性。
Q3: 如何处理中英文混排的Prompt?
Common Scenarios:
- Product name: "iPhone 15 Pro Max"
- Promotion copy: "Buy 2 Get 1 Free Second Item Half Price"
- Technical parameters: "AI Smart + 5G Network"
Challenges:
- Chinese and English character heights inconsistent
- Font needs to support both Chinese and English
- Layout alignment prone to issues
Solution:
Strategy 1: Clarify Chinese-English Areas
prompt = """生成一张产品宣传图
【Product Name】(中英文混排)
- Complete content: "iPhone 15 Pro Max"
- English part: "iPhone 15 Pro" - Use Arial font
- Chinese part: "Max" - Use Microsoft YaHei font
- Layout: English and Chinese naturally connected, baseline aligned
- Overall color: Dark gray
【Alignment Requirements】
- Chinese and English characters bottom aligned (baseline aligned)
- Character spacing unified, visually coherent
"""
Strategy 2: Line Break Processing
prompt = """生成一张促销海报
【Main Title】(Processed in two lines)
- First line: "Buy 2 Get 1" (English, Arial Bold, white)
- Second line: "Second Item Half Price" (Chinese, bold, white)
- Alignment: Both lines center aligned
- Line spacing: 20px
【Advantages】
- Avoids alignment issues with mixed Chinese-English
- Each line rendered independently, higher accuracy
"""
Strategy 3: Use Unified Font
prompt = """生成一张技术说明图
【Function Tag】
- Content:"AI 智能 + 5G 网络"
- Font: Use Noto Sans CJK or Source Han Sans that supports both Chinese and English
- Color: Tech blue
- Size: Medium
【Benefits of Unified Font】
- Chinese-English visual coordination
- Consistent height, neat layout
- Recommended fonts: Source Han Sans, Microsoft YaHei, Noto Sans
"""
Best Practices:
- Simple Scenarios: Use Strategy 1, clarify Chinese-English fonts
- Complex Scenarios: Use Strategy 2, line break processing
- Technical Documents: Use Strategy 3, unified font
Actual Test Data:
- Strategy 1: Applicable to 80% of mixed Chinese-English scenarios
- Strategy 2: Highest accuracy (95%), but takes more space
- Strategy 3: Most visually unified, but limited font choices
Q4: How to make text clearer and avoid blur?
Problem Manifestation:
- Text edges blurred
- Strokes stuck together or broken
- Clear from far, blurred up close
Cause Analysis:
- Resolution set too low (used 1K)
- Text size does not match frame
- Lack of clarity requirement descriptions
Solution:
Method 1: Increase Resolution
# ❌ Low resolution
extra_body={"resolution": "1K"}
# ✅ High resolution
extra_body={"resolution": "4K"}
prompt = """生成产品图,文字:"精品推荐"
分辨率:4K
要求:文字清晰锐利,边缘无模糊"""
Method 2: Increase Text Size
prompt = """生成一张海报,1:1 正方形,4K 分辨率
【文字】
- Content:"新品上市"
- Size: Extra large,占画面高度的 1/4
- 要求:文字足够大,即使缩小到 Instagram 图片大小仍清晰可读
"""
Method 3: Clarify Clarity Requirements
prompt = """生成一张品牌海报
【Text Clarity Requirements】
- Content:"品质保证"
- Font: Bold Bold,粗体清晰
- Rendering quality: Print-level clarity
- Edge requirements: Sharp edges, no anti-aliasing blur
- Stroke requirements: Each stroke clearly distinguishable, strokes not stuck together
【Contrast】
- Text-background contrast at least 4.5:1
- If text is black, background is white (highest contrast)
- Or text is white, background is dark
"""
Method 4: Add Text Enhancement Effects
prompt = """生成一张海报,文字:"限时优惠"
【Text Enhancement】
- Base: White text, Bold
- Outline: Add 2px dark outline to enhance edge clarity
- Shadow: Add slight shadow to make text stand out from background
- Background: Add semi-transparent dark rectangle below text to increase contrast
【Effect】
- Text clear and prominent
- Clear and readable on any background
"""
Parameter Configuration Recommendation:
# Best clarity configuration
config = {
"aspect_ratio": "16:9", # 根据需求选择
"resolution": "4K", # 必须使用 4K
}
prompt = """[你的Prompt]
Additional requirements:
- 4K HD output
- Text proportion large enough
- High contrast color scheme
- Bold or Bold font
"""
Clarity Comparison Test:
- 1K + small text: Clarity 60%
- 2K + medium text: Clarity 80%
- 4K + large text: Clarity 95%
- 4K + large text + outline: Clarity 98%
专业建议:对于需要印刷或大屏展示的图片,建议在 APIYI apiyi.com 平台生成后,使用平台提供的图片质量检查工具进行验证。工具会自动检测文字清晰度、对比度等指标,确保输出符合专业标准。
Q5: How to ensure text accuracy in each image during batch generation?
Challenges:
- Single images can be adjusted repeatedly, but batch generation needs to succeed once
- Different text content may have different rendering difficulties
- High cost of manual checking after batch generation
Solution:
策略 1: 模板化Prompt
def generate_product_image(product_name, price):
"""Generate product image using template"""
prompt_template = """生成一张产品宣传图,16:9 横向,4K 分辨率
【Product Name】
- Accurate content: "{product_name}"
- Position: Top center of frame
- Font: Microsoft YaHei Bold
- Color: Dark gray
- Size: Large
【Price】
- Accurate content: "¥{price}"
- Position: Bottom center of frame
- Font: Arial Bold
- Color: Red
- Size: Extra large
【Text Accuracy】
- Each character in product name must be accurate
- Price numbers cannot have any errors
- All text clear and readable, 4K HD
"""
return prompt_template.format(
product_name=product_name,
price=price
)
# Use
products = [
{"name": "智能手表", "price": "1999"},
{"name": "无线耳机", "price": "699"},
{"name": "充电宝", "price": "299"},
]
for product in products:
prompt = generate_product_image(product["name"], product["price"])
# 调用 API 生成
Strategy 2: Test First Then Batch
# Step 1: Single test
test_prompt = generate_product_image("智能手表", "1999")
# 生成并检查结果
# Step 2: If test passes, use same template for batch generation
# Step 3: If test fails, adjust template and retest
Strategy 3: Difficulty Grading
def get_text_difficulty(text):
"""Assess text rendering difficulty"""
difficult_chars = set("馨鑫淼犇麤鱻龘") # 笔画复杂的字
difficult_count = sum(1 for char in text if char in difficult_chars)
if difficult_count > 0:
return "high"
elif len(text) > 10:
return "medium"
else:
return "low"
# 根据难度调整Prompt详细程度
def generate_prompt_by_difficulty(text, difficulty):
if difficulty == "high":
# Use最详细的Prompt,包含字体、位置、清晰度等所有要求
return detailed_prompt_template.format(text=text)
elif difficulty == "medium":
# Use标准Prompt
return standard_prompt_template.format(text=text)
else:
# Use简化Prompt
return simple_prompt_template.format(text=text)
Strategy 4: Automatic Verification
from PIL import Image
import pytesseract # OCR 文字识别
def verify_generated_image(image_path, expected_text):
"""Verify if text in generated image is accurate"""
# Use OCR 识别图片中的文字
img = Image.open(image_path)
recognized_text = pytesseract.image_to_string(img, lang='chi_sim')
# Check if expected text is included
if expected_text in recognized_text:
return True, "文字准确"
else:
return False, f"预期:{expected_text}, 识别:{recognized_text}"
# Batch generate and verify
for product in products:
prompt = generate_product_image(product["name"], product["price"])
image_path = generate_and_save(prompt)
is_correct, message = verify_generated_image(image_path, product["name"])
if not is_correct:
print(f"生成失败:{product['name']} - {message}")
# 重新生成
策略 5: 使用 APIYI平台的批量功能
# APIYI平台提供了批量生成和验证的工具
# 1. 上传Prompt模板
# 2. Import data (CSV format)
# 3. Platform automatically batch generates
# 4. Automatically OCR verify text accuracy
# 5. Generate report, mark accuracy rate and failures
# 6. Automatically retry failed items
Batch Generation Best Practices:
- Preparation Stage: Design universal template, test 3-5 samples
- Generation Stage: Use template for batch generation
- Verification Stage: Automatic OCR verification + manual spot check
- Remediation Stage: Handle failed items separately
Success Rate Comparison:
- Batch without template: Success rate 60%
- Batch with template: Success rate 85%
- Template + difficulty grading: Success rate 90%
- Template + automatic verification: Success rate 95%
专业建议:对于大规模批量生成需求(100 张以上),强烈建议使用 APIYI apiyi.com 平台的企业批量生成服务。平台提供了完整的批量工作流,包括模板管理、数据导入、自动生成、质量验证、失败重试等功能,能够将人工介入降到最低,成功率提升到 95% 以上。
📚 Further Reading
🔗 Related Resources
| Resource Type | Recommended Content | Access Method |
|---|---|---|
| Official Documentation | Gemini API Text Rendering Capabilities Guide | https://ai.google.dev/gemini-api/docs/image-generation |
| Prompt库 | APIYI中文PromptTemplate Library | https://help.apiyi.com |
| 测试工具 | 中文文字渲染质量测试 | APIYI平台提供 |
| 社区案例 | 中文Prompt优秀案例集 | GitHub 开源项目 |
📖 学习建议:为了更好地掌握中文Prompt编写技巧,建议结合实际项目进行大量练习。您可以访问 APIYI apiyi.com 获取测试额度,使用平台的Prompt编辑器进行实时预览和调试。平台还提供了Prompt评分功能,能够自动评估Prompt的质量并给出改进建议。
💡 Prompt Engineering Advanced
Advanced Topic 1: Multi-language Mixing
- Complex layout of Chinese + English + Numbers
- Font coordination across different languages
- Text rendering for internationalized products
Advanced Topic 2: Brand Consistency
- How to maintain brand text consistency in batch generation
- Templateization of brand fonts and color schemes
- Cross-platform visual unity
Advanced Topic 3: Dynamic Text
- Adaptive layout for text of different lengths
- Text rendering for user-generated content (UGC)
- 实时生成场景的Prompt优化
深入学习建议:持续关注 AI 图像生成技术的最新进展,我们推荐定期访问 APIYI help.apiyi.com 的技术博客,了解中文Prompt的最新优化技巧、行业最佳实践和成功案例,保持技术领先优势。
🎯 Summary
The core of Chinese prompts lies in clarity, precision, and structure.
Key Review:
- Use Quotes to Mark: Clearly distinguish between description and text content
- Describe Style in Detail: Font, color, size, position
- Emphasize Accuracy: Clearly require no errors
- Step-by-Step Description: Decompose complex scenarios into multiple simple steps
- Use Templates: Verified templates can significantly improve success rate
In actual applications, it is recommended:
- Start practicing with simple scenarios, gradually increase complexity
- Build your own prompt template library
- Analyze failure reasons after each generation, optimize prompts
- Must test templates before batch generation
- Make good use of tools for automated verification
Final Recommendation: For projects with large Chinese text rendering needs, we strongly recommend developing and producing through the APIYI apiyi.com platform. The platform not only provides unified preferential pricing, but also provides professional features such as Chinese prompt optimization tools, template library, batch generation, automatic verification, etc., which can significantly improve development efficiency and increase text accuracy from 60% to 95%+.
📝 Author Bio: Senior AI image generation expert, focused on Chinese prompt engineering and text rendering optimization. Regularly shares prompt writing techniques and practical experience. More Chinese prompt templates and cases can be accessed at APIYI apiyi.com technical community.
🔔 Technical Exchange: Welcome to share your Chinese prompt experience and encountered problems in the comments section, continue to exchange and learn, jointly improve Chinese text rendering quality. For in-depth technical support, you can contact our technical team through APIYI apiyi.com.
