Abstract
Controlling the stylistic attributes of images generated by diffusion models remains a significant challenge. Existing methods often require extensive fine-tuning or suffer from semantic interference between style and content. We present StyleTokenizer, a zero-shot framework that tokenizes visual style into a semantic space shared with text. By utilizing a dedicated Style Encoder ($E_s$) and a Style Tokenizer ($T_s$), our method enables precise style transfer from a single reference image without compromising the integrity of the text prompt. Our approach achieves state-of-the-art performance in style similarity and aesthetic quality, as validated by both quantitative metrics and user studies.
Introduction
While text-to-image diffusion models like Stable Diffusion are incredibly powerful, precisely controlling the style of an image—the brushwork, lighting, or "vibe"—remains notoriously difficult. Existing approaches usually fall into two camps. Fine-tuning methods like LoRA or DreamBooth require multiple images and significant computation time for every new style. Conversely, adapter-based methods like IP-Adapter inject image features directly into the model's UNet. However, because image and text representations live in different mathematical "spaces," they often interfere with each other. This leads to a "tug-of-war" where the style reference might accidentally override the content of the text prompt (e.g., generating a landscape when a specific object was requested). StyleTokenizer addresses this by decoupling style from content and aligning them within a single, unified semantic space.
Methods
The authors propose a two-stage framework designed to treat style as a linguistic concept:
- The Style Encoder ($E_s$): To capture the essence of style, a dedicated encoder was trained via contrastive learning. Unlike standard CLIP encoders that focus on high-level semantics (the "what"), this encoder focuses on the "how." It learns to cluster images with similar styles while ignoring the actual objects depicted.
- The Style Tokenizer ($T_s$): This core innovation is a 2-layer MLP that translates style embeddings into a set of "style tokens." These tokens are designed to live in the same word embedding space as the text encoder.
- Unified Conditioning: Instead of adding new layers to the diffusion model, style tokens are concatenated with text tokens. The entire sequence is fed into the standard text encoder, ensuring the model treats the style as a "visual prompt" that complements the text rather than competing with it.
- Independent Control: A modified version of Classifier-Free Guidance (CFG) allows users to independently scale the strength of the text prompt and the style reference during inference.
Results and Discussion
StyleTokenizer achieved a Style Similarity score of 0.482 and an Aesthetic Score of 6.68, outperforming state-of-the-art methods like IP-Adapter and StyTr2. In a user study, professional designers chose StyleTokenizer's results 61.8% of the time, citing its superior ability to preserve prompt content while applying complex aesthetics.
The model excels at qualitative decoupling. For example, when given a reference image with a highly specific texture and a prompt for a human face, StyleTokenizer successfully generates the subject without failing to capture the intricate details of the style reference.
Conclusion
StyleTokenizer provides a robust, zero-shot solution for style control in diffusion models. By converting visual style into "pseudo-words," the authors leverage the text encoder's existing ability to balance multiple concepts. While performance is tied to the quality of the Style Encoder and the Style30k dataset, this approach minimizes interference and offers a versatile tool for creators. Future directions include extending this tokenization approach to other image attributes, such as layout or lighting.
Summary updated