Skip to main content
QUICK REVIEW

[논문 리뷰] StreamDiffusion: A Pipeline-level Solution for Real-time Interactive Generation

Akio Kodaira, Chenfeng Xu|arXiv (Cornell University)|2023. 12. 19.
Generative Adversarial Networks and Image Synthesis인용 수 6
한 줄 요약

StreamDiffusion는 디퓨전 모델을 사용한 실시간 상호작용형 이미지 생성을 위한 파이프라인 수준 최적화를 도입하여 단일 RTX 4090 GPU에서 최대 91.07 fps를 달성한다. 스트림 배치, 잔류 분류자 자유 가이던스(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.

연구 동기 및 목표

  • 메타버스, 라이브 스트리밍, 게임과 같은 실시간 상호작용 애플리케이션에서 기존 디퓨전 모델의 낮은 처리량과 높은 지연 문제를 해결하기 위해.
  • 순차적 노이즈 제거에서 발생하는 대기 및 상호작용 블로킹 문제를 제거하기 위해, 여러 입력에 대해 겹치는 방식으로 배치된 노이즈 제거를 가능하게 하기 위해.
  • 분류자 자유 가이던스(CFG)에서의 계산 중복을 줄이기 위해 반복적인 음성 조건을 단일 잔류 근사치로 대체하기 위해.
  • 지속적인 추론에서 GPU 전력 소비를 최소화하기 위해, 유사도가 높은 입력을 식별해 모델 추론을 건너뛰는 확률적 유사도 필터링을 적용하기 위해.
  • 이미지 품질이나 프롬프트 일치도를 희생시키지 않은 채 높은 성능과 에너지 효율성을 달성하기 위해.

제안 방법

  • 스트림 배치는 순차적 노이즈 제거를 대체하여 동일한 U-Net에서 여러 입력을 단계적으로 노이즈 제거하는 파이프라인 기반의 배치 노이즈 제거 과정을 구현한다.
  • 입력-출력 큐는 입력 소스와 U-Net 간의 비동기적 데이터 흐름을 관리하여 입력과 출력의 병렬 처리를 가능하게 한다.
  • 잔류 분류자 자유 가이던스(RCFG)는 가상의 잔류 노이즈를 사용해 첫 번째 노이즈 제거 단계에서만 음성 조건 벡터를 계산함으로써, 단계 간 반복적인 음성 노이즈 제거를 제거한다.
  • 확률적 유사도 필터링은 들어오는 입력을 이전에 처리된 프레임과 비교하며, 유사성이 높은 경우 모델 추론을 건너뛰어 GPU 활성화 빈도와 전력 소비를 감소시킨다.
  • 기존의 가속 도구(예: Tiny AutoEncoder 및 모델 가속 프레임워크)를 통합하여 처리량을 추가로 향상시킨다.
  • 이 시스템은 이미지-이미지 및 텍스트-이미지 생성 모두를 지원하며, sd-turbo 및 LCM-LoRA와 같은 모델을 사용해 소비자용 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프롬프트 일치도가 떨어지지 않도록 분류자 자유 가이던스의 계산 중복을 어떻게 줄일 수 있는가?
  • RQ3지속적인 디퓨전 추론에서 GPU 전력 소비를 얼마나 줄일 수 있으며, 이로 인해 프레임 레이트나 품질이 손상되지 않는가?
  • RQ4스트림 배치와 입력 큐잉 전략이 낮은 지연을 유지하면서도 지속적인 고처리량을 가능하게 하는가?
  • RQ5표준 CFG 대비 잔류 분류자 자유 가이던스(RCFG)는 프롬프트 준거도와 이미지 일관성 측면에서 어떻게 성능을 발휘하는가?

주요 결과

  • StreamDiffusion는 단일 RTX 4090 GPU에서 이미지-이미지 생성 시 최대 91.07 fps를 달성하며, Diffusers Autopipeline 대비 처리량에서 59.6배 향상된다.
  • 스트림 배치 전략만으로도 다양한 노이즈 제거 수준에서 순차적 노이즈 제거 대비 약 1.5배의 속도 향상을 기록한다.
  • 잔류 분류자 자유 가이던스(RCFG)는 기존 CFG 대비 최대 2.05배의 속도 향상을 제공하며, 음성 노이즈 제거 단계를 하나 또는 없애는 데 기여한다.
  • 확률적 유사도 필터링은 RTX 3060에서 최대 2.39배, RTX 4090에서 최대 1.99배의 GPU 전력 소비 감소를 이끌어내어 에너지 효율을 크게 향상시킨다.
  • 배치 크기가 12일 경우, sd-turbo 모델을 사용해 약 150장의 이미지를 매초 지속적으로 처리할 수 있어 확장성과 고처리량을 입증한다.
  • RCFG는 표준 CFG보다 더 강한 프롬프트 일치도를 제공하며, 특히 머리카락 색상 변경이나 객체 추가와 같은 속성 수정 시 유리하다. 조정 가능한 하이퍼파라미터는 대trast 불안정성을 완화하는 데 기여한다.
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가 만들고, 인간 에디터가 검토했습니다.