ERNIE Image Visual Promptsmith
by @yoimiya66
Generate ERNIE-Image-Turbo images through Baidu AI Studio and craft ERNIE-Image prompts for posters, comics, infographics, ecommerce images, UI-style visuals...
clawhub install ernie-image-visual-promptsmithπ About This Skill
name: ernie-image-visual-promptsmith description: Generate ERNIE-Image-Turbo images through Baidu AI Studio and craft ERNIE-Image prompts for posters, comics, infographics, ecommerce images, UI-style visuals, bilingual text rendering, structured layouts, negative prompts, generation settings, and use_pe decisions. Requires a user-provided AI Studio API key and is not an official Baidu skill. metadata: openclaw: emoji: "\U0001F3A8" skillKey: "ernie-image-visual-promptsmith" homepage: "https://aistudio.baidu.com/account/accessToken" requires: env: - BAIDU_AISTUDIO_API_KEY anyBins: - python3 - python - py primaryEnv: BAIDU_AISTUDIO_API_KEY
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
API Endpoint
https://aistudio.baidu.com/llm/lmapi/v3POST /images/generationshttps://aistudio.baidu.com/llm/lmapi/v3/images/generationsAuthorization: bearer X-Client-Platform: aistudioAPI Key
BAIDU_AISTUDIO_API_KEYhttps://aistudio.baidu.com/account/accessTokenBAIDU_AISTUDIO_API_KEY.Triggers
ERNIE image: , Wenxin image: , generate image: , or equivalent Chinese wording for image generation.ernie image: , generate image: , create image: .Prompt Workflow
1. 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.
2. Preserve immutable constraints: exact in-image text, language, subject count, character identity, spatial relationships, size, style, and forbidden elements.
3. Build the core prompt in five parts: subject -> action/context -> style -> lighting -> quality.
4. For layout-sensitive requests, append composition -> exact text -> spatial placement.
5. Keep in-image writing short when possible. Turn paragraphs into titles, labels, badges, or numbered lines.
6. For text rendering, put exact wording in quotes and specify placement, font weight, alignment, color, background contrast, and whitespace.
7. Choose a preset from auto, text-poster, infographic, comic, product, ui, photo, concept, or abstract.
8. Before generation, state:
Final Prompt:
Preset:
use_pe:
Size:
Reason:
Generation Workflow
Use the bundled Python script. Prefer python3; on Windows use python or py if needed.
python3 {baseDir}/scripts/generate.py --prompt "" --preset
For exact text, bilingual labels, UI, flowcharts, signs, comics, or already detailed prompts, pass --no-use-pe.
python3 {baseDir}/scripts/generate.py --prompt "" --preset text-poster --no-use-pe
The script prints IMAGE_URL: for URL responses and MEDIA: 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": "",
"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=url returns image URLs in data[]; the script prints IMAGE_URL:.MEDIA: for OpenClaw/ClawHub auto-attach.ernie-image--. .Defaults
ERNIE-Image-Turboauto1url42text-poster, infographic, comic, product, and ui presets default to use_pe=false.photo, concept, and abstract presets default to use_pe=true.Negative Prompt Rules
text, letters, typography, Chinese text, or English text when the user wants readable writing.Retry Strategy
--no-use-pe.References
references/api.md for parameters, command examples, and endpoint mapping.references/prompt-architecture.md for ERNIE-Image prompt templates.references/examples.md for acceptance-style examples.