# 基于指令的图像编辑

基于指令的图像编辑（Instruction-based image editing，IIE）是一种将源图像转换为新图像的方法：用户向模型给出自然语言指令，例如“把天空变成日落橙色”，而不需要提供掩码、目标提示词或手工编辑的选区。2026年的一篇综述将其正式定义为一种以源图像和文本指令为输入、产出编辑后图像的变换，大语言模型（LLM）与视觉语言模型（VLM）加速了这项能力的发展。<sup>[1](https://arxiv.org/abs/2607.25642)</sup> 它不同于文生图生成——后者仅凭提示词生成新图像，没有源图像；也不同于基于掩码的修复——后者由用户涂抹需要改变的区域。在指令编辑中，模型必须自行决定改什么、改多少、以及什么保持不变。

两项品质决定一次编辑是否成功：指令遵循，即输出确实反映了所要求的内容；以及一致性保持，即指令未提及的一切保持原样。<sup>[1](https://arxiv.org/abs/2607.25642)</sup>

| 事实 | 详情 |
|---|---|
| 定义 | 使用文本指令将源图像转换为编辑后图像，无需掩码<sup>[1](https://arxiv.org/abs/2607.25642)</sup> |
| 交叉注意力洞见 | Prompt-to-Prompt，Hertz 等，Google，2022年8月<sup>[2](https://arxiv.org/pdf/2208.01626)</sup> |
| 首个经指令训练的模型 | InstructPix2Pix，Brooks 等，2023年，在 GPT-3 生成的三元组上微调 Stable Diffusion<sup>[1](https://arxiv.org/abs/2607.25642)</sup> |
| 关键数据集 | MagicBrush，2023年：人工标注的 10K+ 三元组，用于多轮编辑<sup>[1](https://arxiv.org/abs/2607.25642)</sup> |
| 训练成本范围 | 微调方法使用 45 万到超过 1000 万个样本；免训练方法的指令理解能力较弱<sup>[3](https://arxiv.org/html/2504.20690)</sup> |
| 参数成本范围 | 从完整 UNet 微调（约 8.6 亿参数，InstructPix2Pix）到约 7500 万可训练参数（DescriptiveEdit，2025年）<sup>[4](https://arxiv.org/html/2508.20505v1)</sup> |
| 主导范式 | 2022年起为扩散模型；2024–2026年自回归与统一架构兴起<sup>[1](https://arxiv.org/abs/2607.25642)</sup> |

## 起源：Prompt-to-Prompt 与 InstructPix2Pix

**Prompt-to-Prompt**（Hertz 等，Google，2022年8月）提供了奠基性的洞见。作者观察到扩散模型的交叉注意力图编码了提示词的空间布局，因此只需改变文本，并在扩散过程中注入原始生成时的交叉注意力图，即可编辑图像，无需掩码，也无需重新训练模型。<sup>[2](https://arxiv.org/pdf/2208.01626)</sup> 他们在 DDIM 反演之后注入注意力图，使自注意力保留原始结构，并通过注意力图替换来处理多指令编辑。代价是注意力泄漏：从编辑区域提取的注意力可能溢出到未改变的区域，造成非预期的改动。<sup>[2](https://arxiv.org/pdf/2208.01626)</sup>

[Prompt-to-Prompt](https://www.edgepedia.org/zh/prompt-to-prompt) 仍要求用户写出完整的编辑后提示词。**InstructPix2Pix**（Brooks 等，2023年）把指令本身变成了交互界面。作者使用微调的 GPT-3 和基于 [Stable Diffusion](https://www.edgepedia.org/zh/stable-diffusion) 的 Prompt-to-Prompt 构建了一个大规模视觉语言编辑数据集，然后微调了一个 UNet，使其能直接根据简单指令编辑图像，并引入双重无分类器引导，以平衡图像保真度与指令影响力。<sup>[1](https://arxiv.org/abs/2607.25642)</sup><sup> • </sup><sup>[5](https://openaccess.thecvf.com/content/CVPR2024/papers/Huang_SmartEdit_Exploring_Complex_Instruction-based_Image_Editing_with_Multimodal_Large_Language_CVPR_2024_paper.pdf)</sup> 同一时间窗口内出现了两项并行基础工作：Google 的 Imagen Editor（2022年12月），一个为文本引导修复而微调的级联扩散模型，训练时使用目标检测器提出修复掩码；<sup>[6](https://ar5iv.labs.arxiv.org/html/2212.06909)</sup> 以及 MagicBrush 数据集（Zhang 等，2023年），一个人工标注的 10K+ 三元组集合，用于多轮编辑，并以掩码支持扩展了 [InstructPix2Pix](https://www.edgepedia.org/zh/instructpix2pix)，实现局部精确性。<sup>[1](https://arxiv.org/abs/2607.25642)</sup>

## 机制如何运作

在基于扩散的编辑器中，指令与源图像在去噪网络内部融合——通常是 U-Net 或扩散 Transformer（DiT）——通过交叉注意力或适配器模块实现。<sup>[1](https://arxiv.org/abs/2607.25642)</sup> 指令的词元关注图像的空间特征，因此交叉注意力图实际上决定了每个词在何处起作用。这正是注意力操控成为 Prompt-to-Prompt 和 FoI 等方法核心杠杆的原因：控制了注意力图，就控制了编辑的位置与强度。

三类方法占据精度–成本权衡曲线上的不同位置：

- **免训练注意力调制。** FoI（2023年12月）构建于 InstructPix2Pix 之上，使用空指令交叉注意力调制，配合掩码引导的解耦采样，使每条指令聚焦于对应区域并减少指令间的干扰，从而无需额外训练即可实现多指令编辑；作者报告其在多指令任务上表现更优。<sup>[7](https://arxiv.org/html/2312.10113v1)</sup>
- **完整微调。** InstructPix2Pix 在大规模生成三元组数据集上微调完整 UNet，约 8.6 亿参数。<sup>[4](https://arxiv.org/html/2508.20505v1)</sup> 微调方法通常对指令理解更好，但需要海量数据：已发表方法使用的样本量从 45 万到超过 1000 万不等。<sup>[3](https://arxiv.org/html/2504.20690)</sup>
- **轻量替代方案。** DescriptiveEdit（2025年8月）将指令编辑重新表述为描述性提示，仅训练约 7500 万参数，同时报告了更优的编辑准确性和结构一致性，并且仍兼容 [ControlNet](https://www.edgepedia.org/zh/controlnet) 和 [IP-Adapter](https://www.edgepedia.org/zh/ip-adapter-and-identity-conditioning) 等社区扩展。<sup>[4](https://arxiv.org/html/2508.20505v1)</sup>

DiT 时代增添了新机制。ICEdit（2025年4月，NeurIPS 2025）发现扩散 Transformer 开箱即用时处理指令编辑效果不佳，于是将编辑视为上下文内生成，采用上下文内提示词格式化、参数高效微调、专家混合路由，以及借助 VLM 的早期过滤推理时扩展。<sup>[3](https://arxiv.org/html/2504.20690)</sup>

## 采用该方法的具名系统

在研究侧，谱系从 InstructPix2Pix（2023年）经 MagicBrush 训练的模型（2023年）、InstructDiffusion（Geng 等，2024年）——后者将训练扩展到 70 万三元组，形成通用编辑接口<sup>[1](https://arxiv.org/abs/2607.25642)</sup>——延伸到 SmartEdit（CVPR 2024），它使用多模态 LLM 将任务扩展到复杂理解与推理场景，<sup>[5](https://openaccess.thecvf.com/content/CVPR2024/papers/Huang_SmartEdit_Exploring_Complex_Instruction-based_Image_Editing_with_Multimodal_Large_Language_CVPR_2024_paper.pdf)</sup> 以及 MCIE（2026年2月），它为多模态 LLM 驱动的编辑增添了空间引导。<sup>[8](https://arxiv.org/html/2602.07993)</sup>

在商业侧，2026年综述将 GPT-4o（OpenAI，2024年）列为端到端指令编辑器，并将 SeedEdit 3.0（2025年）、[Imagen 3](https://www.edgepedia.org/zh/imagen-3)（2024年）、Qwen2.5-VL（2025年）和 [Adobe Firefly](https://www.edgepedia.org/zh/adobe-firefly)（2024年）列为高保真可控编辑器。<sup>[12](https://blog.google/innovation-and-ai/products/google-generative-ai-veo-imagen-3/)</sup> 这些能力均为厂商自报；综述记录中没有关于这些产品内部如何实现该方法的独立技术评估。<sup>[1](https://arxiv.org/abs/2607.25642)</sup>

## 数据一览

**EditBench**（Google，2022年12月）为文本引导修复提供了人工评估。在文本–图像对齐方面，Imagen Editor 在 78% 的对比中比 Stable Diffusion 更受评估者青睐，在 77% 的对比中比 [DALL-E 2](https://www.edgepedia.org/zh/dall-e-2) 更受评估者青睐；使用目标检测器提出的掩码进行训练，在 68% 的对比中比使用随机掩码更受评估者青睐。<sup>[6](https://ar5iv.labs.arxiv.org/html/2212.06909)</sup>

**ICEdit 对 SeedEdit** 提供了一次罕见的作者自报与商业系统的正面对比：ICEdit 报告 VIE 得分为 78.2，SeedEdit 为 75.7，而前者使用的训练数据量仅为以往训练所需的 0.1%。两项数字均为作者自报，未经独立测量。<sup>[3](https://arxiv.org/html/2504.20690)</sup>

更新的基准拓宽了测量范围。综述中的 CDD-IIE Bench 覆盖 5 个评估维度和 21 项编辑任务。<sup>[1](https://arxiv.org/abs/2607.25642)</sup> GIDE-Bench（2026年）包含 805 个组合式编辑场景，输入具有多模态多样性，强调精确区域控制和多步推理，并使用双模型（GPT 与 Gemini）评估。<sup>[9](https://arxiv.org/html/2603.21176v1)</sup>

## 与其他方案的比较

**基于掩码的修复**将定位负担交给用户：Imagen Editor 是一个文本引导的修复模型，其编辑忠实于文本提示词，实现方式是在训练时使用目标检测器提出修复掩码。<sup>[6](https://ar5iv.labs.arxiv.org/html/2212.06909)</sup> 指令编辑则要求模型自行定位。Point & Instruct（2024年2月）让用户将点、边界框等视觉输入的空间精确性与“把狗变成棕色”这类文本指令的视觉描述性结合起来，将视觉指令遵循框定为可由 LLM 解决的语言生成任务。<sup>[10](https://arxiv.org/html/2402.07925)</sup> MCIE（2026年2月）在模型内部走了一条相关路线，通过掩码交叉注意力纳入空间线索，将每条指令与其区域关联，其动机是发现 InstructPix2Pix 经常产生不精确的编辑。<sup>[8](https://arxiv.org/html/2602.07993)</sup>

**条件适配器**是互补而非竞争关系。DescriptiveEdit 明确保持与 ControlNet 和 IP-Adapter 的兼容，因此结构或身份条件可以叠加在基于指令的编辑之上。<sup>[4](https://arxiv.org/html/2508.20505v1)</sup>

从历史上看，基于 GAN 的编辑方法受限于狭窄的编辑领域，主要实现粗粒度的大范围修改，而扩散模型通过文本引导提供了更优的细粒度可控性。<sup>[1](https://arxiv.org/abs/2607.25642)</sup>

## 近期进展

该领域经历了三种范式：基于 GAN 的编辑；2022年起作为主导方法的基于扩散的编辑；以及最近的自回归与统一架构。<sup>[1](https://arxiv.org/abs/2607.25642)</sup> 在扩散内部，2024–2025年出现了多模态 LLM 编辑器，如 SmartEdit，<sup>[5](https://openaccess.thecvf.com/content/CVPR2024/papers/Huang_SmartEdit_Exploring_Complex_Instruction-based_Image_Editing_with_Multimodal_Large_Language_CVPR_2024_paper.pdf)</sup> 以及将基于 LLM 的语言推理与基于扩散的合成统一在单一框架中的方案，其中一些利用思维链推理来扩展指令覆盖范围，<sup>[11](https://proceedings.neurips.cc/paper_files/paper/2025/file/1aa1fde3661b23ba9b043082069fd144-Paper-Conference.pdf)</sup> 还有基于 DiT 的上下文内编辑，如 ICEdit。<sup>[3](https://arxiv.org/html/2504.20690)</sup> 到2026年，综述将 GPT-4o 等端到端多模态系统本身视为指令编辑器，SeedEdit 3.0 和 Imagen 3 等商业编辑器也归入同一类别。<sup>[1](https://arxiv.org/abs/2607.25642)</sup>

## References

1. Instruction-based Image Editing: A Survey on Data, Models, Evaluation, and Applications (2026). https://arxiv.org/abs/2607.25642
2. Prompt-to-Prompt Image Editing with Cross Attention Control (Hertz et al., 2022). https://arxiv.org/pdf/2208.01626
3. ICEdit: Enabling Instructional Image Editing with In-Context Generation in Large Scale Diffusion Transformer (April 2025; NeurIPS 2025). https://arxiv.org/html/2504.20690
4. Describe, Don't Dictate: Semantic Image Editing with Natural Language Intent (DescriptiveEdit, August 2025). https://arxiv.org/html/2508.20505v1
5. SmartEdit: Exploring Complex Instruction-based Image Editing with Multimodal Large Language Models (CVPR 2024). https://openaccess.thecvf.com/content/CVPR2024/papers/Huang_SmartEdit_Exploring_Complex_Instruction-based_Image_Editing_with_Multimodal_Large_Language_CVPR_2024_paper.pdf
6. Imagen Editor and EditBench: Advancing and Evaluating Text-Guided Image Inpainting (Google, December 2022). https://ar5iv.labs.arxiv.org/html/2212.06909
7. FoI: Focus on Your Instruction — Fine-grained and Multi-instruction Image Editing by Attention Modulation (December 2023). https://arxiv.org/html/2312.10113v1
8. MCIE: Multimodal LLM-Driven Complex Instruction Image Editing with Spatial Guidance (February 2026). https://arxiv.org/html/2602.07993
9. GIDE: Unlocking Diffusion LLMs for Precise Training-Free Image Editing (2026). https://arxiv.org/html/2603.21176v1
10. Point & Instruct: Enabling Precise Image Editing by Unifying Direct Manipulation and Text Instructions (February 2024). https://arxiv.org/html/2402.07925
11. Image Editing As Programs with Diffusion Models (NeurIPS 2025). https://proceedings.neurips.cc/paper_files/paper/2025/file/1aa1fde3661b23ba9b043082069fd144-Paper-Conference.pdf
12. Google generative ai veo imagen 3 (blog.google). https://blog.google/innovation-and-ai/products/google-generative-ai-veo-imagen-3/

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026; Oct 11, 2026; Oct 15, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 现代人工智能：基础模型、生成式人工智能与人工智能产业 › Foundation-model methods and training › Generative media methods: diffusion, flow, and autoregressive generation

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/instruction-based-image-editing

English original: https://www.edgepedia.org/instruction-based-image-editing
