🚀 AMD Nitro Diffusion
AMD Nitro Diffusionは、AMD Instinct™ GPU上の人気の拡散モデルから蒸留された、効率的なテキストから画像への生成モデルのシリーズです。これらのモデルは、画像生成の分野において高速かつ高精度な性能を提供します。
🚀 クイックスタート
from diffusers import DDPMScheduler, DiffusionPipeline
import torch
scheduler = DDPMScheduler.from_pretrained("stabilityai/stable-diffusion-2-1-base", subfolder="scheduler")
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1-base", scheduler=scheduler)
ckpt_path = '<path to distilled checkpoint>'
unet_state_dict = torch.load(ckpt_path)
pipe.unet.load_state_dict(unet_state_dict)
pipe = pipe.to("cuda")
image = pipe(prompt='a photo of a cat',
num_inference_steps=1,
guidance_scale=0,
timesteps=[999]).images[0]
詳細なトレーニングと評価については、GitHubリポジトリをご覧ください。
✨ 主な機能
AMD Nitro Diffusionのリリースには以下のモデルが含まれています:
⚡️ オープンソースコード!これらのモデルは、人気のStable Diffusion 3 Turboモデルを構築するために使用されたLatent Adversarial Diffusion Distillationの再実装に基づいています。元の著者がトレーニングコードを提供していなかったため、我々は再実装を公開し、この分野のさらなる研究を支援します。
📚 ドキュメント
詳細情報
- モデルアーキテクチャ:Stable Diffusion 2.1 NitroはStable Diffusion 2.1と同じアーキテクチャを持ち、diffusersパイプラインと互換性があります。
- 推論ステップ:このモデルは1ステップで推論を実行するように蒸留されています。ただし、トレーニングコードは2、4、または8ステップのモデルの蒸留もサポートしています。
- ハードウェア:Stable Diffusion 2.1 Nitroの蒸留には、4つのAMD Instinct™ MI250 GPUからなる単一ノードを使用しています。
- データセット:DiffusionDBからの100万個のプロンプトを使用し、ベースのStable Diffusion 2.1 Nitroモデルから対応する画像を生成しています。
- トレーニングコスト:蒸留プロセスは、単一ノードで2日以内に合理的な結果を達成します。
結果
Stable Diffusion 2.1ベースモデルと比較して、FLOPsが95.9%削減され、CLIPスコアは2.5%低下、FIDは2.2%上昇しています。
モデル |
FID ↓ |
CLIP ↑ |
FLOPs |
AMD Instinct MI250でのレイテンシ (秒) |
Stable Diffusion 2.1 base, 50 steps (cfg=7.5) |
25.47 |
0.3286 |
83.04 |
4.94 |
Stable Diffusion 2.1 Nitro, 1 step |
26.04 |
0.3204 |
3.36 |
0.18 |
📄 ライセンス
Copyright (c) 2018 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
