← 返回
未分类 Key

Ernie Image Gen

百度文生图 / Baidu ERNIE-Image text-to-image generation. Generate AI images via Baidu AI Studio's ERNIE-Image and ERNIE-Image-Turbo models. 中文:支持文生图、AI绘图、图片生成、百度生...
百度文生图(ERNIE‑Image)文生图生成。通过百度 AI Studio 的 ERNIE‑Image 与 ERNIE‑Image‑Turbo 模型快速生成 AI 图片。
aiwork4me aiwork4me 来源
未分类 clawhub v2.0.0 1 版本 100000 Key: 需要
★ 1
Stars
📥 353
下载
💾 0
安装
1
版本
#latest

概述

ERNIE-Image Generation

Generate images with Baidu AI Studio's ERNIE-Image models through the

OpenAI-compatible API. Best when the user specifically wants Baidu/ERNIE

generation, Chinese-language image prompts, or local PNG outputs.

Safety Boundary

  • Use this skill only for explicit image-generation requests.
  • Prompts and parameters are sent to Baidu AI Studio. Do not include secrets,

credentials, private personal data, or confidential business data in prompts.

  • Follow Baidu AI Studio terms and applicable platform rules. Decline unsafe,

deceptive, exploitative, or rights-violating image requests.

  • Do not print, store, or ask the user to paste AI_STUDIO_API_KEY into chat.

The script reads it from the environment only.

  • Generated files are written locally. Confirm the output directory when the

user has not specified one.

Prerequisites

  • Python 3.11+ with uv installed
  • AI_STUDIO_API_KEY environment variable set to your Baidu AI Studio access token
  • Get a token at: https://aistudio.baidu.com/account/accessToken

Prefer ERNIE-Image-Turbo, 1024x1024, n=1, and b64_json unless the user

asks for different parameters.

Models

ModelBest for
------
ERNIE-Image-TurboFast drafts, iteration, batch previews
ERNIE-ImageSlower, higher-quality final outputs

Chinese prompts usually work especially well with these models.

Generation Workflow

Step 1 -- Compose the prompt

Write a descriptive prompt (max 1024 characters, ~150 words). Chinese and English both work well. Be specific about subject, style, composition, and mood.

Good: "A golden retriever puppy sitting in a sunflower field at sunset, warm golden light, shallow depth of field, professional photography"

Bad: "dog"

Step 2 -- Choose parameters

ParameterValuesDefault
---------
modelERNIE-Image-Turbo, ERNIE-ImageERNIE-Image-Turbo
size1024x1024, 768x1376, 1376x768, 896x1200, 1200x896, 848x1264, 1264x8481024x1024
n1-41
seedany integerrandom
steps4-20provider default
guidance1.0-7.5provider default
use-peflagoff

Select size based on content: portraits and posters use vertical (768x1376, 848x1264, 896x1200), landscapes and covers use horizontal (1376x768, 1264x848, 1200x896), general use 1024x1024.

Step 3 -- Run the generation script

Execute the bundled script with uv run:

uv run {baseDir}/scripts/generate.py "<PROMPT>" --model ERNIE-Image-Turbo --size 1024x1024

For batch generation:

uv run {baseDir}/scripts/generate.py "<PROMPT>" --n 4 --output ./output_dir

For higher quality with more inference steps and stronger guidance:

uv run {baseDir}/scripts/generate.py "<PROMPT>" --model ERNIE-Image --steps 16 --guidance 3.5

For reproducible results:

uv run {baseDir}/scripts/generate.py "<PROMPT>" --seed 42

Step 4 -- Output

The script saves images as PNG files to the output directory and prints:

Saved: ernie_20260430_110100.png (1.7 MB)
MEDIA:/absolute/path/to/ernie_20260430_110100.png

The MEDIA: line enables automatic image attachment in compatible environments.

The script avoids overwriting existing files by adding a numeric suffix when needed.

For JSON output, add --json to get structured results:

{
  "success": true,
  "model": "ERNIE-Image-Turbo",
  "files": [{"path": "/abs/path/ernie_20260430_110100.png", "size_bytes": 1715660}],
  "prompt": "...",
  "parameters": {"size": "1024x1024", "seed": 42}
}

Quick Triggers

When the user says any of these, treat the text after the trigger as the prompt and generate immediately with defaults:

  • Chinese: "生成图片:xxx" / "文生图:xxx" / "百度生图:xxx" / "ERNIE生图:xxx" / "AI画图:xxx" / "AI绘图:xxx" / "出图:xxx" / "画画:xxx"
  • English: "generate image: xxx" / "ernie image: xxx" / "baidu image: xxx" / "create image: xxx" / "text-to-image: xxx" / "AI art: xxx" / "make a picture: xxx" / "draw: xxx"

Defaults: model=ERNIE-Image-Turbo, size=1024x1024, n=1, b64_json format.

Notes

  • Images are saved locally as PNG files with MEDIA:/absolute/path/to/file.png for auto-attach.
  • Chinese prompts work particularly well with ERNIE models.
  • Prompt enhancement (--use-pe) lets the model expand simple prompts into richer descriptions before generation. Enable for short prompts, disable for precise control.
  • Use --quiet to suppress progress output; only MEDIA: lines (or JSON with --json) are printed. Recommended when calling from agent workflows to reduce context noise.
  • For full API reference, prompt guidance, and troubleshooting, read {baseDir}/references/api-guide.md.

版本历史

共 1 个版本

  • v2.0.0 当前
    2026-05-07 20:13 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Paddleocr Doc Parsing Radeon

aiwork4me
免费文档解析,AMD Radeon Cloud运行PaddleOCR‑VL 1.5,从PDF和文档图片提取结构化Markdown/JSON——表格单元格……
★ 1 📥 450

Image Metadata Cleaner

aiwork4me
清除用户图片中的隐私敏感元数据(C2PA、EXIF、XMP、IPTC、GPS),生成清洗后的副本。用于隐私保护和文件准备。
★ 0 📥 334

Ernie Image Radeon

aiwork4me
免费 ERNIE-Image 文生图生成,AMD Radeon Cloud 驱动,无需 API 密钥,支持 ERNIE-Image 与 ERNIE-Image‑Turbo 模型生成 AI图像。
★ 0 📥 275