Install
openclaw skills install scrapbook-illustratorInsert scrapbook-style illustrations into articles using image generation (GLM or OpenRouter). Use when the user wants to add images to an article, create illustrated content, or requests "illustrate this article", "add images to this article", "generate pictures for this post", "insert illustrations".
openclaw skills install scrapbook-illustratorTransform articles into illustrated markdown by generating hand-crafted scrapbook-style images and inserting them at logical break points.
Attribution: Based on glm-image by ViffyGwaanl (MIT License).
The bundled scripts/generate.py supports two providers. You need at least one:
export GLM_API_KEY="your-key""glm_api_key": "your-key" to ~/.openclaw/config.jsonGLM_API_KEY=your-key to .env in the skill directoryexport OPENROUTER_API_KEY="your-key""openrouter_api_key": "your-key" to ~/.openclaw/config.jsonOPENROUTER_API_KEY=your-key to .env in the skill directoryDefault OpenRouter model: openai/gpt-5-image-mini (strong text rendering for scrapbook prompts).
Auto-detection: If both keys are present, GLM is preferred. Use --provider openrouter or --provider glm to override.
portrait (1088x1920, default) or landscape (1920x1088)zh, en, ja, ko, fr, de, es. Always ask the user; never default or infer.Run a quick check — if neither GLM_API_KEY nor OPENROUTER_API_KEY is found, stop and tell the user how to configure (see Setup above). Do not proceed without a valid key.
Before generating any images:
Read the scrapbook system prompt from references/scrapbook-prompt.md.
Language handling:
zh): generate image descriptions in Chinese as the scrapbook prompt produceslanguage=en or other: after generating the JSON plan, translate all title and description fields to the target language before passing to generate.py. Keep the JSON structure identical.Using that prompt, analyze the article and output a JSON plan:
{
"project_title": "Article title — Scrapbook Style",
"style": "Physical Mixed-Media Scrapbook",
"total_images": 3,
"images": [
{
"image_id": 1,
"title": "Image caption",
"description": "300-500 character visual description in scrapbook style...",
"insert_after": "Exact sentence or heading after which to insert the image"
}
]
}
Target 1 image per 300–400 words of article content.
CRITICAL: Launch all image generations simultaneously. Each generation takes 20–40 seconds. Sequential generation wastes the user's time. Use background processes or concurrent exec calls to run all images at once.
For each image in the JSON plan, run the bundled script (all at the same time):
# Launch ALL images concurrently — do NOT wait for one to finish before starting the next
python3 scripts/generate.py "<description_1>" --language <lang> --size 1088x1920 &
python3 scripts/generate.py "<description_2>" --language <lang> --size 1088x1920 &
python3 scripts/generate.py "<description_3>" --language <lang> --size 1088x1920 &
wait # Wait for all to complete
In an OpenClaw agent context, use concurrent exec tool calls (one per image) rather than sequential calls. The agent MUST issue all exec calls in a single tool-use turn so they run in parallel.
Additional flags:
--provider glm|openrouter — override auto-detection--model <model> — override OpenRouter model (default: openai/gpt-5-image-mini)The script automatically:
On failure: If generation fails for one image, log the error and continue with remaining images. Do not abort the entire run. Note failed images in the output with [Image generation failed: <error>].
Collect: image URL/local path and cost for each successful image.
Insert each image after its designated insert_after anchor:

If the insert_after anchor is not found verbatim, insert at the nearest paragraph break.
Return the complete markdown article with:
<!-- Illustrated: N images generated, M failed, total cost: $X.XX -->Executed by the main OpenClaw agent session. No sub-agents spawned. The agent reads the article, generates prompts, invokes generate.py for each, and composes output in a single session.
Succeeds when:
references/scrapbook-prompt.md