Back to pipelines

Image Editor

Edit any image with AI. Change style, remove objects, modify elements, or transform the entire look.

1.9

Still needed: Image to Edit, Edit Instructions

Runs on

API

Examples

Before / After

Add a prop: Pyra's cozy scarf

Grok Imagine Quality. One instruction wraps Pyra in a hand-knitted violet scarf: a single prop added, the same dragon underneath, same violet eyes and glowing infinity crest.

Articles about this pipeline

Image Editor API

Call this pipeline from your own code. One request dispatches a run; the model is an input field, not a separate endpoint.

4 inputs
2 required
1.9 to 5.3 credits
bun add @pipe2-ai/sdk
import { createClient } from "@pipe2-ai/sdk";

const client = createClient(process.env.PIPE2_TOKEN!);

const { run_pipeline } = await client.RunPipeline({
  pipeline_slug: "image-editor",
  input: {
    image_url: "https://example.com/product.jpg",
    instructions: "Remove the background and place the product on a soft grey studio backdrop",
    model: "grok-imagine-image-quality",
  },
});
pip install pipe2
import asyncio
import os

from pipe2 import Pipe2Client

client = Pipe2Client(token=os.environ["PIPE2_TOKEN"])

run = asyncio.run(client.run_pipeline(
    pipeline_slug="image-editor",
    input={
        "image_url": "https://example.com/product.jpg",
        "instructions": "Remove the background and place the product on a soft grey studio backdrop",
        "model": "grok-imagine-image-quality",
    },
))
go get github.com/pipe2-ai/sdk-go
client := pipe2.NewClient(os.Getenv("PIPE2_TOKEN"))

input := json.RawMessage(`{
  "image_url": "https://example.com/product.jpg",
  "instructions": "Remove the background and place the product on a soft grey studio backdrop",
  "model": "grok-imagine-image-quality"
}`)

run, err := pipe2.RunPipeline(context.Background(), client, "image-editor", input)
if err != nil {
    log.Fatal(err)
}
brew install pipe2-ai/tap/pipe2
pipe2 pipelines run \
  --pipeline image-editor \
  --input-json '{"image_url": "https://example.com/product.jpg", "instructions": "Remove the background and place the product on a soft grey studio backdrop", "model": "grok-imagine-image-quality"}' \
  --wait

Get an API token →

Parameters

image_url required

Public URL of the image to edit.

string
instructions required

What to change, in plain language — the edit is applied to the whole image.

string
aspect_ratio

Output aspect ratio. Leave unset to keep the source image's ratio.

1:116:99:164:33:4 default 1:1
Show all 4 inputs
model

Image engine to use. Leave unset and Pipe2 picks one that supports your edit.

grok-imagine-image-qualitygrok-imagine-imagegemini-3-1-flash-imagegemini-3-pro-image default grok-imagine-image-quality

Use it from an AI agent

Point any MCP client at pipe2 and your agent gets these tools. It finds this pipeline, reads the same schema above, then runs it.

  • list_pipelines
  • get_pipeline_schema
  • run_pipeline
  • get_pipeline_run_status
  • request_upload
https://mcp.pipe2.ai/mcp
{
  "mcpServers": {
    "pipe2ai": {
      "url": "https://mcp.pipe2.ai/mcp",
      "headers": { "Authorization": "Bearer YOUR_TOKEN" }
    }
  }
}

Full API reference MCP setup CLI reference

Image Editor: AI-Powered Image Editing

Describe what you want to change and AI edits your image. Remove objects, change backgrounds, alter styles, add elements, or completely transform the look, all from a text prompt.

What You Can Do

  • Remove objects: erase unwanted elements seamlessly
  • Change backgrounds: swap any background with a described scene
  • Style transfer: convert to painting, sketch, cinematic, or any style
  • Add elements: insert objects, people, or effects into the scene
  • Color grading: adjust mood, tone, and lighting with words

Choose a Model

  • Grok Imagine: fast, natural-language edits at the lowest cost
  • Grok Imagine Quality: higher fidelity and detail preservation
  • Gemini 3.1 Flash Image: strong instruction following with multi-reference detail
  • Gemini 3 Pro Image: premium tier for precise text and complex layouts

Frequently Asked Questions

What kinds of edits can I make?
Almost anything: remove objects, change backgrounds, alter styles, add elements, adjust lighting and color, or completely reimagine the image.
Will the edit preserve the original composition?
Yes, the AI uses your image as the base and modifies only what you describe, preserving structure and composition unless you ask it to change.
What aspect ratios are supported?
1:1 (square), 16:9 (landscape), 9:16 (portrait), 4:3 (classic), 3:4 (tall).
How many credits does it cost?
1.9 to 5.3 credits per edit, depending on the model you choose.
Can I chain this with other pipelines?
Yes, the output image can be fed into image-motion for video, text-card for overlays, or video-generator as a start frame.

Explore more pipelines

See all →
Video Generator
from 9.5
Video Generator
Image Generator
0.2-6.4
Image Generator
Audio Generator
0.7-1.3
Audio Generator
Music Generator
2.5-45.1
Music Generator