huggingface / huggingface/diffusers
Add VideoInpaintPipeline for temporally-consistent diffusion-based video inpainting
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 34.5k
- フォーク
- 7.3k
- 平均マージ
- 3日 3時間
- マージ済み PR(30日)
- 91
説明
Feature request
Introduce a new pipeline to extend existing image inpainting capabilities (StableDiffusionInpaintPipeline) to videos. The goal is to provide a native, GPU-optimized API within Diffusers that performs temporally coherent video inpainting instead of independent per-frame processing.
Motivation
Current video inpainting approaches in the community simply loop over frames and call the image inpainting pipeline repeatedly.
This leads to:
- Temporal flicker and inconsistent textures between frames.
- Poor GPU utilization and high memory overhead.
- Lack of tools to maintain motion coherence or reuse diffusion latents across time.
- A built-in VideoInpaintPipeline would make it possible to remove objects, restore scenes, or creatively edit videos using diffusion models while keeping motion and lighting consistent across frames.
Your contribution
I plan to:
Implement VideoInpaintPipeline as a subclass of DiffusionPipeline, leveraging StableDiffusionInpaintPipeline under the hood.
Add temporal consistency mechanisms, such as latent reuse between frames and optional optical-flow–guided warping (RAFT / GMFlow).
Optimize performance through batched FP16 inference, scheduler noise reuse, and optional torch.compile acceleration.
Provide a clean user API compatible with existing pipelines:
from diffusers import VideoInpaintPipeline
pipe = VideoInpaintPipeline.from_pretrained(
"runwayml/stable-diffusion-inpainting",
use_optical_flow=True,
compile=True,
)
result = pipe(
video_path="input.mp4",
mask_path="mask.mp4",
prompt="replace background with a snowy mountain",
num_inference_steps=10,
)
result.video.save("output.mp4")
Contribute documentation and tests demonstrating temporal coherence, performance benchmarks, and example notebooks for real-world use.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、リクエストで提案されたベースおよび基盤となるパイプラインとして示されている DiffusionPipeline と StableDiffusionInpaintPipeline を読みます。実装前に、時間的一貫性、オプティカルフロー、バッチ処理、コンパイルの要件を明確にします。Done には、要求された動画およびマスク API、時間的整合性のテスト、パフォーマンスベンチマーク、ドキュメント、サンプルノートブックを含める必要があります。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python, pytorch
- 領域
- computer-vision, machine-learning, performance
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100