---
title: ToolRouter — Tool Detail
description: Detailed documentation for a ToolRouter tool including skills, parameters, and examples.
url: https://toolrouter.com/tools/generate-image
---
# Generate Image

Generate, edit, and upscale images with 20+ AI models. Create from text prompts, edit with natural language, inpaint masked areas, change backgrounds, and upscale to 4K. Models range from fast drafts to photorealistic renders, with strengths in typography, design, or speed.

- **Version:** 0.07
- **Categories:** media, ai
- **Workflow:** list_models → text_to_image → edit_image → upscale_image

## Skills (4)

### Text to Image (`text_to_image`)

Generate an image from a text prompt. 20+ models with different quality, speed, style, and cost tradeoffs. Returns image URL(s) and downloadable assets.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `prompt` | string | Yes | Detailed text description of the image to generate. Be specific about subject, style, lighting, composition, and mood. |
| `model` | string | No | Model to use — registry key, name, or endpoint ID. Use list_models for options. Omit for default. |
| `image_size` | string | No | Size preset: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3 (default), landscape_16_9. |
| `aspect_ratio` | string | No | Aspect ratio (used by some models instead of image_size). Common aliases like "square", "landscape", "portrait" are also accepted. (1:1, 16:9, 9:16, 4:3, 3:4, 3:1, 1:3, 3:2, 2:3) |
| `width` | number | No | Custom width in pixels (use with height instead of image_size). |
| `height` | number | No | Custom height in pixels (use with width instead of image_size). |
| `num_images` | number | No | Number of images to generate (1-4). Defaults to 1. [default: 1] |
| `seed` | number | No | Random seed for reproducible results. Same seed + prompt → similar output. |
| `output_format` | string | No | Output image format. Defaults to jpeg. (jpeg, png, webp) |
| `negative_prompt` | string | No | Things to avoid in the image (e.g. "blurry, low quality, text"). Not all models support this. |
| `guidance_scale` | number | No | How closely to follow the prompt (1-20). Higher = more literal. Not all models support this. |
| `num_inference_steps` | number | No | Number of denoising steps. More steps = higher quality but slower. Not all models support this. |
| `style` | string | No | Style preset (model-specific). Values depend on model — use list_models to see supported styles. |
| `style_preset` | string | No | Detailed style preset (model-specific, e.g. "WATERCOLOR", "POP_ART", "80S_ILLUSTRATION"). Use list_models to see which models support this. |
| `rendering_speed` | string | No | Rendering speed — affects quality and cost. Only supported by select models. (TURBO, BALANCED, QUALITY) |
| `quality` | string | No | Quality tier — affects cost. Only supported by select models. (low, medium, high) |
| `background` | string | No | Background mode. Only supported by select models. (auto, transparent, opaque) |
| `enhance_prompt` | boolean | No | Let the model expand/improve your prompt. Only supported by select models. |
| `raw` | boolean | No | Less processed, more natural-looking output. Only supported by select models. |
| `colors` | array | No | Color palette as [{r,g,b}] objects to guide generation. Only supported by select models. |
| `loras` | array | No | LoRA weights as [{path, scale}] objects. Only supported by select models. |
| `safety_tolerance` | string | No | Safety level (1-6). Higher = more permissive. Only supported by select models. |
| `extra_params` | object | No | Additional model-specific parameters passed directly to the inference API. Use for custom models or advanced features not listed above. |

**Returns:** Image URL(s), downloadable asset(s) via asset system, model used, seed, dimensions, and request metadata

**Examples:**

*Generate a product photo with the default model:*

```json
{
  "prompt": "A sleek wireless headphone on a marble surface, soft studio lighting, product photography, 4K"
}
```

*Generate a logo with Ideogram (best for text in images):*

```json
{
  "prompt": "Modern minimalist logo for \"ToolRouter\" — clean typography, blue gradient, tech company",
  "model": "ideogram-v3",
  "rendering_speed": "QUALITY"
}
```

*Generate fast draft images with Flux Schnell:*

```json
{
  "prompt": "Mountain landscape at golden hour, cinematic wide shot",
  "model": "flux-schnell",
  "num_images": 4
}
```

### Edit Image (`edit_image`)

Edit, transform, or inpaint an existing image using AI. Provide an image URL and a text prompt describing the edit. Supports style transfer, object removal/addition, background changes, and targeted edits with masks.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `image_url` | string | Yes | URL of the source image to edit. Must be publicly accessible. |
| `prompt` | string | No | Text description of the edit to make (e.g. "change the background to a beach sunset", "remove the person on the left"). |
| `model` | string | No | Model to use for editing. Use list_models with capability "editing" or "inpainting" to discover options. Omit to use the default edit model. |
| `mask_url` | string | No | URL of mask image for inpainting (white = area to edit). Required for models with "inpainting" capability. |
| `strength` | number | No | How much to change the image (0-1). Lower = closer to original. Supported by image-to-image models. |
| `image_size` | string | No | Size preset: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3 (default), landscape_16_9. |
| `aspect_ratio` | string | No | Aspect ratio (used by some models instead of image_size). Common aliases like "square", "landscape", "portrait" are also accepted. (1:1, 16:9, 9:16, 4:3, 3:4, 3:1, 1:3, 3:2, 2:3) |
| `width` | number | No | Custom width in pixels. |
| `height` | number | No | Custom height in pixels. |
| `num_images` | number | No | Number of images to generate (1-4). Defaults to 1. [default: 1] |
| `seed` | number | No | Random seed for reproducible results. Same seed + prompt → similar output. |
| `output_format` | string | No | Output image format. Defaults to jpeg. (jpeg, png, webp) |
| `negative_prompt` | string | No | Things to avoid in the image (e.g. "blurry, low quality, text"). Not all models support this. |
| `guidance_scale` | number | No | How closely to follow the prompt (1-20). |
| `num_inference_steps` | number | No | Number of denoising steps. |
| `enhance_prompt` | boolean | No | Let the model expand your prompt. |
| `extra_params` | object | No | Additional model-specific parameters passed directly to the inference API. |

