Research
Efficient Scene-Text Refinement via Pixel-Space Grouped Image Generation
Efficient Scene-Text Refinement via Pixel-Space Grouped Image Generation Overview Research area: Computer Vision — scene-text generation and editing, pixel-space diffusion/flow-matching generative mod

- arXiv
- 2610.18284
- Published
- 2026-10-13
- Authors
- Yaoli Liu, Guo-Hua Wang, Yiyang Chen, Qing-Guo Chen, Zhao Xu, Weihua Luo, Yao-Xiang Ding
AI summary
Efficient Scene-Text Refinement via Pixel-Space Grouped Image GenerationOverview
Research area: Computer Vision — scene-text generation and editing, pixel-space diffusion/flow-matching generative models, and text refinement in generated images.
Technical level: Advanced. The paper assumes familiarity with flow matching, diffusion sampling, classifier-free guidance, positional encoding, and VAE latent compression, though the core ideas are described conceptually.
Scope: The paper proposes PixText, a pixel-space grouped generation model for correcting erroneous small text in generated images, together with a new evaluation benchmark (Text Refinement Bench) and a four-step MeanFlow distillation variant.
What This Paper Is About
Text-to-image models now produce images with coherent layouts and mostly correct text, but errors persist in small text and complex characters, hurting readability and usability. Fixing those errors is hard because existing approaches either redraw entire text regions (changing layout, style, typeface, and background color) or rely on latent-space models whose VAEs lose fine strokes during reconstruction. The paper's goal is a refinement method that is simultaneously accurate, preserving of unedited content, and computationally cheap.
Key Contributions
-
PixText, a model that formulates local text refinement as grouped image generation in pixel space: conditioned on the original image, it generates only the target regions and pastes the predicted pixels back, avoiding VAE encoding/decoding entirely and preserving unedited content.
-
Text Refinement Bench, a new benchmark built from actual model-generated images (including images released in the public Qwen-Image Bench), with human-verified character-level error annotations, correction targets, and a unified protocol evaluating correction accuracy, background preservation, and inference efficiency. It contains 1,034 images and 2,638 repair targets.
-
Training and sampling fixes: uniform timestep sampling to mitigate patch-boundary grid artifacts (also validated on MiniT2I-B/16), and a revised sampling update formulated directly on the clean prediction to remove residual speckle from incomplete denoising.
-
Four-step MeanFlow distillation, which reduces amortized generation cost to less than one GPU-second per image while retaining most of the refinement accuracy (81.84% pass versus 83.06% for the 25-step model).
Main Findings
-
Large accuracy gap on Text Refinement Bench: PixText achieves 83.06% Pass and 94.66% PP-OCRv6 exact target-character OCR accuracy, versus 36.77% Pass and 52.31% OCR accuracy for the strongest baseline, FLUX-Text. PixText also has the lowest FID (0.34) and LPIPS (0.0010) among compared methods.
-
Recognition-rank agreement: PixText reaches 92.95% R@1 on Text Refinement Bench; the four-step MeanFlow variant reaches 92.57%.
-
Four-step efficiency: The MeanFlow variant retains 81.84% Pass with 0.942 GPU-seconds per image, compared with 4.514 GPU-seconds for the 25-step PixText and 16.420 GPU-seconds for FLUX-Text (17.799B parameters). MeanFlow has 18.92% relative derivative error versus BF16's 192.64% without the added cost of strict FP32.
-
Model size: PixText uses 0.952B parameters (including generator, VAE, and text encoders), versus 17.799B for FLUX-Text and 1.428B for AnyText; the MeanFlow variant is 0.954B.
-
Conventional text generation stays competitive: On AnyText Bench, PixText achieves the highest Chinese accuracy (84.13 Acc, 0.9477 NED) and ranks second to FLUX-Text on English (80.91 Acc versus FLUX-Text's 84.05).
-
VAEs damage small glyphs: A character roughly 20 pixels high becomes difficult to recognize after reconstruction with the Stable Diffusion, FLUX.1, and Qwen-Image VAEs (full-image encoding, posterior-mode decoding in FP32).
-
Local VAE decoding causes color drift: Independently decoding a region with the FLUX.1-VAE (even with 32 pixels of extra context) produces a visible color mismatch when pasted back, which is larger than the VAE-only reconstruction error.
-
JiT's output head is cheap: Under matched hardware and resolution, one JiT-L/16 output head call takes 0.12 ms and 6.4 GFLOPs with 2.89M parameters, less than 1% of the decoding time of the evaluated autoencoders (SD VAE: 49.49M params, 90.89 ms, 10470.4 GFLOPs; FLUX.1 VAE: 49.55M, 90.54 ms, 10472.2; Qwen-Image VAE: 73.30M, 69.94 ms, 11682.6; FLUX.2 VAE: 49.62M, 90.76 ms, 10474.7; DC-AE f32c32: 159.22M, 55.38 ms, 8368.6). It is also lighter than PixelDiT 1300M (105.06M, 15.01 ms, 868.9), DiP XL/16 (6.97M, 5.65 ms, 513.5), and DeCo XXL/16 (12.61M, 8.18 ms, 142.1).
-
Position encoding reduces tokens: Centered Continuous Position Encoding (CCPE) lets item crops start at arbitrary pixel locations rather than aligning to the patch grid, reducing item tokens by 13.7% relative to grid-aligned crops across 116,038 text regions.
-
OCR can hide glyph errors: All four example glyphs in Figure 7 are transcribed as their targets with confidence between 99.67% and 99.97%, yet fail the CJK-CLIP pass criterion, matching human error annotations.
-
Mixed precision matters for MeanFlow DDE: With a fixed interval (t, s) = (0.4, 0.8) and step size h = 0.005, mixed precision reduces median relative derivative error from 192.64% (BF16) to 18.92%, costing 0.706 s versus 0.551 s for BF16 and 23.895 s for strict FP32 — roughly 34 times faster than strict FP32 and 28% more computation than BF16.
Methodology in Plain English
The authors start from the observation that general-purpose image models already get layout and most text right — the errors are localized. So instead of regenerating whole images or whole text boxes, they generate only the bad patches.
Working in pixel space. Latent-space methods compress images into a VAE latent and decode them back, which blurs strokes on characters around 20 pixels tall and introduces color shifts when only a small region is decoded. PixText skips the VAE entirely and predicts raw pixels, using the lightweight JiT architecture with an x-prediction target: the network predicts the clean image directly, and the prediction is converted into a velocity to compute the loss.
Grouped generation. Each image is organized into three token types: a main image that supplies scene context (the source image with the erroneous text locally blurred out), item images that are the regions to be regenerated, and glyph images that specify what text should appear, rendered with PIL in single-channel grayscale. The main image and items attend bidirectionally, items attend to each other to share context, but each glyph attends only to its paired item. Items are initialized from Gaussian noise, and the model predicts only item pixels, which are pasted back into the original image. Editing granularity follows the writing system: character-level regions for Chinese, word-level for alphabetic scripts such as English. Positional alignment uses 3D RoPE coordinates centered on the original image, and FlexAttention handles variable-length batches without padding.
Timestep conditioning. Noisy items receive the current timestep t, while the main image and the glyphs are pinned to the clean endpoint t = 1, so the model can distinguish generation targets from known conditions.
Two training/sampling tweaks. First, the authors found that grid artifacts aligned to patch boundaries stem partly from the training timestep distribution; after initial logit-normal sampling, they switch to uniform sampling, which lowers patch-boundary gradients. Second, they observed that the lower bound on 1 − t used when converting clean-image predictions to velocities weakens the final update and leaves speckle; they reformulate the update so the last step returns the clean prediction in full.
Distillation. A trained PixText teacher is distilled with MeanFlow, which learns the average velocity over a time interval rather than an instantaneous one. The total derivative required by the MeanFlow identity is estimated with finite differences (DDE), sampling two sorted uniform timesteps and using central differences with step size h = 0.005, reduced near boundaries. The result reaches t = 1 in four Euler steps.
Training setup. Eight H800 GPUs, an internal Chinese–English dataset of roughly 2.53 million image records, AdamW at learning rate 10⁻⁴ with β = (0.9, 0.95), zero weight decay, EMA decay 0.9999, and 2,000 warmup steps per optimizer reinitialization. Progressive resolution: about 13 epochs at up to 512² pixels, then about 15 epochs at up to 1024², then roughly 3,000 MeanFlow updates with effective batch size 24. Architecture: patch size 16, 32 Group JiT Blocks, hidden dimension 1280, 16 attention heads. Evaluation uses 25 Euler steps for PixText and four for MeanFlow, both with a glyph-conditioned CFG scale of 3.3.
Evaluation. Text Refinement Bench uses CJK-CLIP, a CLIP-style glyph recognizer, to check glyph fidelity beyond whether OCR recognizes the character. A glyph passes when its similarity to the target is at least the per-character reference mean minus 0.03; Pass measures target-glyph agreement and R@1 measures character identification. OCR accuracy is also reported using the PP-OCRv6 medium recognizer, where blank or multi-character outputs count as errors. LPIPS uses AlexNet on full images resized to 256×256.
Why This Matters
Impact on research. The paper argues that text refinement should be separated from overall image generation, and that pixel-space generation removes a concrete bottleneck (VAE reconstruction of fine strokes) for small-text tasks. It also contributes an open benchmark for a task that existing benchmarks such as AnyText Bench do not directly measure, and reports that a simple change to the training timestep distribution mitigates grid artifacts in another pixel-space model (MiniT2I-B/16), which suggests the finding generalizes beyond this system. The mixed-precision analysis for DDE is a practical observation for anyone implementing MeanFlow-style distillation.
Real-world applications (plausible extensions of the refinement capability):
- Post-processing pipelines that clean up text errors in images produced by text-to-image models before delivery or publication.
- Marketing and e-commerce asset generation, where product names, prices, or slogans rendered in an image must be legible and correct without redrawing the surrounding creative.
- Signage, packaging, and poster mockup workflows, where small character errors currently require manual retouching.
- Multilingual content localization, where a single wrong character (especially in Chinese) can change meaning while the rest of the layout should stay untouched.
Industry relevance. The efficiency numbers matter operationally: 0.942 amortized GPU-seconds per image for the four-step variant versus 16.420 for FLUX-Text (17.799B parameters) makes localized correction feasible inside high-volume generation workflows. The 0.952B parameter footprint and elimination of VAE encoding/decoding also reduce serving cost. The paper notes that the work was done during an internship at Alibaba Cloud Computing, and the dataset is an internal Chinese–English corpus of about 2.53 million image records, indicating direct industrial use.
Future Directions
-
Scaling and generalization. The data is an internal Chinese–English set; Appendix H reportedly shows glyph-conditioned generation beyond the main Chinese–English training scripts, but the extent to which the approach transfers to other writing systems is left open.
-
Distillation headroom. The four-step variant loses 1.21 percentage points in Pass relative to the 25-step teacher (83.06% to 81.84%); how few steps are possible before this trade-off becomes unacceptable is not resolved.
-
Benchmark scope. Text Refinement Bench covers 1,034 images and 2,638 repair targets. Whether its error distribution matches that of future generators, and how it compares against instruction-driven editing benchmarks (TextEdit, TextEditBench, MultiTextEdit) and ScenePair, are questions the paper raises but does not fully settle.
-
Benchmark and tooling dependencies. Evaluation depends on CJK-CLIP (described as currently under review, with the model to be publicly released) and PP-OCRv6; the paper's finding that OCR can confidently transcribe malformed glyphs suggests further work on reliable glyph-fidelity metrics.
-
Comparison gap. Appendix I reports a comparison with Qwen-Image-3.0-Pro through its editing API on Text Refinement Bench, leaving broader API-level comparisons as an open area.
Target Audience
Researchers and engineers working on text-to-image generation, scene-text editing, and diffusion or flow-matching sampling efficiency. It is most useful to readers who need to fix local text errors in generated images without disturbing the rest of the image, to those implementing few-step distillation (MeanFlow) in pixel space, and to benchmark designers interested in character-level, glyph-fidelity evaluation rather than OCR-only scoring. The paper is at an advanced technical level and presumes background in generative model training and sampling.
Authors’ abstract
Generated images often have coherent layouts and visual content, yet local errors in small text and complex characters still limit their readability and practical use. Scene-text refinement requires accuracy, preservation, and efficiency. Existing methods based on variational autoencoders (VAEs) can lose fine strokes during reconstruction, while full-image editing can shift background colors. In this work, we introduce PixText, a model that formulates local text refinement as grouped image generation in pixel space. Conditioned on the original image, PixText generates only the target regions, preserves unedited content, and uses MeanFlow for four-step generation. We further introduce Text Refinement Bench to evaluate text correction and image preservation in generated images. On this benchmark, PixText achieves 83.06% glyph pass and 94.66% exact target-character OCR accuracy, versus 36.77% and 52.31% for the strongest baseline. Its four-step MeanFlow variant retains an 81.84% pass rate with less than one GPU-second of amortized generation cost per image.