Skip to main content
QUICK REVIEW

[論文レビュー] StreamDiffusion: A Pipeline-level Solution for Real-time Interactive Generation

Akio Kodaira, Chenfeng Xu|arXiv (Cornell University)|Dec 19, 2023
Generative Adversarial Networks and Image Synthesis被引用数 6
ひとこと要約

StreamDiffusion は、1枚の RTX 4090 GPU で最大 91.07 fps を達成する、リアルタイムインタラクティブな画像生成のためのパイプラインレベル最適化を導入した。ストリームバッチ処理、残差分類子フリー Guided(RCFG)、確率的類似性フィルタリングを活用することで、GPU 力消費を最大 2.39 倍低減し、従来のパイプライン比でスループットを 59.6 倍向上させた。

ABSTRACT

We introduce StreamDiffusion, a real-time diffusion pipeline designed for interactive image generation. Existing diffusion models are adept at creating images from text or image prompts, yet they often fall short in real-time interaction. This limitation becomes particularly evident in scenarios involving continuous input, such as Metaverse, live video streaming, and broadcasting, where high throughput is imperative. To address this, we present a novel approach that transforms the original sequential denoising into the batching denoising process. Stream Batch eliminates the conventional wait-and-interact approach and enables fluid and high throughput streams. To handle the frequency disparity between data input and model throughput, we design a novel input-output queue for parallelizing the streaming process. Moreover, the existing diffusion pipeline uses classifier-free guidance(CFG), which requires additional U-Net computation. To mitigate the redundant computations, we propose a novel residual classifier-free guidance (RCFG) algorithm that reduces the number of negative conditional denoising steps to only one or even zero. Besides, we introduce a stochastic similarity filter(SSF) to optimize power consumption. Our Stream Batch achieves around 1.5x speedup compared to the sequential denoising method at different denoising levels. The proposed RCFG leads to speeds up to 2.05x higher than the conventional CFG. Combining the proposed strategies and existing mature acceleration tools makes the image-to-image generation achieve up-to 91.07fps on one RTX4090, improving the throughputs of AutoPipline developed by Diffusers over 59.56x. Furthermore, our proposed StreamDiffusion also significantly reduces the energy consumption by 2.39x on one RTX3060 and 1.99x on one RTX4090, respectively.

研究の動機と目的

  • メタバース、ライブストリーミング、ゲームなどのリアルタイムインタラクティブな応用における、従来の拡散モデルの低スループットおよび高レイテンシーを解消すること。
  • 逐次的なノイズ除去における待機と操作のボトル neck を解消し、複数の入力に対して重ね合わせてバッチ化されたノイズ除去を可能にすること。
  • 分類子フリー Guided(CFG)における計算の重複を低減するため、繰り返し実行される負の条件付けを1つの残差近似に置き換えること。
  • 連続的な推論における GPU 力消費を最小限に抑えるために、冗長なモデル推論をスキップする確率的類似性フィルタリングを適用すること。
  • 画像品質やプロンプト整合性を損なわずに、高いパフォーマンスとエネルギー効率を達成すること。

提案手法

  • ストリームバッチ処理は、複数の入力を同じ U-Net を用いて段階的にステップをずらしてノイズ除去するパイプライン型のバッチ化されたノイズ除去プロセスに逐次的ノイズ除去を置き換える。
  • 入力出力キューは、入力ソースと U-Net 間の非同期データフローを管理し、入力と出力の並列処理を可能にする。
  • 残差分類子フリー Guided(RCFG)は、最初のノイズ除去ステップでのみ仮想の残差ノイズを用いて負の条件付けベクトルを一度だけ計算し、ステップ間での繰り返しの負のノイズ除去を排除する。
  • 確率的類似性フィルタリングは、新しい入力を最後に処理されたフレームと比較する。類似している場合、モデルは推論をスキップし、GPU のアクティベーション頻度と力消費を低減する。
  • パイプラインは、Tiny AutoEncoder やモデル加速フレームワークなどの既存の加速ツールを統合し、さらにスループットを向上させる。
  • システムは画像から画像、テキストから画像の両方の生成をサポートし、sd-turbo や LCM-LoRA などのモデルを用いて、コンsumer GPU でも高いパフォーマンスを発揮する。
Figure 2 : The concept of Stream Batch. In our approach, instead of waiting for a single image to be fully denoised before processing the next input image, we accept the next input image after each denoising step. This creates a denoising batch where the denoising steps are staggered for each image.
Figure 2 : The concept of Stream Batch. In our approach, instead of waiting for a single image to be fully denoised before processing the next input image, we accept the next input image after each denoising step. This creates a denoising batch where the denoising steps are staggered for each image.

実験結果

リサーチクエスチョン

  • RQ1パイプラインレベルの最適化により、インタラクティブな応用のためのリアルタイムで高スループットな拡散推論を達成できるか?
  • RQ2プロンプト整合性を損なわず、分類子フリー Guided の計算の重複をどの程度低減できるか?
  • RQ3連続的な拡散推論において、フレームレートや品質を損なわず、GPU 力消費をどの程度低減できるか?
  • RQ4ストリームバッチ処理と入力キューイングにより、低レイテンシーを維持しながら持続的な高スループットを達成できるか?
  • RQ5残差分類子フリー Guided は、標準的な CFG と比較して、プロンプト適合性および画像の一貫性においてどの程度優れているか?

主な発見

  • StreamDiffusion は、1枚の RTX 4090 GPU で画像から画像の生成において最大 91.07 fps を達成し、Diffusers Autopipeline よりもスループットが 59.6 倍向上した。
  • ストリームバッチ処理戦略は、さまざまなノイズ除去レベルにおいて、逐次的ノイズ除去と比較して約 1.5 倍の高速化を実現した。
  • 残差分類子フリー Guided(RCFG)は、従来の CFG と比較して最大 2.05 倍の高速化を達成し、負のノイズ除去ステップを1回または0回に削減した。
  • 確率的類似性フィルタリングにより、RTX 3060 では GPU 力消費が 2.39 倍、RTX 4090 では 1.99 倍低減され、エネルギー効率が顕著に向上した。
  • バッチサイズ 12 の場合、sd-turbo モデルを用いて約 150 枚/秒を継続的に処理でき、スケーラビリティと高いスループットを示した。
  • RCFG は、髪の色の変更やオブジェクトの追加など、属性の変更において、標準的な CFG よりも強いプロンプト整合性を実現した。調整可能なハイパーパramータによりコントラストの不安定性も緩和された。
Figure 3 : Virtual residual noise vectors: The orange vectors depict the virtual residual noise that starts from the PF ODE trajectory and points to the original input latent $x_{0}$
Figure 3 : Virtual residual noise vectors: The orange vectors depict the virtual residual noise that starts from the PF ODE trajectory and points to the original input latent $x_{0}$

より良い研究を、今すぐ始めましょう

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。