🚀 CogView3-Plus-3B
CogView3-Plus-3Bは、テキストから画像生成を行うモデルで、512pxから2048pxの画像生成をサポートしています。
📄 中国語で読む |
🤗 Hugging Face Space |
🌐 Github |
📜 arxiv
📍 青岩 と APIプラットフォーム を訪れて、大規模な商用ビデオ生成モデルを体験してください。
🚀 クイックスタート
まず、diffusers
ライブラリをソースからインストールする必要があります。
pip install git+https://github.com/huggingface/diffusers.git
次に、以下のコードを実行します。
基本的な使用法
from diffusers import CogView3PlusPipeline
import torch
pipe = CogView3PlusPipeline.from_pretrained("THUDM/CogView3-Plus-3B", torch_dtype=torch.float16).to("cuda")
pipe.enable_model_cpu_offload()
pipe.vae.enable_slicing()
pipe.vae.enable_tiling()
prompt = "A vibrant cherry red sports car sits proudly under the gleaming sun, its polished exterior smooth and flawless, casting a mirror-like reflection. The car features a low, aerodynamic body, angular headlights that gaze forward like predatory eyes, and a set of black, high-gloss racing rims that contrast starkly with the red. A subtle hint of chrome embellishes the grille and exhaust, while the tinted windows suggest a luxurious and private interior. The scene conveys a sense of speed and elegance, the car appearing as if it's about to burst into a sprint along a coastal road, with the ocean's azure waves crashing in the background."
image = pipe(
prompt=prompt,
guidance_scale=7.0,
num_images_per_prompt=1,
num_inference_steps=50,
width=1024,
height=1024,
).images[0]
image.save("cogview3.png")
詳細な内容や元のSATウェイトをダウンロードするには、GitHub を訪問してください。
✨ 主な機能
このモデルはCogView3のDiTバージョンで、テキストから画像生成を行うモデルで、512pxから2048pxの画像生成をサポートしています。
- 解像度:幅と高さは512pxから2048pxの範囲で、32で割り切れる必要があります。
- 推論速度:1ステップあたり1秒(A100でテスト)
- 精度:BF16 / FP32(FP16はオーバーフローにより黒い画像になるためサポートされていません)
📦 インストール
まず、diffusers
ライブラリをソースからインストールする必要があります。
pip install git+https://github.com/huggingface/diffusers.git
📚 ドキュメント
メモリ消費量
A100デバイスでいくつかの一般的な解像度でメモリ消費量をテストしました。batchsize=1, BF16
の結果は以下の表の通りです。
解像度 |
enable_model_cpu_offload OFF |
enable_model_cpu_offload ON |
512 * 512 |
19GB |
11GB |
720 * 480 |
20GB |
11GB |
1024 * 1024 |
23GB |
11GB |
1280 * 720 |
24GB |
11GB |
2048 * 2048 |
25GB |
11GB |
📄 ライセンス
このモデルは Apache 2.0 License の下で公開されています。
🔖 引用
🌟 この研究が役に立った場合は、論文を引用してスターをつけてください。
@article{zheng2024cogview3,
title={Cogview3: Finer and faster text-to-image generation via relay diffusion},
author={Zheng, Wendi and Teng, Jiayan and Yang, Zhuoyi and Wang, Weihan and Chen, Jidong and Gu, Xiaotao and Dong, Yuxiao and Ding, Ming and Tang, Jie},
journal={arXiv preprint arXiv:2403.05121},
year={2024}
}