CoCo:用于文本到图像预览和稀有概念生成的代码作为CoT
CoCo: Code as CoT for Text-to-Image Preview and Rare Concept Generation
AI总结:
CoCo通过代码驱动的推理框架,提升文本到图像生成的精度和可控性,实现结构化图像生成和稀有概念生成。
摘要:
最近统一多模态模型(UMMs)的进步显著推动了文本到图像(T2I)生成,特别是在通过链式思维(CoT)推理的整合方面。然而,现有的基于CoT的T2I方法大多依赖于抽象的自然语言规划,这缺乏复杂空间布局、结构化视觉元素和密集文本内容所需的精度。在本工作中,我们提出了CoCo(代码作为CoT),一种以代码驱动的推理框架,将推理过程表示为可执行代码,从而实现图像生成的明确且可验证的中间规划。给定一个文本提示,CoCo首先生成指定场景结构布局的可执行代码,然后在沙盒环境中执行以渲染一个确定性的草稿图像。模型随后通过细粒度图像编辑来完善此草稿,以产生最终的高质量结果。为了支持这种训练范式,我们构建了CoCo-10K,一个经过精心编排的数据集,包含结构化草稿-最终图像对,旨在教授结构化草稿的构建和纠正视觉细化。在StructT2IBench、OneIG-Bench和LongText-Bench上的实证评估表明,CoCo在直接生成上实现了+68.83%、+54.8%和+41.23%的改进,同时在其他由CoT赋能的生成方法中也表现更优。这些结果表明,可执行代码是一种有效的且可靠的推理范式,能够实现精确、可控和结构化的文本到图像生成。代码可在:https://github.com/micky-li-hd/CoCo获取。
英文摘要:
Recent advancements in Unified Multimodal Models (UMMs) have significantly advanced text-to-image (T2I) generation, particularly through the integration of Chain-of-Thought (CoT) reasoning. However, existing CoT-based T2I methods largely rely on abstract natural-language planning, which lacks the precision required for complex spatial layouts, structured visual elements, and dense textual content. In this work, we propose CoCo (Code-as-CoT), a code-driven reasoning framework that represents the reasoning process as executable code, enabling explicit and verifiable intermediate planning for image generation. Given a text prompt, CoCo first generates executable code that specifies the structural layout of the scene. The code is then executed in a sandboxed environment to render a deterministic draft image. Subsequently, the model refines this draft through fine-grained image editing to produce the final high-fidelity result. To support this training paradigm, we construct CoCo-10K, a curated dataset containing structured draft-final image pairs designed to teach both structured draft construction and corrective visual refinement. Empirical evaluations on StructT2IBench, OneIG-Bench, and LongText-Bench show that CoCo achieves improvements of 68.83%, 54.8%, and 41.23%, respectively, over direct generation, while also outperforming other CoT-enhanced generation methods. These results demonstrate that executable code is an effective and reliable reasoning paradigm for precise, controllable, and structured text-to-image generation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。