Initial commit.
Added Simple Frame Interpolation node.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
__pycache__
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 ComplexRobot
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,21 @@
|
||||
# ComfyUI Simple VFI
|
||||
|
||||
Nodes for basic frame interpolation without the use of AI.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Nodes](#nodes)
|
||||
* [Simple Frame Interpolation (VFI)](#simple-frame-interpolation-vfi)
|
||||
|
||||
## Nodes
|
||||
|
||||
### Simple Frame Interpolation (VFI)
|
||||
|
||||
A node for doing very simple frame interpolation operations.
|
||||
Uses basic operations (bicubic, lanczos, etc.) to blend the frames together.
|
||||
|
||||
| | |
|
||||
|--------------|--------------------------------------------------------------------------|
|
||||
| images | Image frames to interpolate. |
|
||||
| scale_method | Method used to interpolate the frames. |
|
||||
| multiplier | Value to multiply the number of frames by. Not limited to whole numbers. |
|
||||
@@ -0,0 +1,3 @@
|
||||
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
|
||||
|
||||
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
|
||||
@@ -0,0 +1,40 @@
|
||||
import torch
|
||||
|
||||
from nodes import ImageScale
|
||||
|
||||
class Simple_Frame_Interpolation:
|
||||
scale_methods = ["nearest", "nearest-exact", "bilinear", "area", "bicubic", "lanczos", "bislerp"]
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
return {"required": {
|
||||
"images": ("IMAGE", ),
|
||||
"scale_method": (s.scale_methods, {"default": "bislerp"}),
|
||||
"multiplier": ("FLOAT", {"default": 0.5, "min": 0.01, "max": 20.0, "step": 0.01}),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
RETURN_NAMES =("images",)
|
||||
FUNCTION = "process"
|
||||
|
||||
CATEGORY = "Simple-VFI"
|
||||
|
||||
@torch.no_grad()
|
||||
def process(self, images, scale_method, multiplier):
|
||||
B, H, W, C = images.shape
|
||||
new_frame_count = max(round(B * multiplier), 1)
|
||||
|
||||
images = images.flatten(0, 2).unflatten(0, (1, B, H * W))
|
||||
images, = ImageScale.upscale(self, images, scale_method, H * W, new_frame_count, crop="disabled")
|
||||
images = images.flatten(0, 2).unflatten(0, (new_frame_count, H, W))
|
||||
|
||||
return (images,)
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"Simple_Frame_Interpolation": Simple_Frame_Interpolation,
|
||||
|
||||
}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"Simple_Frame_Interpolation": "Simple Frame Interpolation (VFI)",
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
[project]
|
||||
name = "ComfyUI-Simple-VFI"
|
||||
description = "Nodes for simple frame interpolation without the use of AI. Uses standard image operations to blend frames together."
|
||||
version = "1.0.0"
|
||||
license = "LICENSE"
|
||||
dependencies = ["open-clip-torch"]
|
||||
|
||||
[project.urls]
|
||||
Repository = "https://github.com/ComplexRobot/ComfyUI-Simple-VFI"
|
||||
# Used by Comfy Registry https://comfyregistry.org
|
||||
|
||||
[tool.comfy]
|
||||
PublisherId = "ComplexRobot"
|
||||
DisplayName = "ComfyUI-Simple-VFI"
|
||||
Icon = ""
|
||||
Reference in New Issue
Block a user