/install ernie-image-visual-promptsmith
ERNIE-Image Visual Promptsmith
Use this community skill to craft ERNIE-Image prompts and generate images through the AI Studio ERNIE-Image-Turbo endpoint. It is not official Baidu or ERNIE-Image software.
Decide the Mode
- Generate immediately when the user asks to generate, draw, create, make an image, or uses equivalent Chinese generation wording.
- Return prompt-only guidance when the user asks to optimize, rewrite, improve, or review a prompt.
- Ask one concise question only if an exact visible text string, language, or required aspect ratio is missing and guessing would likely break the result.
API Endpoint
- Base:
https://aistudio.baidu.com/llm/lmapi/v3 - Submit:
POST /images/generations - Full URL:
https://aistudio.baidu.com/llm/lmapi/v3/images/generations - Auth header:
Authorization: bearer \x3CBAIDU_AISTUDIO_API_KEY> - Platform header:
X-Client-Platform: aistudio
API Key
- Required environment variable:
BAIDU_AISTUDIO_API_KEY - Get a key:
https://aistudio.baidu.com/account/accessToken - If the key is missing, do not call the API. Tell the user to set
BAIDU_AISTUDIO_API_KEY.
Triggers
- Chinese examples:
ERNIE image: \x3Cprompt>,Wenxin image: \x3Cprompt>,generate image: \x3Cprompt>, or equivalent Chinese wording for image generation. - English examples:
ernie image: \x3Cprompt>,generate image: \x3Cprompt>,create image: \x3Cprompt>. - Treat text after the colon as the raw user prompt, improve it, choose a preset, then generate.
- If the user asks to optimize, rewrite, improve, or review a prompt, return prompt-only guidance and do not call the API.
Prompt Workflow
- Classify the image style: photorealistic, anime/manga, text-in-image, concept art, abstract/artistic, layout/composition, poster, ecommerce, infographic, comic/storyboard, UI screenshot style, or character-consistent visual.
- Preserve immutable constraints: exact in-image text, language, subject count, character identity, spatial relationships, size, style, and forbidden elements.
- Build the core prompt in five parts: subject -> action/context -> style -> lighting -> quality.
- For layout-sensitive requests, append composition -> exact text -> spatial placement.
- Keep in-image writing short when possible. Turn paragraphs into titles, labels, badges, or numbered lines.
- For text rendering, put exact wording in quotes and specify placement, font weight, alignment, color, background contrast, and whitespace.
- Choose a preset from
auto,text-poster,infographic,comic,product,ui,photo,concept, orabstract. - Before generation, state:
Final Prompt: \x3Cprompt>
Preset: \x3Cpreset>
use_pe: \x3Ctrue or false>
Size: \x3Csize>
Reason: \x3Cwhy these settings fit ERNIE-Image>
Generation Workflow
Use the bundled Python script. Prefer python3; on Windows use python or py if needed.
python3 {baseDir}/scripts/generate.py --prompt "\x3CFINAL_PROMPT>" --preset \x3Cpreset>
For exact text, bilingual labels, UI, flowcharts, signs, comics, or already detailed prompts, pass --no-use-pe.
python3 {baseDir}/scripts/generate.py --prompt "\x3CFINAL_PROMPT>" --preset text-poster --no-use-pe
The script prints IMAGE_URL:\x3Curl> for URL responses and MEDIA:\x3Cabsolute_path> for each saved image. Return the saved media path to the user.
If BAIDU_AISTUDIO_API_KEY is missing, tell the user to get a key from https://aistudio.baidu.com/account/accessToken and set BAIDU_AISTUDIO_API_KEY.
Submit Payload
{
"model": "ERNIE-Image-Turbo",
"prompt": "\x3CFINAL_PROMPT>",
"n": 1,
"response_format": "url",
"size": "1024x1024",
"seed": 42,
"use_pe": true,
"num_inference_steps": 8,
"guidance_scale": 1.0
}
Download and Output
response_format=urlreturns image URLs indata[]; the script printsIMAGE_URL:\x3Curl>.- The script downloads each URL immediately and saves the image locally.
- The script prints
MEDIA:\x3Cabsolute_path>for OpenClaw/ClawHub auto-attach. - URLs may expire; the local file remains available after download.
- Output names are generated as
ernie-image-\x3Ctimestamp>-\x3Cindex>.\x3Cext>. - Do not pass user-controlled filenames to shell commands.
Defaults
- Model:
ERNIE-Image-Turbo - Preset:
auto - Count:
1 - Response format:
url - Seed:
42 text-poster,infographic,comic,product, anduipresets default touse_pe=false.photo,concept, andabstractpresets default touse_pe=true.
Negative Prompt Rules
- Do not add
text,letters,typography,Chinese text, orEnglish textwhen the user wants readable writing. - Prefer precise negatives: distorted text, misspelled words, duplicated letters, unreadable typography, warped layout, cropped title, low contrast, blurry details, inconsistent panels, artifacts.
- The API does not expose a separate negative prompt field in this skill. Express exclusions as natural language constraints inside the prompt, such as "avoid cluttered background" or "no visible watermark".
Retry Strategy
- Text errors: reduce the amount of visible text, quote exact words once, add stronger placement and contrast, then use
--no-use-pe. - Layout errors: simplify object count, name each region, use grid/split-screen/foreground/background terms, then keep the same seed.
- Weak style: add camera/lens, art movement, medium, color temperature, material texture, and lighting direction.
- Cluttered image: remove secondary elements, add negative space, use "avoid cluttered background", and switch to a simpler preset if needed.
References
- Read
references/api.mdfor parameters, command examples, and endpoint mapping. - Read
references/prompt-architecture.mdfor ERNIE-Image prompt templates. - Read
references/examples.mdfor acceptance-style examples.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install ernie-image-visual-promptsmith - After installation, invoke the skill by name or use
/ernie-image-visual-promptsmith - Provide required inputs per the skill's parameter spec and get structured output
What is ERNIE Image Visual Promptsmith?
Generate ERNIE-Image-Turbo images through Baidu AI Studio and craft ERNIE-Image prompts for posters, comics, infographics, ecommerce images, UI-style visuals... It is an AI Agent Skill for Claude Code / OpenClaw, with 68 downloads so far.
How do I install ERNIE Image Visual Promptsmith?
Run "/install ernie-image-visual-promptsmith" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is ERNIE Image Visual Promptsmith free?
Yes, ERNIE Image Visual Promptsmith is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does ERNIE Image Visual Promptsmith support?
ERNIE Image Visual Promptsmith is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created ERNIE Image Visual Promptsmith?
It is built and maintained by YOIMIYA66 (@yoimiya66); the current version is v1.0.1.