This skill generates and edits images with Gemini via Python SDK, supporting text-to-image, edits, and multi-reference composition.
npx playbooks add skill xiangyu-cas/vision-skills --skill image-generation
Use this skill when the user asks to generate or edit images with Gemini using the Python SDK. Default to gemini-3-pro-image-preview, and mention gemini-2.5-flash-image only as an optional faster/cheaper alternative.
GEMINI_API_KEY is available (env or stored in .env), then use the Python SDK. This will make network requests to the Gemini APIresponse_modalities=["IMAGE"] if image-only) and run. Generation can take ~30 seconds; allow 30–60 seconds before retrying.part.as_image(); if none, report a clear error.references/python.md for Python SDK usageUse part.as_image() to access image outputs and save them. If no image parts are returned, surface a clear error and suggest checking the API key, model name, and response modalities.
Image generation may take around 30 seconds. When running commands via the shell tool, set a longer timeout (e.g., 60–120 seconds) to avoid premature timeouts.
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.