Generate Image
Generate or edit an image with the native generate_image tool. The tool keeps credentials
in the trusted host, renders through whichever route the person has, and saves the image
into the connected workspace, where read opens it for inspection and a manuscript
includes it directly.
The route
The environment line Image generation: says whether a route exists and which one:
- Ace: the managed account. Renders Nano Banana Pro (
google/gemini-3-pro-image) and
settles the cost from the Wallet, like any other Ace request. One reference image per
request.
- A Gemini key the user connected in Customize → Models: Nano Banana Pro
(
gemini-3-pro-image) on their own account, up to 14 reference images.
- An OpenAI key the user connected: GPT Image 2 (
gpt-image-2) on their own account,
reference images as an edit.
A personal OpenRouter key is not a route. When the line says image generation is
unavailable, say once that it needs Ace or a Gemini or OpenAI key connected in Customize →
Models, then continue with the rest of the request. Never ask the user to paste a key into
chat, never call the tool to "check", and never draw the image by hand as TikZ, SVG,
Graphviz or matplotlib shapes in its place.
Tool contract
Call generate_image with:
prompt (required): what the image shows and how. Prompt quality decides output quality
more than the model does. Name, in one sentence each: the subject and how much of it is
in frame ("a single pipette tip above a 96-well plate"); the medium and style
(scientific illustration, flat vector, watercolour, 3D render, photograph); the lighting
and palette ("soft diffuse light, cool blue and white palette"); the composition
("wide shot, subject left of centre, empty space on the right for a title"); and what to
avoid ("no text, no labels, no watermark"). Any text that must appear is quoted
verbatim. Asking for empty space where a caption or title will go is the single most useful
compositional instruction for posters and slides.
purpose: illustration for a conceptual figure or graphical abstract (the tool prepends
publication framing: clean background, restrained palette, no invented text or data);
edit when changing an existing image; schematic belongs to the schematics skill.
output_path: destination in the workspace, .png (any route), .jpg or .webp
(Ace and OpenAI). Default generated-image.png.
input_path: an existing image to edit. Omit it entirely for a new image; never pass a
directory, ., /dev/null or a blank canvas.
reference_paths: existing images whose style or components the result should follow.
Up to 14 on a Gemini or OpenAI key; on Ace pass one image in total (either input_path
or one reference).
aspect_ratio: 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16 or 21:9, from the slot
the image fills.
image_size: 1K while iterating (default), 2K for anything printed, 4K only for a
poster or cover.
There is no model parameter: the route decides the model.
Example generation:
{
"prompt": "A DNA double helix with one mutation site highlighted, close enough that the base pairs read. Flat scientific illustration. Restrained blue and amber palette on white. Helix runs diagonally from lower left to upper right, empty space upper left for a caption. No text, no labels, no watermark.",
"purpose": "illustration",
"output_path": "figures/dna-mutation.png",
"aspect_ratio": "3:2"
}
Example edit:
{
"prompt": "Keep every element and label exactly as drawn; widen the margins and increase contrast for a two-column paper",
"purpose": "edit",
"input_path": "figures/abstract-draft.png",
"output_path": "figures/abstract.png",
"aspect_ratio": "4:3",
"image_size": "2K"
}
Workflow
- Read the destination first: the document, slide or page the image goes into, its width,
and what is around it. An image made without its context is resized and recolored later.
- Write the prompt from the communication goal: what a viewer should take from it in one
glance, what must be present, what must not (no invented text, no logos, no decorative
icons, no numbers). Set
aspect_ratio from the slot.
- Generate one candidate at
1K with purpose: "illustration". Never fill an output slot with
an image nobody asked for. To refine rather than restart, pass the candidate back as
input_path with purpose: "edit" and describe only the change.
- Open the saved file with
read and check it: subject correct, requested text spelled
exactly, nothing invented, legible at the final size, palette accessible, no watermark or
border.
- Refine only against a named defect, passing the candidate as
input_path and stating the
change; two rounds at most. Then render the accepted prompt at 2K if it will be printed.
- Report the file, the route it used and anything the image could not do.
For a technical architecture, method flow, pathway or experimental diagram, load
schematics, whose plan-style-render-check workflow is built for exact labels and
connections; it uses the same tool.
Standalone script
scripts/generate_image.py is a helper for use outside OpenScience with a personal
OpenRouter key from --api-key, OPENROUTER_API_KEY or .env. Inside OpenScience it is
never the route: the native tool is.
1---2name: generate-image-23description: Generates or edits images with the native generate_image tool (Nano Banana Pro through Ace or a Gemini key, GPT Image 2 through an OpenAI key), for illustrations, cover art, graphical abstracts, conceptual visuals, photo-style figures and edits of existing images, saved straight into the workspace and checked before use. Use for any image that is not a technical diagram or a plot of data. For method, pipeline, pathway and architecture diagrams load schematics; for plots of measured numbers load figures.4summary: "Illustrations, graphical abstracts and image edits with generate_image; never hand-drawn."5category: core6role: workflow7allowed-tools: [Read, generate_image]8license: MIT9version: 2.0.010author: Synthetic Sciences11metadata:12 source: https://skillmd.com/skills/synthetic-sciences/generate-image-213 upstream: K-Dense-AI/scientific-agent-skills14 upstream-url: https://github.com/K-Dense-AI/scientific-agent-skills15 upstream-path: scientific-skills/generate-image16 upstream-license: MIT17 upstream-relationship: prompt guidance adapted; rewritten around the native tool18 skill-author: Synthetic Sciences19 adapted-by: Synthetic Sciences20---2122# Generate Image2324Generate or edit an image with the native `generate_image` tool. The tool keeps credentials25in the trusted host, renders through whichever route the person has, and saves the image26into the connected workspace, where `read` opens it for inspection and a manuscript27includes it directly.2829## The route3031The environment line `Image generation:` says whether a route exists and which one:3233- **Ace**: the managed account. Renders Nano Banana Pro (`google/gemini-3-pro-image`) and34 settles the cost from the Wallet, like any other Ace request. One reference image per35 request.36- **A Gemini key** the user connected in Customize → Models: Nano Banana Pro37 (`gemini-3-pro-image`) on their own account, up to 14 reference images.38- **An OpenAI key** the user connected: GPT Image 2 (`gpt-image-2`) on their own account,39 reference images as an edit.4041A personal OpenRouter key is not a route. When the line says image generation is42unavailable, say once that it needs Ace or a Gemini or OpenAI key connected in Customize →43Models, then continue with the rest of the request. Never ask the user to paste a key into44chat, never call the tool to "check", and never draw the image by hand as TikZ, SVG,45Graphviz or matplotlib shapes in its place.4647## Tool contract4849Call `generate_image` with:5051- `prompt` (required): what the image shows and how. Prompt quality decides output quality52 more than the model does. Name, in one sentence each: the **subject** and how much of it is53 in frame ("a single pipette tip above a 96-well plate"); the **medium and style**54 (scientific illustration, flat vector, watercolour, 3D render, photograph); the **lighting55 and palette** ("soft diffuse light, cool blue and white palette"); the **composition**56 ("wide shot, subject left of centre, empty space on the right for a title"); and what to57 **avoid** ("no text, no labels, no watermark"). Any text that must appear is quoted58 verbatim. Asking for empty space where a caption or title will go is the single most useful59 compositional instruction for posters and slides.60- `purpose`: `illustration` for a conceptual figure or graphical abstract (the tool prepends61 publication framing: clean background, restrained palette, no invented text or data);62 `edit` when changing an existing image; `schematic` belongs to the schematics skill.63- `output_path`: destination in the workspace, `.png` (any route), `.jpg` or `.webp`64 (Ace and OpenAI). Default `generated-image.png`.65- `input_path`: an existing image to edit. Omit it entirely for a new image; never pass a66 directory, `.`, `/dev/null` or a blank canvas.67- `reference_paths`: existing images whose style or components the result should follow.68 Up to 14 on a Gemini or OpenAI key; on Ace pass one image in total (either `input_path`69 or one reference).70- `aspect_ratio`: `1:1`, `3:2`, `2:3`, `4:3`, `3:4`, `16:9`, `9:16` or `21:9`, from the slot71 the image fills.72- `image_size`: `1K` while iterating (default), `2K` for anything printed, `4K` only for a73 poster or cover.7475There is no `model` parameter: the route decides the model.7677Example generation:7879```json80{81 "prompt": "A DNA double helix with one mutation site highlighted, close enough that the base pairs read. Flat scientific illustration. Restrained blue and amber palette on white. Helix runs diagonally from lower left to upper right, empty space upper left for a caption. No text, no labels, no watermark.",82 "purpose": "illustration",83 "output_path": "figures/dna-mutation.png",84 "aspect_ratio": "3:2"85}86```8788Example edit:8990```json91{92 "prompt": "Keep every element and label exactly as drawn; widen the margins and increase contrast for a two-column paper",93 "purpose": "edit",94 "input_path": "figures/abstract-draft.png",95 "output_path": "figures/abstract.png",96 "aspect_ratio": "4:3",97 "image_size": "2K"98}99```100101## Workflow1021031. Read the destination first: the document, slide or page the image goes into, its width,104 and what is around it. An image made without its context is resized and recolored later.1052. Write the prompt from the communication goal: what a viewer should take from it in one106 glance, what must be present, what must not (no invented text, no logos, no decorative107 icons, no numbers). Set `aspect_ratio` from the slot.1083. Generate one candidate at `1K` with `purpose: "illustration"`. Never fill an output slot with109 an image nobody asked for. To refine rather than restart, pass the candidate back as110 `input_path` with `purpose: "edit"` and describe only the change.1114. Open the saved file with `read` and check it: subject correct, requested text spelled112 exactly, nothing invented, legible at the final size, palette accessible, no watermark or113 border.1145. Refine only against a named defect, passing the candidate as `input_path` and stating the115 change; two rounds at most. Then render the accepted prompt at `2K` if it will be printed.1166. Report the file, the route it used and anything the image could not do.117118For a technical architecture, method flow, pathway or experimental diagram, load119`schematics`, whose plan-style-render-check workflow is built for exact labels and120connections; it uses the same tool.121122## Standalone script123124`scripts/generate_image.py` is a helper for use outside OpenScience with a personal125OpenRouter key from `--api-key`, `OPENROUTER_API_KEY` or `.env`. Inside OpenScience it is126never the route: the native tool is.