返回流水线

图像编辑器

用 AI 编辑任意图像。更改风格、移除对象、修改元素,或彻底改变整体观感。

1.9

还需填写:待编辑图像, Edit Instructions

使用的模型

API

示例

前 / 后

加一件道具:Pyra 的暖围巾

Grok Imagine Quality。一条指令为 Pyra 围上手织的紫色围巾:只加了一件道具,底下还是同一条龙,同样的紫色眼睛与发光的无限符号。

复现

关于此流水线的文章

图像编辑器 API

从你自己的代码调用此流水线。一次请求即可发起运行;模型是一个输入字段,而不是独立的接口。

4 个输入
2 必填
1.9 to 5.3 积分
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

获取 API 令牌 →

参数

image_url 必填

Public URL of the image to edit.

string
instructions 必填

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 默认 1:1
显示全部 4 个输入
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 默认 grok-imagine-image-quality

在 AI 智能体中使用

将任意 MCP 客户端指向 pipe2,你的智能体就能获得这些工具。它会找到这条流水线,读取上方相同的 schema,然后运行它。

  • 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" }
    }
  }
}

完整 API 参考 MCP 设置 CLI 参考

图像编辑器: AI 驱动的图像编辑

描述你想改变的内容,AI 即可编辑你的图像。移除对象、更换背景、改变风格、添加元素,或彻底改变观感,全部只需一条文本提示。

你可以做什么

  • 移除对象: 无缝擦除不需要的元素
  • 更换背景: 用所描述的场景替换任意背景
  • 风格迁移: 转换为绘画、素描、电影感或任意风格
  • 添加元素: 向场景中插入对象、人物或特效
  • 调色: 用文字调整氛围、色调和光线

选择模型

  • Grok Imagine:以最低成本进行快速的自然语言编辑
  • Grok Imagine Quality:更高的保真度和细节保留
  • Gemini 3.1 Flash Image:强大的指令遵循能力,支持多参考细节
  • Gemini 3 Pro Image:面向精准文字和复杂排版的高级层级

常见问题

我可以做哪些类型的编辑?
几乎任何编辑:移除对象、更换背景、改变风格、添加元素、调整光线和色彩,或彻底重新构想整幅图像。
编辑会保留原始构图吗?
会,AI 以你的图像为基础,只修改你所描述的部分,除非你要求改动,否则会保留结构和构图。
支持哪些宽高比?
1:1(方形)、16:9(横向)、9:16(纵向)、4:3(经典)、3:4(竖高)。
需要多少积分?
每次编辑 1.9 to 5.3 积分,取决于你选择的质量级别。
我可以将它与其他流水线串联吗?
可以,输出图像可送入 image-motion 生成视频、送入 text-card 制作叠加文字,或作为 video-generator 的起始帧。

探索更多流水线

查看全部 →
视频生成器
from 9.5
视频生成器
图像生成器
0.2-6.4
图像生成器
音频生成器
0.7-1.3
音频生成器
音乐生成器
2.5-45.1
音乐生成器