---
name: Image Generation
slug: image-generation-7
category: AI Engineering
description: Image Generation creates images with Google Gemini from text prompts or source images. Use it when you need a generated PNG from a prompt, sketch, or reference image.
github: "https://github.com/SawyerHood/middleman/tree/main/apps/backend/src/swarm/skills/builtins/image-generation"
language: TypeScript
stars: 181
forks: 21
install: "npx degit https://github.com/SawyerHood/middleman/tree/main/apps/backend/src/swarm/skills/builtins/image-generation ~/.claude/skills/image-generation"
installs_to: ~/.claude/skills/image-generation
source_path: apps/backend/src/swarm/skills/builtins/image-generation/SKILL.md
collection_size: 4
category_size: 3475
collection_url: "https://dirskills.com/collections/SawyerHood/middleman"
added: 2026-09-07T05:20:19.357Z
last_synced: 2026-09-07T05:20:19.357Z
canonical_url: "https://dirskills.com/skills/image-generation-7"
---

# Image Generation

Image Generation creates images with Google Gemini from text prompts or source images. Use it when you need a generated PNG from a prompt, sketch, or reference image.

**Install:**

```bash
npx degit https://github.com/SawyerHood/middleman/tree/main/apps/backend/src/swarm/skills/builtins/image-generation ~/.claude/skills/image-generation
```

## README

# Image Generation

Generate images using Google Gemini (`gemini-3-pro-image-preview`) for both text-to-image and image-to-image workflows.

Use the packaged CLI:

```bash
middleman image generate \
  --prompt "a cute robot bee in a garden" \
  --output "/path/to/output.png"
```

Image-to-image generation is supported with repeated `--input-image` flags:

```bash
middleman image generate \
  --prompt "turn this sketch into a painted poster with a limited teal and coral palette" \
  --input-image "/path/to/sketch.png" \
  --input-image "/path/to/reference.jpg" \
  --output "/path/to/output.png"
```

## Options

- `--prompt` (required): text description of the image to generate
- `--output` (required): output file path (extension auto-detected when omitted)
- `--input-image` (optional, repeatable): local source image(s) to send alongside the prompt
- `--aspect-ratio` (optional): aspect ratio like `16:9`, `1:1`, `4:3`
- `--size` (optional): image size, default `1K`

## Output

The script prints JSON:

- Success: `{ "ok": true, "file": "/path/to/output.png", "mimeType": "image/png" }`
- Failure: `{ "ok": false, "error": "..." }`
