MegaStyle: Constructing Diverse and Scalable Style Dataset via Consistent Text-to-Image Style Mapping
| Authors | Junyao Gao et al. |
| Year | 2026 |
| HF Upvotes | 92 |
| arXiv | 2604.08364 |
| Download | |
| HF Page | View on Hugging Face |
Abstract
In this paper, we introduce MegaStyle, a novel and scalable data curation pipeline that constructs an intra-style consistent, inter-style diverse and high-quality style dataset. We achieve this by leveraging the consistent text-to-image style mapping capability of current large generative models, which can generate images in the same style from a given style description. Building on this foundation, we curate a diverse and balanced prompt gallery with 170K style prompts and 400K content prompts, and generate a large-scale style dataset MegaStyle-1.4M via content-style prompt combinations. With MegaStyle-1.4M, we propose style-supervised contrastive learning to fine-tune a style encoder MegaStyle-Encoder for extracting expressive, style-specific representations, and we also train a FLUX-based style transfer model MegaStyle-FLUX. Extensive experiments demonstrate the importance of maintaining intra-style consistency, inter-style diversity and high-quality for style dataset, as well as the effectiveness of the proposed MegaStyle-1.4M. Moreover, when trained on MegaStyle-1.4M, MegaStyle-Encoder and MegaStyle-FLUX provide reliable style similarity measurement and generalizable style transfer, making a significant contribution to the style transfer community. More results are available at our project website https://jeoyal.github.io/MegaStyle/.
Engineering Breakdown
Plain English
MegaStyle introduces an automated pipeline for constructing large-scale, high-quality style datasets by leveraging text-to-image generative models to create consistent intra-style and diverse inter-style images. The authors curated 170K style prompts and 400K content prompts, generating 1.4M paired images through systematic prompt combinations. They then trained a style encoder using style-supervised contrastive learning and fine-tuned a FLUX-based model, achieving expressive style-specific representations that outperform previous approaches. This work essentially solves the data bottleneck in style transfer by automating curation at massive scale while maintaining semantic and stylistic quality.
Core Technical Contribution
The core novelty is a data curation pipeline that exploits the consistency of large generative models to automatically produce balanced, high-quality style datasets without manual annotation. Rather than scraping the web or relying on human labeling, the authors use structured prompt engineering (170K style prompts × 400K content prompts) to systematically generate diverse style combinations, ensuring each style is well-represented across multiple visual contexts. A secondary contribution is the style-supervised contrastive learning objective that learns style-specific embeddings from this curated data, enabling a style encoder to extract discriminative representations. This differs from prior work by treating dataset creation itself as a solvable engineering problem through generative models, rather than treating it as a fixed bottleneck.
How It Works
The pipeline operates in three stages. First, the authors construct a prompt gallery by carefully curating 170K style descriptions (e.g., 'oil painting', 'cyberpunk', 'watercolor') and 400K content descriptions (objects, scenes, compositions), then systematically combine them using a large text-to-image model (likely Stable Diffusion or similar) to generate 1.4M images with guaranteed style consistency. Second, they employ style-supervised contrastive learning: pairs of images with the same style are pulled together in embedding space while images from different styles are pushed apart, training a style encoder to extract style-specific features that are invariant to content. Third, they fine-tune a FLUX model (a diffusion-based architecture) on this dataset, using the trained style encoder as a conditioning mechanism to enable precise style transfer. The key insight is that by controlling both the style prompt and content prompt systematically, they guarantee high intra-style consistency while generating inter-style diversity naturally from the prompt space.
Production Impact
For teams building style transfer or image generation products, this approach eliminates the need for expensive manual dataset curation and web scraping, reducing time-to-market significantly. Rather than assembling thousands of style examples by hand, teams can now run a similar pipeline using open-source generative models and structured prompts, scaling to millions of images in days. The trained MegaStyle-Encoder can be plugged into existing image processing pipelines as a drop-in replacement for style extraction, improving downstream tasks like style-guided editing, recommendation, or cross-modal retrieval. The trade-offs are real: generating 1.4M images requires substantial compute (GPUs, inference time for text-to-image models) and the quality floor depends entirely on the base generative model's consistency. Integration complexity is moderate—primarily adapting your inference graph to use the pre-trained encoder and retraining any downstream classifiers or diffusion models on MegaStyle rather than your legacy dataset.
Limitations and When Not to Use This
The pipeline's quality ceiling is bounded by the consistency and diversity of the underlying base generative model; if that model has stylistic blind spots or biases, MegaStyle inherits them at scale (1.4M times). The work assumes that systematic prompt combinations adequately cover the style space, but highly complex or emergent styles that require nuanced prompt engineering may be underrepresented. No discussion of failure modes when styles overlap (e.g., distinguishing 'impressionism' from 'post-impressionism') or how the contrastive learning objective handles ambiguous style boundaries. The paper provides no evaluation on out-of-distribution styles or real-world user preferences, only computational metrics, leaving questions about whether the learned encoder generalizes to novel styles not in the prompt gallery or to user-curated real-world image collections.
Research Context
This work builds on the recent success of large text-to-image diffusion models (CLIP guidance, Stable Diffusion) and their ability to generate consistent outputs given detailed prompts, automating what prior style transfer research accomplished through hand-engineered features or adversarial training on smaller datasets. It extends the data curation paradigm popularized by works like LAION and DataComp, but applies it specifically to the structured problem of style disentanglement. The approach complements concurrent work on style-conditioned image generation and contrastive learning for visual features, positioning style extraction as a self-supervised learning problem rather than a supervised classification task. This opens a research direction where dataset generation itself becomes an active research lever: future work may explore how to optimize prompt spaces, handle hierarchical styles, or apply similar curation pipelines to other visual attributes (lighting, composition, texture) beyond style alone.
:::tip Subscribe Get weekly breakdowns of papers like this in AI Letters - the newsletter for engineers building production AI systems. :::
