# Generate Image

> This skill should be used when the user asks to "generate an image", "create a picture", "make an image of", "edit this image", "transform this photo", or needs AI-generated visual content using Google's Gemini image generation model.

- **Type:** Skill
- **Install:** `agentstack add skill-mfmezger-ai-agent-dotfiles-generate-image`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [mfmezger](https://agentstack.voostack.com/s/mfmezger)
- **Installs:** 0
- **Category:** [Content & Media](https://agentstack.voostack.com/c/content-and-media)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [mfmezger](https://github.com/mfmezger)
- **Source:** https://github.com/mfmezger/ai_agent_dotfiles/tree/main/shared/skills/generate-image

## Install

```sh
agentstack add skill-mfmezger-ai-agent-dotfiles-generate-image
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Image Generation with Gemini

Generate images using Google's Gemini image generation model via Vertex AI. Supports both text-to-image and image-to-image generation.

## Prerequisites

Environment variables (can be in `.env` file in working directory):

- `GOOGLE_APPLICATION_CREDENTIALS` - Path to service account JSON file
- `GOOGLE_CLOUD_PROJECT` - GCP project ID

## Usage

Run the generation script using `uvx`:

```bash
# Text-to-image generation
uvx --with google-genai --with python-dotenv python ~/.claude/skills/generate-image/scripts/generate.py "PROMPT"

# Image-to-image generation (with input image)
uvx --with google-genai --with python-dotenv python ~/.claude/skills/generate-image/scripts/generate.py "PROMPT" -i /path/to/input/image.png
```

### Options

| Flag                | Description                               | Default   |
| ------------------- | ----------------------------------------- | --------- |
| `-i, --input PATH`  | Input image for image-to-image generation | None      |
| `-o, --output PATH` | Where to save the image                   | Temp file |
| `--aspect-ratio`    | "16:9", "1:1", "9:16"                     | "16:9"    |
| `--size`            | "1K" or "2K"                              | "2K"      |

### Examples

```bash
# Basic text-to-image - saves to temp file, prints path
uvx --with google-genai --with python-dotenv python ~/.claude/skills/generate-image/scripts/generate.py "A serene mountain landscape at sunset"

# Save to specific location
uvx --with google-genai --with python-dotenv python ~/.claude/skills/generate-image/scripts/generate.py "A cute robot" -o ./robot.png

# Square format
uvx --with google-genai --with python-dotenv python ~/.claude/skills/generate-image/scripts/generate.py "Abstract art" --aspect-ratio 1:1

# High resolution
uvx --with google-genai --with python-dotenv python ~/.claude/skills/generate-image/scripts/generate.py "Detailed cityscape" --size 2K

# Image-to-image: Transform an existing image
uvx --with google-genai --with python-dotenv python ~/.claude/skills/generate-image/scripts/generate.py "Make this scene nighttime with stars" -i ./daytime_photo.jpg

# Image-to-image: Add elements to an image
uvx --with google-genai --with python-dotenv python ~/.claude/skills/generate-image/scripts/generate.py "Add a rainbow in the sky" -i ./landscape.png -o ./landscape_with_rainbow.png

# Image-to-image: Style transfer
uvx --with google-genai --with python-dotenv python ~/.claude/skills/generate-image/scripts/generate.py "Convert to watercolor painting style" -i ./photo.jpg
```

## Workflow

1. Run the script with user's prompt (and optionally an input image)
2. Script prints the saved image path
3. Use Read tool to view the generated image
4. Move/copy to user-specified location if requested

## Batch Generation

Generate multiple images in parallel using the batch script (uv inline script):

```bash
# Multiple prompts as arguments
uv run ~/.claude/skills/generate-image/scripts/generate_batch.py "A sunset over mountains" "A robot in a garden" "A cat astronaut"

# Read prompts from a file (one per line, # comments ignored)
uv run ~/.claude/skills/generate-image/scripts/generate_batch.py --from-file prompts.txt

# Save to a specific directory
uv run ~/.claude/skills/generate-image/scripts/generate_batch.py -o ./images "prompt1" "prompt2"

# Control concurrency (default: 4)
uv run ~/.claude/skills/generate-image/scripts/generate_batch.py -c 2 "prompt1" "prompt2" "prompt3"

# Combine file + CLI prompts, custom aspect ratio
uv run ~/.claude/skills/generate-image/scripts/generate_batch.py -f prompts.txt -a 1:1 -s 2K "extra prompt"

# Image-to-image batch (same input image, multiple transformations)
uv run ~/.claude/skills/generate-image/scripts/generate_batch.py -i ./photo.jpg "Make it nighttime" "Add rain" "Watercolor style"
```

### Batch Options

| Flag                          | Description                                  | Default   |
| ----------------------------- | -------------------------------------------- | --------- |
| `prompts` (positional)        | One or more text prompts                     | -         |
| `-f, --from-file PATH`       | Read prompts from a text file (one per line) | None      |
| `-o, --output-dir DIR`       | Directory to save images                     | Temp dir  |
| `-i, --input-image PATH`     | Input image for image-to-image (all prompts) | None      |
| `-a, --aspect-ratio`         | "16:9", "1:1", "9:16"                        | "16:9"    |
| `-s, --size`                 | "1K" or "2K"                                 | "2K"      |
| `-c, --max-concurrent`       | Max parallel API requests (semaphore)        | 4         |

## Error Handling

- Missing env vars: Script errors with clear message about which variable is needed
- Input image not found: Script errors if the specified input image path doesn't exist
- Generation failure: Script returns non-zero exit code with error details
- Batch mode: Reports per-prompt success/failure and exits with code 1 if any failed

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [mfmezger](https://github.com/mfmezger)
- **Source:** [mfmezger/ai_agent_dotfiles](https://github.com/mfmezger/ai_agent_dotfiles)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-mfmezger-ai-agent-dotfiles-generate-image
- Seller: https://agentstack.voostack.com/s/mfmezger
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
