Install
openclaw skills install @livingbody/ernie-imageGenerate images with ERNIE-Image. Use for image create requests incl. edits. Supports text-to-image ; - 1024x1024/1376x768/1264x848/ 1200x896/896x1200/848x1264/768x1376; use --input-image.
openclaw skills install @livingbody/ernie-imageGenerate new images or edit existing ones using Baidu's ERNIE-Image API.
Clawdbot installed and configured
Need Install python openai sdk: pip instsall openai
The script checks for API key in this order:
ERNIE-Image_API_KEY environment variable--api-key argument (use if user provided key in chat)Run the script using absolute path (do NOT cd to skill directory first):
Generate new image:
python ~/.codex/skills/ERNIE-Image/scripts/generate_image.py --prompt "your image description" --filename "output-name.png" [--resolution 1024*1024|1366*768] [--api-key KEY]
Important: Always run from the user's current working directory so images are saved where the user is working, not in the skill directory.
ERNIE-Image API supports three resolutions (uppercase K required):
Map user requests to API parameters:
1024x1024If neither is available, the script exits with an error message.
Preflight:
test -n \"$ERNIE-Image_API_KEY\" (or pass --api-key)test -f \"path/to/input.png\"Common failures:
Error: No API key provided. → set ERNIE-Image_API_KEY or pass --api-keyGenerate filenames with the pattern: yyyy-mm-dd-hh-mm-ss-name.png
Format: {timestamp}-{descriptive-name}.png
yyyy-mm-dd-hh-mm-ss (24-hour format)x9k2, a7b3)Examples:
2025-11-23-14-23-05-japanese-garden.png2025-11-23-15-30-12-sunset-mountains.png2025-11-23-16-45-33-robot.png2025-11-23-17-12-48-x9k2.pngFor generation: Pass user's image description as-is to --prompt. Only rework if clearly insufficient.
Preserve user's creative intent in both cases.
Use templates when the user is vague or when edits must be precise.
Generate new image:
python ~/.codex/skills/ERNIE-Image/scripts/generate_image.py --prompt "A serene Japanese garden with cherry blossoms" --filename "2025-11-23-14-23-05-japanese-garden.png" --resolution 1024*1024