对之前生成的 Grok Imagine Image 2.0 图像进行定向编辑。通过连续提示词在多轮处理中逐步优化同一图像。按次生成付费。
关于此模型
Grok Imagine Image 2.0 Edit 可对之前的 Grok Imagine Image 2.0 生成结果应用定向的自然语言编辑。它不接受新上传的照片,而是使用之前 grok-imagine-image-2(或 grok-imagine-image-2-edit)调用返回的 request_id 继续编辑,仅修改提示词描述的区域,同时保留构图、主体和风格的其余部分。
可选的 mask_indexs 字段允许你将编辑范围限定为源生成结果中识别出的特定分段;当你想更改服装、道具或背景细节中的某个元素,而不影响画面其他内容时很有用。由于每次编辑都会返回自己的 request_id,因此可以反复串联编辑,在多轮处理中逐步完善同一图像。与一次性生成相比,这使该端点特别适合迭代式设计和概念创作工作流。
成本分析
| 提供商 | 费用 | 备注 |
|---|---|---|
| muapiapp | $0.05 每次生成 | Muapi bills each follow-up edit the same as a standard generation, with no separate 定价 tier for edits. |
| Fal.ai | 暂不可用 | Grok Imagine Image 2.0's chained edit model is 未在 Fal.ai as of this writing. |
| Replicate | 暂不可用 | Grok Imagine Image 2.0's chained edit model is 未在 Replicate as of this writing. |
Muapi bills each follow-up edit the same as a standard generation, with no separate 定价 tier for edits.
Grok Imagine Image 2.0's chained edit model is 未在 Fal.ai as of this writing.
Grok Imagine Image 2.0's chained edit model is 未在 Replicate as of this writing.
** 竞品价格根据相似模型架构和使用层级估算。
配置参数
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| 提示词 | string | 描述所需编辑的文本提示词。最多 5000 个字符。 | Change the subject's jacket to a teal windbreaker, keep everything else in the scene unchanged. |
| 源请求 ID | string | 之前 grok-imagine-image-2 生成任务返回的、用于编辑的 request_id。 | 189245 |
| 蒙版片段索引 | array | 可选的 index numbers of segments from the source image to restrict the edit to. | - |
描述所需编辑的文本提示词。最多 5000 个字符。
Change the subject's jacket to a teal windbreaker, keep everything else in the scene unchanged.之前 grok-imagine-image-2 生成任务返回的、用于编辑的 request_id。
189245可选的 index numbers of segments from the source image to restrict the edit to.
-开发者文档
先生成基础图像
grok-imagine-image-2 调用并提供 prompt 和 aspect_ratio,任务完成后记下 request_id。描述编辑内容
request_id 和准确描述修改内容的提示词调用 grok-imagine-image-2-edit。请具体说明哪些内容必须保持不变。可选:限定编辑范围
mask_indexs(源生成结果中的分段索引数字数组),将编辑限制在特定区域,而不是整张图像。轮询并串联编辑
request_id 可以传入下一次 grok-imagine-image-2-edit 调用,以继续完善同一图像。curl -X POST https://api.muapi.ai/api/v1/grok-imagine-image-2-edit \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"Change the jacket to a teal windbreaker, keep everything else unchanged", "request_id":"189245"}'
常见问答
它会对之前由 Grok Imagine Image 2.0 生成的图像应用由提示词描述的定向编辑,仅修改描述的区域,同时保留图像的其他部分。
不可以。此端点只能编辑由 grok-imagine-image-2(或之前的 grok-imagine-image-2-edit 调用)生成的图像,并通过 request_id 引用。
request_id 是已完成的 grok-imagine-image-2(或 grok-imagine-image-2-edit)生成任务返回的标识符。将它传入此端点即可编辑指定图像。
mask_indexs 是源生成结果中的分段索引数字可选数组,可让你将编辑限制在特定区域,而不是整张图像。
可以。每次编辑调用都会返回自己的 request_id,可将其传入另一次 grok-imagine-image-2-edit 调用,在多轮处理中逐步完善同一图像。
每次编辑调用按 $0.05 per generation 计费,与标准 Grok Imagine Image 2.0 请求相同。