**Returns:** Edited image URL(s), downloadable asset(s), source image URL, model used, seed, and request metadata

**Examples:**

*Edit an image with natural language using Kontext:*

```json
{
  "image_url": "https://placehold.co/800x600.png",
  "prompt": "Add a decorative golden frame border around the entire image"
}
```

*Style transfer with FLUX Dev image-to-image:*

```json
{
  "image_url": "https://placehold.co/800x600.png",
  "prompt": "Oil painting style, impressionist, vibrant colors",
  "model": "flux-dev-i2i",
  "strength": 0.7
}
```

### Upscale Image (`upscale_image`)

AI-upscale an image up to 10x resolution. Enhances detail and sharpness while maintaining quality. Choose a target resolution (720p-4K) or a scale factor (1-10x).

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `image_url` | string | Yes | URL of the image to upscale. Must be publicly accessible. |
| `upscale_factor` | number | No | Scale factor (1-10). Default 2x. Ignored if target_resolution is set. [default: 2] |
| `target_resolution` | string | No | Target resolution instead of scale factor. (720p, 1080p, 1440p, 2160p) |
| `seed` | number | No | Random seed for reproducible results. Same seed + prompt → similar output. |
| `output_format` | string | No | Output image format. Defaults to jpeg. (jpeg, png, webp) |

**Returns:** Upscaled image URL, downloadable asset, upscale factor or target resolution, and request metadata

**Examples:**

*Upscale an image 2x:*

```json
{
  "image_url": "https://placehold.co/400x300.png"
}
```

*Upscale to 4K resolution:*

```json
{
  "image_url": "https://placehold.co/400x300.png",
  "target_resolution": "2160p"
}
```

### List Models (`list_models`)

List all available image generation models with capabilities, pricing, supported parameters, and descriptions. Filter by capability type. Models not in the registry can still be used by passing their model endpoint ID directly.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `capability` | string | No | Filter models by capability. Omit to show all. (text-to-image, image-to-image, inpainting, editing, upscale, background-removal, text-to-svg, image-to-3d) |

**Returns:** Array of model objects with key, capabilities, pricing, supported parameters, and descriptions

**Examples:**

*List all available image models:*

```json
{}
```

*List only text-to-image models:*

```json
{
  "capability": "text-to-image"
}
```

## Quick Start

```bash
# Via CLI
TOOLROUTER_API_KEY=tr_live_xxx npx -y toolrouter-mcp call generate-image text_to_image --prompt A sleek wireless headphone on a marble surface, soft studio lighting, product photography, 4K

# Via REST API
curl -H "Authorization: Bearer tr_live_xxx" \
     -d '{"tool":"generate-image","skill":"text_to_image","input":{"prompt":"A sleek wireless headphone on a marble surface, soft studio lighting, product photography, 4K"}}' \
     https://api.toolrouter.com/v1/tools/call
```

## Frequently Asked Questions

### Can I create an image from a text prompt?

Yes. `text_to_image` turns a prompt into a new image and returns downloadable image assets.

### Can I edit an image I already have?

Yes. `edit_image` can change backgrounds, add or remove objects, and make targeted visual edits.

### Can I upscale an image for higher resolution?

Yes. `upscale_image` can enhance an image up to 10x resolution, including 4K-level output.

### How do I know which model to use?

Use `list_models` to compare capabilities, speed, and style strengths before you generate.

---

## Get Started with ToolRouter

**Already connected?** Call any tool with `use_tool({ tool, skill, input })`. Browse tools with `discover` or visit https://toolrouter.com/llms-full.txt

**New to ToolRouter?** Connect with one command (no API key needed — auto-provisions on first use):

```bash
# MCP (Claude Code, Codex CLI)
claude mcp add toolrouter -- npx -y toolrouter-mcp

# MCP (Cursor, Windsurf, Cline, VS Code, Gemini CLI, Claude Desktop)
{"mcpServers":{"toolrouter":{"command":"npx","args":["-y","toolrouter-mcp"]}}}

# Claude Chat / Claude Cowork / Claude Mobile — add as a connector:
# Settings → Connectors → Add custom connector → URL: https://api.toolrouter.com/mcp

# ChatGPT — add as an app:
# Settings → Apps → Advanced settings → enable Developer mode → Create app → MCP Server URL: https://api.toolrouter.com/mcp

# CLI (works instantly, no restart needed)
npx -y toolrouter-mcp tools                    # browse all tools
npx -y toolrouter-mcp search "seo"             # search by keyword
npx -y toolrouter-mcp call seo analyze_page --url https://example.com
```

Free tools work immediately. For paid tools, visit https://toolrouter.com/claim to add credits.

All platforms: https://toolrouter.com/connect | Full catalog: https://toolrouter.com/llms-full.txt | Docs: https://toolrouter.com/docs