APE: Agentic Prompt Enhancer for Image Generation and Editing
Title: APE: Agentic Prompt Enhancer for Image Generation and Editing
Abstract
While natural language has emerged as a robust interface for creating and modifying images, text-driven visual systems are still notoriously sensitive to how prompts are constructed. Variations in wording, specificity, and the explicitness of visual constraints can lead to divergent results even when semantically similar requests are made. This variability underscores the need to treat prompt enhancement as a trainable core component rather than a peripheral user decision. Currently, leading enhancers typically depend on large, proprietary large language models (LLMs) like ChatGPT or Gemini, which introduces significant costs, latency, and deployment dependencies into the visual generation pipeline.
To address these limitations, we introduce the Agentic Prompt Enhancer (APE), a lightweight framework designed to post-train small language models (SLMs) to function as prompt-enhancement agents. APE offers two distinct operational modes: single-agent rewriting and role-specialized multi-agent enhancement. The single-agent version, known as SAPE, performs prompt rewriting in a single pass. Conversely, the multi-agent version, MAPE, breaks down the enhancement process into a structured router–rewriter–composer workflow, specifically designed to manage complex compositional constraints involving objects, attributes, spatial relationships, and edits.
By leveraging task-aware rewards and specialized post-training protocols, APE enhances visual alignment and prompt adherence without requiring any modifications to the downstream visual model. Our experiments on rigorous image generation and editing benchmarks reveal that post-trained small prompt enhancers consistently surpass their base models, effectively closing the performance gap between open-source solutions and closed-source proprietary enhancers. Furthermore, MAPE demonstrates exceptional proficiency in handling complex compositional tasks within these evaluation sets.
Source: arXiv Generated at: 2026-06-02 00:00:00 UTC





