🤖 AI Summary
This work addresses the high sensitivity of text-to-image generation to prompt phrasing, where semantically similar descriptions often yield inconsistent outputs due to linguistic variations. To mitigate this, the authors propose APE, a lightweight prompt enhancement framework that leverages deployable small language models for prompt rewriting. APE supports both a single-agent variant (SAPE) and a role-specialized multi-agent collaborative approach (MAPE), improving prompt-generation consistency without modifying downstream visual models. Through a task-aware reward mechanism and a structured pipeline of routing, rewriting, and composition, APE significantly outperforms baseline models across multiple image generation and editing benchmarks. Notably, MAPE excels in complex compositional tasks, effectively narrowing the performance gap with proprietary large-model enhancers.
📝 Abstract
Natural language has become a powerful interface for image generation and editing, yet text-guided visual systems remain highly sensitive to prompt formulation. Semantically similar requests can produce different outputs depending on wording, specificity, and how explicitly visual constraints are stated, motivating prompt enhancement as a trainable component rather than a peripheral user choice. Existing strong enhancers often rely on large, proprietary LLMs such as ChatGPT or Gemini, adding cost, latency, and deployment dependence to the visual generation pipeline. We propose Agentic Prompt Enhancer (APE), a lightweight framework that post-trains small language models (SLMs) as prompt-enhancement agents. APE supports both single-agent rewriting and role-specialized multi-agent enhancement. Its single-agent instantiation, SAPE, rewrites the prompt in one pass, while its multi-agent instantiation, MAPE, decomposes enhancement into a router--rewriter--composer process for handling compositional constraints over objects, attributes, spatial relations, and edits. With task-aware rewards and post-training protocols, APE improves visual alignment and prompt following without modifying the downstream visual model. Experiments on challenging image generation and editing benchmarks demonstrate that post-trained small prompt enhancers reliably outperform their base counterparts, narrowing the gap to closed-source prompt enhancers; in addition, MAPE proves particularly strong on complex compositional tasks within these benchmarks.