TL;DR
Paint-Anything introduces a unified text-prompt interface that uses explicit 24-bit hex codes to achieve precise, object-level color control across both image generation and editing tasks. By combining a novel data pipeline with "pure-color anchors" activated only at high-noise timesteps, it allows standard diffusion models to follow exact color specifications without sacrificing natural image quality.
What Problem Does This Paper Address?
While modern text-to-image diffusion models excel at generating rich scenes from descriptive text, they struggle with precise color control. Asking for a "blue logo" or a "red shirt" works for creative exploration, but professional design requires adhering to exact color specifications (e.g., brand guidelines or product lines) defined by 24-bit hex values.
Existing approaches to color control often rely on separate, complex control pathways, task-specific modules, or expensive inference-time optimization. Furthermore, image generation and image editing are typically treated as completely separate problems. Paint-Anything addresses this gap by unifying both tasks under a single, prompt-native numeric color interface.
Methods
The authors leverage the inherent ability of modern large language models (LLMs) to associate raw hex codes with color semantics. They introduce three core components to train a unified diffusion model (built on FLUX.2-4B):
- Explicit Color-Tag Wrapping: Hex strings are explicitly wrapped in
<color>#HEX</color>tags directly inside the text prompt, providing a clear syntax for the frozen text encoder. - Unified Generation and Editing Format: The model is jointly trained on text-to-image generation and image editing. For editing, the source image is passed as an additional clean condition latent branch at the start of the denoising process.
- Timestep-Gated Pure-Color Anchors: Real-world images are inherently noisy due to shadows and lighting, making exact hex labels approximate at best. To ground the model's pixel-space color control, the authors introduce synthetic, solid-color images paired with their exact hex codes. Crucially, these "pure-color anchors" are only used during high-noise timesteps ($t \in [0.8, 1.0]$), where global color layout is established, leaving low-noise timesteps to focus on natural image textures and details.
The training architecture is illustrated below: Paint-Anything training architecture featuring timestep-gated pure-color anchors.
Datasets
The paper introduces both a massive training dataset and a rigorous evaluation benchmark:
- Paint-500K: A newly constructed dataset containing 500K color-control samples (400K text-to-image generation, 100K editing pairs). The data pipeline uses a VLM for object grounding, SAM3 for segmentation, and MeanShift clustering in CIELAB space to extract perceptually accurate dominant colors from real images, outperforming standard fixed-$K$ k-means clustering.
- Any Color Benchmark (ACBench): A new evaluation benchmark designed to measure object-level hex color fidelity. It consists of ACBench-T2I (1000 prompts split between single-object and two-object compositions) and ACBench-Edit (500 real-image recoloring prompts).
The automated data pipeline is shown here: The Paint-500K automated data pipeline.
Key Insights and Ideas
- LLMs are Secretly Color Experts: Even compact language models (like Qwen3-4B) can natively parse raw hex strings into plausible color descriptions, meaning specialized color encoders are unnecessary.
- Shadows Lie, Anchors Tell the Truth: Relying solely on real images for exact hex color training fails because lighting and shadows distort the true RGB values. Introducing pure-color anchors provides a clean mathematical baseline for hex-to-RGB mapping.
- Timing is Everything: Training on solid-color images throughout the entire diffusion process destroys natural image generation capabilities. Restricting pure-color anchors to high-noise timesteps ($t \ge 0.8$) allows the model to lock in the correct color macro-statistics early on, while natural images guide the fine-grained details later.
- Perceptual Clustering Matters: Standard k-means clustering in RGB space splits natural shading into redundant color labels. Performing MeanShift clustering in the CIELAB space aligns much better with human color perception.
Key Results
- Massive Fidelity Gains: On the FLUX.2-4B backbone, Paint-Anything improves the ACBench-T2I score by 85.3% (from 37.02 to 68.58) and the ACBench-Edit score by 28.3% (from 58.90 to 75.57) compared to the base model.
- Size Doesn't Always Matter: The fine-tuned 8B parameter model (FLUX.2-4B + Ours) significantly outperformed the much larger 56B parameter base model (FLUX.2-dev) on ACBench-T2I (68.58 vs 51.70).
- State-of-the-Art Performance: Paint-Anything achieved the highest average scores on both the compositional CompColor benchmark and the GenColorBench NCU evaluation compared to all specialized color-control baselines.
A qualitative comparison demonstrating the precision of the model can be seen below: Qualitative comparison showing Paint-Anything accurately matching hex values compared to the base FLUX model.
Limitations and Future Work
The authors note that their current training data lacks palette-specific supervision (e.g., controlling a multi-color palette across an entire image rather than individual objects). Future work will focus on incorporating palette-level color controls and expanding this unified prompt-native interface to a wider variety of complex color-manipulation tasks.
Summary updated