AI 图像编辑

1.9 积分起

用 AI 编辑任意图片:切换风格、移除对象、调整元素,或重塑整体视觉效果。

还需填写:待编辑图像, 编辑指令

示例

前 / 后Grok Imagine

苏梅岛修理铺里的植物风扇

Grok Imagine。通过自然语言编辑,将一台老式台扇变成香蕉叶雕塑,同时保持路边修理铺的写实质感。

复现
0105

AI 图像编辑 API

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

获取 API 令牌
个输入
5
必填
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_urls: ["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_urls": ["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_urls": ["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_urls": ["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 参考 CLI 参考

常见问题

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

用 AI 编辑图片

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

你可以做什么

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

选择模型

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

探索更多流水线

AI 视频生成
from 9.5
AI 视频生成
图像生成器
0.2-6.4
图像生成器
AI 配音生成
0.002-40.0
AI 配音生成
音乐生成器
2.5-22.6
音乐生成器