Install
openclaw skills install @dlazyai/dlazy-picture-bookpicture book, storybook, children's book, illustrated story, bedtime story book, 绘本——create a complete picture book from a theme: write the paged story, generate style-consistent illustrations page by page with dlazy gpt-image-2, generate matching background music with dlazy elevenlabs-music, then assemble a self-contained HTML book with image-left / text-right spreads, page turning, and background music. Defaults to 10 pages. Use when the user wants a picture book / storybook / children's book / bedtime story, or says 'make me a picture book about ...'.
openclaw skills install @dlazyai/dlazy-picture-bookpicture book, storybook, children's book, illustrated story, bedtime story book, 绘本——create a complete picture book from a theme: write the paged story, generate style-consistent illustrations page by page with dlazy gpt-image-2, generate matching background music with dlazy elevenlabs-music, then assemble a self-contained HTML book with image-left / text-right spreads, page turning, and background music. Defaults to 10 pages.
All dlazy requests require a dLazy API key. The recommended way to authenticate is:
dlazy login
This runs a device-code flow (also works in remote shells) and automatically saves your API key to the local CLI config — no manual copy/paste required.
dlazy auth set YOUR_API_KEY
The CLI saves the key in your user config directory (~/.dlazy/config.json on macOS/Linux, %USERPROFILE%\.dlazy\config.json on Windows), with file permissions restricted to your OS user account. You can also supply the key per-invocation via the DLAZY_API_KEY environment variable.
Each key is scoped to your dLazy organization and can be rotated or revoked at any time from the same dashboard.
@dlazy/cliRun on demand without a global install:
npx @dlazy/cli@latest <command>
Review the GitHub source before installing.
Illustrations are generated by dlazy gpt-image-2 and background music by dlazy elevenlabs-music; both are thin clients over the dLazy hosted API:
api.dlazy.com) for inference.files.dlazy.com); result URLs are also hosted there.The story text, page composition, and HTML assembly happen locally — you (the agent) write the story and call this skill's scripts/build_book.py to inject the content into assets/template.html, producing a self-contained HTML. Standard SaaS pattern; the skill does not access network or filesystem beyond what the dLazy CLI handles.
A folder you can open directly; index.html is the book:
<book-title>/
├── index.html ← the finished book (image-left/text-right, page turning, BGM)
├── book.json ← content data (title, per-page image+text, music)
├── images/ ← cover.png, page-01.png … page-10.png
└── music/ ← bgm.mp3
Reading experience: cover (large image + title + "Start reading") → spreads (illustration on the left in 3:4, story text on the right; turn pages with arrow keys / click left-right / bottom dots) → end page. A background-music toggle sits top-right. On mobile it becomes image-top / text-bottom.
Images and music are referenced by relative paths, so the whole folder is portable and works offline.
A picture book is story + image + sound as one whole; quality comes from keeping the three coordinated. Do the steps in order — each sets up the next.
Before starting, align on these (fill sensible defaults for anything unstated and say so — don't interrogate the user):
Write the whole book's text first, then generate images, so the visuals follow one narrative thread.
Write book.json first (image/music paths as placeholders that will already be correct once generated):
{
"title": "The Little Fox's Star Lantern",
"subtitle": "A warm story about sharing",
"cover_image": "images/cover.png",
"music": "music/bgm.mp3",
"pages": [
{ "image": "images/page-01.png", "text": "Deep in the forest lived a little fox in a red scarf…" },
{ "image": "images/page-02.png", "text": "…" }
]
}
Consistency is where picture books fail — the same fox can't look different on every page. Use the first page as a style anchor:
Generate page 1 first, writing the character look, art style, palette, and composition in full detail. This sets the visual baseline for the whole book.
dlazy gpt-image-2 --quality low --size 1024x1536 \
--prompt "Children's book illustration, warm watercolor style, 3:4 portrait. An orange little fox in a red scarf lies on a windowsill gazing at the round moon outside, nighttime, soft warm lamplight, healing childlike mood, clean negative space."
Pass page 1 as the reference image via --images on every later page so the hero and style carry over; only the scene changes:
dlazy gpt-image-2 --quality low --size 1024x1536 \
--images images/page-01.png \
--prompt "Same orange fox in a red scarf, same watercolor style and palette. This page: the fox shoulders a small backpack and walks into the forest under the moonlight. 3:4 portrait."
The result URL is at result.outputs[0].url. Download it into images/ with curl:
curl -L -o images/page-01.png "<returned url>"
On parameters: --quality low is low quality (fast, cheap, plenty for small book art); --size 1024x1536 is the closest small portrait to 3:4 (gpt-image-2 has no exact 3:4 tier; the template crops to 3:4 so it looks right).
Cover: same idea — use page 1 as reference to generate a more atmospheric hero image into images/cover.png.
Execution discipline (important): run one generation command at a time — wait for it to return and download before the next — don't fire all 10 image commands at once or chain them with
&/&&. This is both because later pages need the previous image as a reference and because&/&&error out under Windows PowerShell.
Write one music prompt from the story's mood; give it enough length to cover a read-through (60–90s for a bedtime story is fine, it loops):
dlazy elevenlabs-music --duration 75 \
--prompt "Gentle, soothing children's bedtime music, soft piano and music box, dreamy and warm, a background for reading a picture book aloud, no vocals."
Download the result into music/bgm.mp3 with curl the same way.
Make sure the paths in book.json match the files you actually downloaded, then run this skill's build script:
python3 <this-skill-dir>/scripts/build_book.py book.json -o index.html
It injects book.json into assets/template.html to produce a self-contained index.html. Keep index.html next to images/ and music/.
Tell the user the output folder path, that double-clicking index.html opens the book, and that the top-right button toggles the music. Share the cover image URL for a quick preview.
Illustration · gpt-image-2 (full help: dlazy gpt-image-2 -h)
| Flag | Picture-book usage |
|---|---|
--prompt | Scene description (character + scene + style + "3:4 portrait") |
--images | Reference image (page-1 path) to keep character/style consistent, up to 5 |
--quality | low (small book art, fast and cheap) |
--size | 1024x1536 (closest small portrait to 3:4) |
Background music · elevenlabs-music (full help: dlazy elevenlabs-music -h)
| Flag | Picture-book usage |
|---|---|
--prompt | Mood description (instruments, emotion, "no vocals", good for reading aloud) |
--duration | Seconds; 60–90 is fine for a bedtime story, it loops |
Results are always at result.outputs[0].url; download with curl -L -o <local path> "<url>".
| Code | Error Type | Example Message |
|---|---|---|
| 401 | Unauthorized (No API Key) | ok: false, code: "unauthorized", message: "API key is missing or invalid" |
| 501 | Missing required parameter | error: required option '--prompt <prompt>' not specified |
| 502 | Local file read error | Error: Image file not found: C:\path\to\your\file |
| 503 | API request failed (no balance) | ok: false, code: "insufficient_balance" |
| 503 | API request failed (server error) | HTTP status code error (500 server crash) |
| 504 | Asynchronous task execution failed | === Generation Failed === / {Specific error reason returned by backend, e.g. "Prompt violates safety policy"} |
AGENT CRITICAL INSTRUCTION:
- If the result returns
code: "insufficient_balance", you MUST explicitly tell the user their credits are insufficient and guide them to recharge: https://dlazy.com/dashboard/organization/settings?tab=credits- If the result returns
code: "unauthorized"or indicates a missing API key, you MUST tell the user to get their API key from https://dlazy.com/dashboard/organization/api-key and save it withdlazy auth set <key>, then resume.- If one image is rejected for violating the safety policy, rewrite that page's prompt (drop sensitive/violent/photoreal-person content) and retry — don't abandon the whole book.
Visit https://dlazy.com for more information.