Illustrator: document → prompts → images
Two entry points. Compose reads a document and authors the prompt tree.
Render turns prompt JSONs into images. Builds no PDF (that is publisher).
When to Use
- "Illustrate this document / research.md", "make a picture book from this" → Compose (all steps).
- "Render these prompts", "rerun the renders", a folder of
prompts/*.json→ Render (steps 6–7). - A bare topic or URL → run
web-researchfirst and point this skill at itsresearch.md.
Quick Reference
bash ${HERMES_SKILL_DIR}/scripts/setup.sh # once: venv with replicate, requests, python-docx
PY=${HERMES_HOME:-$HOME/.hermes}/venvs/illustrator/bin/python
S=${HERMES_SKILL_DIR}/scripts
$PY $S/read.py <document-or-folder> --out <project>/.ingest
$PY $S/scaffold.py --project <project> --plan <project>/.ingest/plan.json
$PY $S/validate.py <project>
$PY $S/render.py <project> --dry-run # lists every prompt, zero API calls
$PY $S/render.py <project> # renders; skips existing images
$PY $S/art_tools.py style-ref ref.jpg <prompts/*.json> # one style reference for every render
$PY $S/art_tools.py trim images/a.jpg a.jpg # cut the plain background (keeps a margin)
$PY $S/art_tools.py crop images/b.jpg b.jpg --box 380,300,2780,1290
Folder contract, payload format and render options: references/contract.md.
Procedure
- Read —
read.pythe document into<project>/.ingest/(compose in place when it is aresearch.mdproject). Read all ofcorpus.txt. - Chapter — group into titled chapters of ≤ 5 pages (~1800 chars/page), ordered as one
flowing narrative. Write
outline.md(title, one-line synopsis, transition to the next) and.ingest/plan.json:[{"slug": "...", "title": "...", "scenes": 1|2}], lowest index = cover. - Scaffold —
scaffold.pycreatesNN_<slug>/prompts/,chapter.mdstubs, the default colour-pencildesign.md(if absent) andpalette.jsonwithglobal_preamble. For another style editdesign.md'sSTYLE_PREAMBLEblock and copy it intopalette.json. - Author — per chapter:
chapter.mdprose, then 1–2 consecutive-moment prompts. Register every recurring element inpalette.jsonentities(aliases,color,descriptor) on first appearance and use its exact colour words in every prompt that shows it. Each prompt string starts withglobal_preambleverbatim. - Validate —
validate.py <project>until'fail': 0; treatwarnas revise-unless-accepted. - Approval — show the chapter list with transitions, the palette (element → colour), one manifest line per prompt (chapter / scene / aspect) and the image count. Wait for a yes.
- Render —
render.py <project>. Report itssummary: {ok, skip, err}and everywarn:line.
Gates
- G1 document in — missing extractor or unreadable input → relay
read.py's error and stop; never paraphrase a document from memory. URL or bare topic →web-researchfirst. - G2 validator clean — never show the manifest while
validate.pyreportsfail> 0. - G3 spend approval — no
render.pywithout dry-run proof and an explicit yes to the manifest and count. - G4 pay once — after a timeout, crash or Ctrl-C re-run the same command: it resumes the saved
prediction from
_pending.jsonat no new cost. Never change the prompt or add--forceto get past it. - G5 token from Hermes —
REPLICATE_API_TOKENis a declared secret: Hermes asks for it and passes it to the Replicate SDK. A 401/403 stops the batch before anything is paid; ask the user to set it withhermes setup. Never read it from a project file, print it, or pass it on a command line.
Pitfalls
- Image models miscount objects and misspell text. Ask for no text in images; when an exact count
matters, render the scene empty and place the objects with code (see
learning-material). - Aliases are matched as whole words; avoid generic ones ("water") that collide with unrelated text.
- A consistent look across many separate pictures comes from one shared style reference (
art_tools.py style-ref), not from repeating style words; check every picture for wrong colours, counts and stray objects anyway. --forcere-renders and pays again; use it only when the user wants a new image.- A prediction still running never triggers the seedream ↔ nano-banana fallback (that would pay twice).
Verification
render.pysummary showserr: 0, and every prompt hasimages/<same-stem>.jpg.- After
trim/crop, open the result: nothing of the subject cut off, no stray paper edge or frame. - Open the images: the subject matches the chapter, recurring elements keep their colours, no stray text.
_runs.logrecords the model used for each image (andfellback_fromwhen it fell back).