Install
openclaw skills install gemini-image-generationGenerate or edit images with Gemini using the Google GenAI SDK. Use when the user asks to create, transform, render, or save one or more images in an OpenCla...
openclaw skills install gemini-image-generationUse this skill when you need to create one or more image files from a text prompt, or edit one or more existing images with Gemini.
~/.openclaw/openclaw.json must include $.skills.entries["gemini-image-generation"].enabled set to true.
~/.openclaw/openclaw.json must include $.skills.entries["gemini-image-generation"].env with the following keys and values:
GEMINI_API_KEY required
GEMINI_MODEL_ID required
GEMINI_BASE_URL optional
example ~/.openclaw/openclaw.json:
{
......,
"skills": {
"entries": {
"gemini-image-generation": {
"enabled": true,
"env": {
"GEMINI_API_KEY": "sk-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"GEMINI_MODEL_ID": "gemini-3.1-flash-image-preview",
"GEMINI_BASE_URL": "https://custom-endpoint.com"
}
}
}
},
......
}
npm install from the skill root.--aspectRatio and --imageSize.--prompt, --output, and optional image config arguments.--prompt, one or more --input values, --output, and optional image config arguments.GEMINI_API_KEY and the model ID from GEMINI_MODEL_ID in the environment.GEMINI_BASE_URL in the environment for custom endpoints.MEDIA:<image_path> (e.g. MEDIA:outputs/gemini-native-image.png) so the image is displayed inline in the conversation.node ./skills/gemini-image-generation/scripts/generate-image.mjs --prompt "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme" --output "outputs/gemini-native-image.png"
node ./skills/gemini-image-generation/scripts/generate-image.mjs --prompt "Create a wide cinematic food photo of a nano banana dish in a fancy restaurant with a Gemini theme" --output "outputs/gemini-wide.png" --aspectRatio "16:9" --imageSize "2K"
node ./skills/gemini-image-generation/scripts/edit-image.mjs --prompt "Turn this cat into a watercolor illustration eating a nano-banana in a fancy restaurant under the Gemini constellation" --input "inputs/cat.png" --output "outputs/cat-watercolor.png" --aspectRatio "5:4" --imageSize "2K"
node ./skills/gemini-image-generation/scripts/edit-image.mjs --prompt "Create an office group photo of these people making funny faces" --input "inputs/person-1.jpg" --input "inputs/person-2.jpg" --input "inputs/person-3.jpg" --output "outputs/group-photo.png"
TEXT: lines for model text and IMAGE: lines for each saved file.MEDIA:<path> for each saved image path. This ensures the image is rendered inline in the conversation alongside the file path.name-1.png, name-2.png, and so on.edit-image.mjs supports repeated --input flags. You can also pass a comma-separated list to a single --input value.edit-image.mjs infers the source mime type from .png, .jpg, .jpeg, or .webp. Use one --mime-type for all inputs, or repeat --mime-type so it lines up with each --input.--aspectRatio and --imageSize. They also accept the kebab-case forms --aspect-ratio and --image-size.config.imageConfig when at least one of those parameters is provided.