diff --git a/HelperNodes.py b/HelperNodes.py new file mode 100644 index 0000000..cc4f803 --- /dev/null +++ b/HelperNodes.py @@ -0,0 +1,24 @@ + + +class CalculateLatentInterpFrameNumber: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "current_frame": ("INT", {"default": 0, "min": 0}), + "max_frames": ("INT", {"default": 18, "min": 0}), + "batch_size": ("INT", {"default": 4, "min": 0}), + } + } + RETURN_TYPES = ("INT", "INT" ,"INT" ,"INT", ) + FUNCTION = "assignFrameNum" + + CATEGORY = "FizzNodes 📅🅕🅝/FrameNodes" + + def assignFrameNum(self, current_frame, max_frames, batch_size): + if current_frame == 0: + return 0, 1, 2, 3 + else: + start_frame = (current_frame - 1) * (batch_size - 1) + 3 + print(tuple((start_frame + i) % max_frames for i in range(4))) + return tuple((start_frame + i) % max_frames for i in range(4)) \ No newline at end of file diff --git a/LICENCE.txt b/LICENCE.txt new file mode 100644 index 0000000..d95e1fa --- /dev/null +++ b/LICENCE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Fizzledorf + +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. \ No newline at end of file diff --git a/__init__.py b/__init__.py index c49f520..ddde147 100644 --- a/__init__.py +++ b/__init__.py @@ -61,6 +61,7 @@ from .ScheduledNodes import ( #, BatchPromptScheduleNodeFlowEnd #, BatchGLIGENSchedule ) from .FrameNodes import FrameConcatenate, InitNodeFrame, NodeFrame, StringConcatenate +from .HelperNodes import CalculateLatentInterpFrameNumber NODE_CLASS_MAPPINGS = { "Lerp": Lerp, @@ -93,6 +94,8 @@ NODE_CLASS_MAPPINGS = { "Init FizzFrame":InitNodeFrame, "FizzFrame":NodeFrame, "FizzFrameConcatenate":FrameConcatenate, + + "CalculateLatentInterpFrameNumber": CalculateLatentInterpFrameNumber } NODE_DISPLAY_NAME_MAPPINGS = { @@ -122,6 +125,7 @@ NODE_DISPLAY_NAME_MAPPINGS = { "BatchStringSchedule": "Batch String Schedule 📅🅕🅝", "BatchValueScheduleLatentInput": "Batch Value Schedule (Latent Input) 📅🅕🅝", "BatchPromptScheduleSDXLLatentInput": "Batch Prompt Schedule SDXL (Latent Input) 📅🅕🅝", - "BatchPromptScheduleLatentInput": "Batch Prompt Schedule (Latent Input)📅🅕🅝", + "BatchPromptScheduleLatentInput": "Batch Prompt Schedule (Latent Input) 📅🅕🅝", + "CalculateLatentInterpFrameNumber": "Calculate Frame Number (Latent Interp) 📅🅕🅝" } print('\033[34mFizzleDorf Custom Nodes: \033[92mLoaded\033[0m')