【Video2Video】「FRESCO」というモデルを使ってみる

はじめに

過去に Video2Video をいろいろ試して、最も良い結果が得られたのが「Rerender A Video」でした。

「Rerender A Video」の開発者が新たに「FRESCO」というのを公開してくれました。

これは期待できるということでさっそく試してみました。

「Rerender A Video」についての過去記事はこちらです。
「Rerender A Video」の使い方
【Video2Video】「Rerender A Video」がDiffusersから使えるようになっていたのでさっそく使ってみました。 - パソコン関連もろもろ
「Rerender A Video」の結果
「Rerender A Video」をDiffusersから使った結果(Video2Video)

PC環境

Windowsで実行しようとしたら「Ebsynth」のインストールで躓きました。

そのためWSL2を使いました。

Ubuntu 22.04 on WSL2
CUDA 11.8
Python 3.10
FFmpeg (sudo apt install ffmpegでインストール可能)

Python環境構築

最終的に実行可能になった環境からrequirements.txtを作成したので、以下の1行で環境構築は完了です。

pip install -r https://raw.githubusercontent.com/dai-ichiro/myEnvironments/main/FRESCO/requirements_cu118.txt

「imageio」のバージョンが重要そうです。

実行まで

Gradioから実行できるため、事前準備がすべてです。

リポジトリのクローン

git clone https://github.com/williamyang1991/FRESCO.git
cd FRESCO

「install.py」の実行

実行する前に2点修正が必要です。

「insatll.py」の修正

コメントアウトを削除します。
修正前

#build_ebsynth()

修正後

build_ebsynth()

「src/ebsynth/deps/ebsynth/build-linux-cpu+cuda.sh」の修正

WSL2ではnvccのパスが通っていないので以下のような修正が必要になります。
修正前

nvcc -arch compute_50 src/ebsynth.cpp src/ebsynth_cpu.cpp src/ebsynth_cuda.cu -I"include" -DNDEBUG -D__CORRECT_ISO_CPP11_MATH_H_PROTO -O6 -std=c++11 -w -Xcompiler -fopenmp -o bin/ebsynth

修正後

/usr/local/cuda/bin/nvcc -arch compute_50 src/ebsynth.cpp src/ebsynth_cpu.cpp src/ebsynth_cuda.cu -I"include" -DNDEBUG -D__CORRECT_ISO_CPP11_MATH_H_PROTO -O6 -std=c++11 -w -Xcompiler -fopenmp -o bin/ebsynth

修正が終わったら「bin」フォルダをあらかじめ作成して「install.py」を実行します。

mkdir ./src/ebsynth/deps/ebsynth/bin
python install.py

Gradioアプリの実行

「ebsynth」のアクセス権限を変更して実行します。

sudo chmod 777 ./src/ebsynth/deps/ebsynth/bin/ebsynth
python webUI.py

結果

model: stablediffusionapi/rev-animated
controlnet: HED
prompt: anime style, high quality, best quality, man with black hair, wearing sunglasses, black sweater, dancing


動画はGoogle Bloggerに載せています。
support-touchsp.blogspot.com


設定の問題なのか「Rerender A Video」を超える動画は今のところ作成できていません。



このエントリーをはてなブックマークに追加