---
license: apache-2.0
language:
- en
library_name: diffusers
pipeline_tag: text-to-image
---
[//]: # (
CSGO: Content-Style Composition in Text-to-Image Generation
)
[//]: # ()
[//]: # ([**Peng Xing**](https://github.com/xingp-ng)
12* · [**Haofan Wang**](https://haofanwang.github.io/)
1* · [**Yanpeng Sun**](https://scholar.google.com.hk/citations?user=a3FI8c4AAAAJ&hl=zh-CN&oi=ao/)
2 · [**Qixun Wang**](https://github.com/wangqixun)
1 · [**Xu Bai**](https://huggingface.co/baymin0220)
1 · [**Hao Ai**](https://github.com/aihao2000)
13 · [**Renyuan Huang**](https://github.com/DannHuang)
14 · [**Zechao Li**](https://zechao-li.github.io/)
2✉)
[//]: # ()
[//]: # (
1InstantX Team ·
2Nanjing University of Science and Technology ·
3Beihang University ·
4Peking University)
[//]: # (
*equal contributions,
✉corresponding authors)
![](https://img.shields.io/badge/Technique-Report-red)
[![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-App-red)](https://huggingface.co/spaces/xingpng/CSGO/)
[![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Models-blue)](https://huggingface.co/spaces/InstantX/CSGO)
[//]: # (## Updates 🔥)
[//]: # ()
[//]: # ([//]: # (- **`2024/07/19`**: ✨ We support 🎞️ portrait video editing (aka v2v)! More to see [here](assets/docs/changelog/2024-07-19.md).))
[//]: # ()
[//]: # ([//]: # (- **`2024/07/17`**: 🍎 We support macOS with Apple Silicon, modified from [jeethu](https://github.com/jeethu)'s PR [#143](https://github.com/KwaiVGI/LivePortrait/pull/143).))
[//]: # ()
[//]: # ([//]: # (- **`2024/07/10`**: 💪 We support audio and video concatenating, driving video auto-cropping, and template making to protect privacy. More to see [here](assets/docs/changelog/2024-07-10.md).))
[//]: # ()
[//]: # ([//]: # (- **`2024/07/09`**: 🤗 We released the [HuggingFace Space](https://huggingface.co/spaces/KwaiVGI/liveportrait), thanks to the HF team and [Gradio](https://github.com/gradio-app/gradio)!))
[//]: # ([//]: # (Continuous updates, stay tuned!))
[//]: # (- **`2024/08/30`**: 😊 We released the initial version of the inference code.)
[//]: # (- **`2024/08/30`**: 😊 We released the technical report on [arXiv](https://arxiv.org/pdf/2408.16766))
[//]: # (- **`2024/07/15`**: 🔥 We released the [homepage](https://csgo-gen.github.io).)
[//]: # ()
[//]: # (## Plan 💪)
[//]: # (- [x] technical report)
[//]: # (- [x] inference code)
[//]: # (- [ ] pre-trained weight)
[//]: # (- [ ] IMAGStyle dataset)
[//]: # (- [ ] training code)
## Introduction 📖
This repo, named **CSGO**, contains the official PyTorch implementation of our paper [CSGO: Content-Style Composition in Text-to-Image Generation](https://arxiv.org/pdf/).
We are actively updating and improving this repository. If you find any bugs or have suggestions, welcome to raise issues or submit pull requests (PR) 💖.
## Detail ✨
We currently release two model weights.
| Mode | content token | style token | Other |
|:----------------:|:-----------:|:-----------:|:---------------------------------:|
| csgo.bin |4|16| - |
| csgo_4_32.bin |4|32| Deepspeed zero2 |
| csgo_4_32_v2.bin |4|32| Deepspeed zero2+more(coming soon) |
## Pipeline 💻