The VFS (Video Frame Stylizer) Extension is a transformative plugin for the Stable Diffusion WebUI that allows users to convert videos into stylized animations. This tool processes videos by breaking them down into frames, creating masks, extracting keyframes, and supporting seamless Img2Img workflows.
- Frame Extraction: Supports multiple video formats like .mp4, .mov, .avi, and organizes extracted frames numerically in a project directory.
- Mask Creation: Uses the transparent-background library to automatically generate precise masks for video frames with options for Fast and JIT mode.
- Keyframe Extraction: Efficient algorithms identify significant frames, with options to include the first and last frames of a video.
- File Management: Includes functionalities to rename Img2Img output files and generate paths for streamlined batch processing.
- Project Structure: Outputs are organized into intuitive directories (video_frames, video_masks, keyframes, etc.), making it easy to manage large projects.
- User Interface: Features a clean, tabbed interface built with Gradio, providing an intuitive setup for handling projects.
```bash git clone https://github.com/babydjac/VFS-Extension.git ``` Place the cloned repository into your Stable Diffusion WebUI extensions folder.
```bash pip install -r requirements.txt ``` Restart your Stable Diffusion WebUI to apply changes.
- Upload a video file in the "Frame Xtract" tab.
- Enter a Project Title to organize output into a dedicated folder.
- Click "Extract Frames" and preview the initial frames in the gallery.
- Navigate to the "Mask Xtract" tab.
- Re-enter the Project Title used in Frame Extraction.
- Adjust settings (Fast Mode or JIT Mode) if needed and generate masks.
- Access the "Keyframe Xtract" tab.
- Input the Project Title and decide on frame inclusion at the video's boundaries.
- Extract and organize keyframes into folders.
- Use the "Img2Img Path" tab to generate paths for batch processing.
- In the "Rename Files" tab, input the Project Title to update filenames in the img2img_output folder for better organization.
- Masking Parameters: Customize masking parameters by adjusting the create_masks function in main_ui.py.
- Keyframe Splitting: Manage the distribution of keyframes into subfolders based on the max_keyframes_per_folder setting.
- Rename Logic: Modify the rename_files function to apply custom file renaming logic.
After using VFS Extension, your project folder will organize outputs as follows:
``` <Project_Title>/ ├── video_frames/ │ ├── 00001.png │ ├── 00002.png │ └── ... ├── video_masks/ │ ├── 00001.png │ ├── 00002.png │ └── ... ├── keyframes/ │ ├── 00001.png │ ├── 00008.png │ └── ... ├── img2img_output/ │ ├── stylized_01.png │ ├── stylized_02.png │ └── ... ```
- Extension Not Visible in WebUI: Check the repository placement in the extensions folder and restart the WebUI.
- Error in Masking: Confirm installation of transparent-background==1.3.2 and GPU support.
- Keyframes Not Detected: Ensure frames are extracted prior to keyframe extraction.
Contributions are welcome! To contribute:
- Fork the repository on GitHub.
- Create a new branch for your feature or fix.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the MIT License - see the LICENSE file for details.