mirror of
https://github.com/justUmen/Bjornulf_custom_nodes.git
synced 2026-03-21 20:52:11 -03:00
first commit
This commit is contained in:
23
video_pingpong.py
Normal file
23
video_pingpong.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import torch
|
||||
|
||||
class VideoPingPong:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"images": ("IMAGE",),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
FUNCTION = "pingpong_images"
|
||||
CATEGORY = "Bjornulf"
|
||||
|
||||
def pingpong_images(self, images):
|
||||
if isinstance(images, torch.Tensor):
|
||||
reversed_images = torch.flip(images, [0])
|
||||
combined_images = torch.cat((images, reversed_images[1:]), dim=0)
|
||||
else:
|
||||
reversed_images = images[::-1]
|
||||
combined_images = images + reversed_images[1:]
|
||||
return (combined_images,)
|
||||
Reference in New Issue
Block a user