$npx -y skills add mkdev-me/agent-skills --skill gemini-image-generatorGenerate images using Google Gemini with customizable options
| 1 | # gemini-image-generator |
| 2 | |
| 3 | ## Instructions |
| 4 | |
| 5 | Use this skill to generate images using Google Gemini's image generation model. The skill supports: |
| 6 | - Text-to-image generation from prompts |
| 7 | - Image-to-image generation with a reference image |
| 8 | - Multiple output sizes (1K, 2K, 4K) |
| 9 | - Custom output paths |
| 10 | |
| 11 | The API key must be set via the `GEMINI_API_KEY` environment variable. |
| 12 | |
| 13 | ## Parameters |
| 14 | |
| 15 | - `--prompt` (required): The text prompt describing the image to generate |
| 16 | - `--output` (required): Output file path for the generated image |
| 17 | - `--reference`: Optional reference image for style/content guidance |
| 18 | - `--size`: Image size - "1K", "2K", or "4K" (default: 4K) |
| 19 | |
| 20 | ## Examples |
| 21 | |
| 22 | ### Basic text-to-image generation |
| 23 | ```bash |
| 24 | ./scripts/generate.py --prompt "A serene mountain landscape at sunset" --output images/landscape.png |
| 25 | ``` |
| 26 | |
| 27 | ### With reference image for style guidance |
| 28 | ```bash |
| 29 | ./scripts/generate.py --prompt "Same character but wearing a party hat" --reference images/character.png --output images/party.png |
| 30 | ``` |
| 31 | |
| 32 | ### Different output size |
| 33 | ```bash |
| 34 | ./scripts/generate.py --prompt "Abstract art" --output art.png --size 2K |
| 35 | ``` |
| 36 | |
| 37 | ## Setup |
| 38 | |
| 39 | Before first use, set up the virtual environment: |
| 40 | ```bash |
| 41 | cd scripts && python3 -m venv venv && ./venv/bin/pip install -r requirements.txt |
| 42 | ``` |
| 43 | |
| 44 | Set your API key: |
| 45 | ```bash |
| 46 | export GEMINI_API_KEY="your-api-key-here" |
| 47 | ``` |