Few-Shot Font Generation via Attribute-Guided Diffusion with Style Contrastive Learning
摘要
Font generation remains a challenging task due to the complexity of character structures and the demand for style consistency across large glyph sets. Existing methods based on generative adversarial networks often suffer from training instability and mode collapse, limiting their scalability to high-quality few-shot font generation. To address these limitations, we propose a novel diffusion-based framework with attribute-guided generation and style contrastive learning. Specifically, we decouple content and style representations through pre-trained encoders and integrate them as conditional inputs into a diffusion model. This design enables stable training and generalization to both unseen content and unseen styles. We propose a multi-reference style fusion strategy that inputs more style images into the encoder and averages their latent codes to reduces style encoding variance. To enhance style fidelity, we introduce a style contrastive loss that explicitly distinguishes target styles from negative samples, ensuring robust style encoding even with limited references. Extensive experiments on a dataset of 400 fonts demonstrate that our method outperforms state-of-the-art approaches by achieving superior quantitative metrics and qualitative realism. Additionally, our model supports cross-lingual generation, paving the way for broader applications in multilingual typography.