Instructions to use nickchiu/Refocusing-Any-Video with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use nickchiu/Refocusing-Any-Video with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-video-diffusion-img2vid", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("nickchiu/Refocusing-Any-Video") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
File size: 3,007 Bytes
436a307 c10a006 436a307 c10a006 436a307 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 c10a006 3a7e4d1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | ---
library_name: diffusers
base_model: stabilityai/stable-video-diffusion-img2vid
tags:
- video-restoration
- video-refocusing
- video-diffusion
- lora
license: other
license_name: stable-video-diffusion-community
license_link: https://huggingface.co/nickchiu/Refocusing-Any-Video/blob/main/LICENSE-SVD.txt
---
# Refocusing Any Video: Temporally Consistent Video Refocusing for Dynamic Focal Planes
**SIGGRAPH Asia 2026**
Chee Kim Gan, [Pin-Yen Chiu](https://itsnickchiu.github.io/), I-Sheng Fang, Jun-Cheng Chen
Research Center for Information Technology Innovation, Academia Sinica
Inference checkpoints for Refocusing Any Video (RAV). **Video Defocus Deblurring (VDD)** recovers an all-in-focus video; **Video Bokeh Rendering (VBR)** refocuses it using depth and a chosen focal plane. Optional identity adapters guide face restoration.
[Source code and inference instructions](https://github.com/aiiu-lab/Refocusing-Any-Video)
## Release status
- [x] Inference code and pretrained checkpoints
- [ ] Training code — being prepared for a future release
## Checkpoints
| Folder | Contents |
| --- | --- |
| `vdd_weights/checkpoint-90000/` | VDD LoRA weights |
| `vbr_weights/checkpoint-100000/` | VBR LoRA weights and required input convolution |
| `identity_adapter/` | Identity Adapter |
| `identity_adapter_track4gen/` | Identity Adapter with Track4Gen Refiner |
| `facenet/` | MTCNN face detector weights |
## Download and inference
After setting up the [code environment](https://github.com/aiiu-lab/Refocusing-Any-Video#environment), run from the cloned code repository root:
```bash
python tools/checkpoints/transfer_checkpoints.py download \
--repo-id nickchiu/Refocusing-Any-Video --local-dir ./checkpoints
```
Download SVD, Video Depth Anything, and the auxiliary face models separately using the [checkpoint guide](https://github.com/aiiu-lab/Refocusing-Any-Video/blob/main/checkpoints/README.md), then follow the [inference example](https://github.com/aiiu-lab/Refocusing-Any-Video#inference). These adapters require the code and SVD base model. Generated details may differ from the original scene.
## Models and licenses
RAV uses Stable Video Diffusion (SVD), Video Depth Anything, FaRL, ArcFace, OpenAI CLIP, and facenet-pytorch.
SVD and applicable derivatives are subject to the [SVD license](LICENSE-SVD.txt) and [NOTICE](NOTICE.txt). **Powered by Stability AI** (attribution required by the SVD license). MTCNN retains its [MIT license](facenet/LICENSE.md); other models follow their providers' terms. An additional project-specific license has not yet been specified.
## Citation
If you use this work, please cite:
```bibtex
@misc{gan2026refocusinganyvideo,
title = {Refocusing Any Video: Temporally Consistent Video Refocusing for Dynamic Focal Planes},
author = {Gan, Chee Kim and Chiu, Pin-Yen and Fang, I-Sheng and Chen, Jun-Cheng},
year = {2026},
note = {SIGGRAPH Asia 2026},
url = {https://github.com/aiiu-lab/Refocusing-Any-Video}
}
```
|