--- license: cc-by-nc-4.0 language: - en base_model: - stabilityai/stable-diffusion-3-medium library_name: diffusers tags: - text-to-image --- # TeEFusion: Blending Text Embeddings to Distill Classifier-Free Guidance (ICCV 2025)

๐Ÿ“ Paper โ€ข ๐Ÿ’ป Github

TeEFusion is a simple yet powerful distillation method that fuses classifier-free guidance directly into text embeddings, enabling student models to mimic complex teacher sampling strategies with a single forward passโ€”achieving up to 6ร— faster inference without sacrificing image quality .
The overview of TeEFusion
The overview of TeEFusion
--- ## ๐Ÿš€ Key Features * **Embed-Level Guidance Fusion**. Incorporates guidance magnitude *w* by linearly combining conditional and null prompt embeddings, eliminating the need for two forward passes . * **Test-Time Sampling Agnostic**. Distills from complex teacher sampling strategy (Euler + CFG, Z-Sampling + CFG, W2SD + CFG) into a simple student that uses standard Euler sampling . * **Parameter-Free**. No extra network modules beyond the pretrained modelโ€™s encoder and decoder. --- ## ๐Ÿ“ฆ Installation ```bash git clone https://github.com/AIDC-AI/TeEFusion.git cd TeEFusion pip install -r requirements.txt ``` --- ## ๐Ÿ› ๏ธ Quick Start ```python import torch from pipelines.sd3_teefusion_pipeline import TeEFusionSD3Pipeline pipe = TeEFusionSD3Pipeline.from_pretrained( "AIDC-AI/TeEFusion", torch_dtype=torch.bfloat16 ) pipe.to("cuda") images = pipe( prompt=["A serene mountain lake at sunset"], num_inference_steps=50, guidance_scale=5, seed=0 ) for i, img in enumerate(images): img.save(f"output_{i}.png") ``` --- ## ๐Ÿ“š Citation If you find TeEFusion helpful, please cite our ICCV 2025 paper: ```bibtex @inproceedings{fu2025teefusion, title={{TeEFusion}: Blending Text Embeddings to Distill Classifier-Free Guidance}, author={Fu, Minghao and Wang, Guo-Hua and Chen, Xiaohao and Chen, Qing-Guo and Xu, Zhao and Luo, Weihua and Zhang, Kaifu}, booktitle={the IEEE/CVF International Conference on Computer Vision (ICCV)}, year={2025} } ``` ## ๐Ÿ™ Acknowledgments The code is built upon [Diffusers](https://github.com/huggingface/diffusers) and [Transformers](https://github.com/huggingface/transformers). ## ๐Ÿ“„ License This project is licensed under the Attribution-NonCommercial 4.0 International License (SPDX-License-Identifier: CC-BY-NC-4.0). ## ๐Ÿšจ Disclaimer We used compliance checking algorithms during the training process, to ensure the compliance of the trained model to the best of our ability. Due to complex data and the diversity of language model usage scenarios, we cannot guarantee that the model is completely free of copyright issues or improper content. If you believe anything infringes on your rights or generates improper content, please contact us, and we will promptly address the matter.