This is a model-free algorithm that can make your video smooth. You can remove the flicker in your video, or render a fluent video using a series of keyframes.
https://github.com/Artiprocher/sd-webui-fastblend.git to "URL for extension's git repository".FastBlend tab in the webui.Install the packages in your Python environment:
pip install gradio numpy imageio imageio[ffmpeg] opencv-python-headless tqdm cupy-cuda12x
If your CUDA version is not v11.2 ~ 11.8, please read this document and install the corressponding version of cupy.
Then run the following command to launch the independent webui:
python independent_webui.py
Install the packages as we described above.
from FastBlend.api import smooth_video, interpolate_video
# Blend
smooth_video(
video_guide = "guide_video.mp4",
video_guide_folder = None,
video_style = "style_video.mp4",
video_style_folder = None,
mode = "Fast",
window_size = 15,
batch_size = 16,
tracking_window_size = 0,
output_path = "output_folder",
fps = None,
minimum_patch_size = 5,
num_iter = 5,
guide_weight = 10.0,
initialize = "identity"
)
# Interpolate
interpolate_video(
frames_path = "frames_folder",
keyframes_path = "keyframes_folder",
output_path = "output_folder",
fps = None,
batch_size = 16,
tracking_window_size = 1,
minimum_patch_size = 15,
num_iter = 5,
guide_weight = 10.0,
initialize = "identity"
)
We found an interesting project called CoDeF, which uses only one keyframe to render a video. We collected some videos from their project page and compared FastBlend with CoDeF. For each video, we select one keyframe from the rendered video and use this keyframe to rerender the video in interpolation mode. The parameters are
As we can see, FastBlend is competitive with CoDeF. What's more, FastBlend is very efficiency. We only need one minute to render a video clip!
| Mode | Time | Memory | Quality | Frame by frame output | Description |
|---|---|---|---|---|---|
| Fast | ■ | ■■■ | ■■ | No | Blend the frames using a tree-like data structure, which requires much RAM but is fast. |
| Balanced | ■■ | ■ | ■■ | Yes | Blend the frames naively. |
| Accurate | ■■■ | ■ | ■■■ | Yes | Blend the frames and align them together for higher video quality. When [batch size] >= [sliding window size] * 2 + 1, the performance is the best. |
@article{duan2023fastblend,
title={FastBlend: a Powerful Model-Free Toolkit Making Video Stylization Easier},
author={Duan, Zhongjie and Wang, Chengyu and Chen, Cen and Qian, Weining and Huang, Jun and Jin, Mingyi},
journal={arXiv preprint arXiv:2311.09265},
year={2023}
}
Python
100.0%
This is a model-free algorithm that can make your video smooth. You can remove the flicker in your video, or render a fluent video using a series of keyframes.
https://github.com/Artiprocher/sd-webui-fastblend.git to "URL for extension's git repository".FastBlend tab in the webui.Install the packages in your Python environment:
pip install gradio numpy imageio imageio[ffmpeg] opencv-python-headless tqdm cupy-cuda12x
If your CUDA version is not v11.2 ~ 11.8, please read this document and install the corressponding version of cupy.
Then run the following command to launch the independent webui:
python independent_webui.py
Install the packages as we described above.
from FastBlend.api import smooth_video, interpolate_video
# Blend
smooth_video(
video_guide = "guide_video.mp4",
video_guide_folder = None,
video_style = "style_video.mp4",
video_style_folder = None,
mode = "Fast",
window_size = 15,
batch_size = 16,
tracking_window_size = 0,
output_path = "output_folder",
fps = None,
minimum_patch_size = 5,
num_iter = 5,
guide_weight = 10.0,
initialize = "identity"
)
# Interpolate
interpolate_video(
frames_path = "frames_folder",
keyframes_path = "keyframes_folder",
output_path = "output_folder",
fps = None,
batch_size = 16,
tracking_window_size = 1,
minimum_patch_size = 15,
num_iter = 5,
guide_weight = 10.0,
initialize = "identity"
)
We found an interesting project called CoDeF, which uses only one keyframe to render a video. We collected some videos from their project page and compared FastBlend with CoDeF. For each video, we select one keyframe from the rendered video and use this keyframe to rerender the video in interpolation mode. The parameters are
As we can see, FastBlend is competitive with CoDeF. What's more, FastBlend is very efficiency. We only need one minute to render a video clip!
| Mode | Time | Memory | Quality | Frame by frame output | Description |
|---|---|---|---|---|---|
| Fast | ■ | ■■■ | ■■ | No | Blend the frames using a tree-like data structure, which requires much RAM but is fast. |
| Balanced | ■■ | ■ | ■■ | Yes | Blend the frames naively. |
| Accurate | ■■■ | ■ | ■■■ | Yes | Blend the frames and align them together for higher video quality. When [batch size] >= [sliding window size] * 2 + 1, the performance is the best. |
@article{duan2023fastblend,
title={FastBlend: a Powerful Model-Free Toolkit Making Video Stylization Easier},
author={Duan, Zhongjie and Wang, Chengyu and Chen, Cen and Qian, Weining and Huang, Jun and Jin, Mingyi},
journal={arXiv preprint arXiv:2311.09265},
year={2023}
}
Python
100.0%