added end_frame

This commit is contained in:
FizzleDorf
2024-05-24 22:51:13 -04:00
parent d643e67314
commit a50ae2b8ea
3 changed files with 23 additions and 6 deletions
+4
View File
@@ -280,12 +280,16 @@ def interpolate_prompt_series(animation_prompts, max_frames, start_frame, pre_te
current_weight = 0.0
index_offset = 0
# Evaluate the current and next prompt's expressions
for i in range(start_frame, len(cur_prompt_series)):
cur_prompt_series[i] = prepare_batch_prompt(cur_prompt_series[i], max_frames, i, prompt_weight_1[i],
prompt_weight_2[i], prompt_weight_3[i], prompt_weight_4[i])
nxt_prompt_series[i] = prepare_batch_prompt(nxt_prompt_series[i], max_frames, i, prompt_weight_1[i],
prompt_weight_2[i], prompt_weight_3[i], prompt_weight_4[i])
if Is_print == True:
# Show the to/from prompts with evaluated expressions for transparency.
print("\n", "Max Frames: ", max_frames, "\n", "frame index: ", (start_frame + i), "\n", "Current Prompt: ",
+2
View File
@@ -32,6 +32,7 @@ class ScheduleSettings:
pw_c: float,
pw_d: float,
start_frame: int,
end_frame:int,
width: int,
height: int,
crop_w: int,
@@ -53,6 +54,7 @@ class ScheduleSettings:
self.pw_c=pw_c
self.pw_d=pw_d
self.start_frame=start_frame
self.end_frame=end_frame
self.width=width
self.height=height
self.crop_w=crop_w
+17 -6
View File
@@ -89,6 +89,7 @@ class PromptSchedule:
pw_c=pw_c,
pw_d=pw_d,
start_frame=0,
end_frame=0,
width=None,
height=None,
crop_w=None,
@@ -115,7 +116,8 @@ class BatchPromptSchedule:
"optional": {
"pre_text": ("STRING", {"multiline": True, "forceInput": True}),
"app_text": ("STRING", {"multiline": True, "forceInput": True}),
"start_frame": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1, }),
"start_frame": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1, "display": "start_frame(print_only)", }),
"end_frame": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1, "display": "end_frame(print_only)",}),
"pw_a": ("FLOAT", {"default": 0.0, "min": -9999.0, "max": 9999.0, "step": 0.1, "forceInput": True}),
"pw_b": ("FLOAT", {"default": 0.0, "min": -9999.0, "max": 9999.0, "step": 0.1, "forceInput": True}),
"pw_c": ("FLOAT", {"default": 0.0, "min": -9999.0, "max": 9999.0, "step": 0.1, "forceInput": True}),
@@ -129,7 +131,7 @@ class BatchPromptSchedule:
CATEGORY = "FizzNodes 📅🅕🅝/BatchScheduleNodes"
def animate(self, text, max_frames, print_output, clip, start_frame, pw_a=0, pw_b=0, pw_c=0, pw_d=0, pre_text='', app_text=''
def animate(self, text, max_frames, print_output, clip, start_frame, end_frame, pw_a=0, pw_b=0, pw_c=0, pw_d=0, pre_text='', app_text=''
):
settings = ScheduleSettings(
text_g=text,
@@ -146,6 +148,7 @@ class BatchPromptSchedule:
pw_c=pw_c,
pw_d=pw_d,
start_frame=start_frame,
end_frame=end_frame,
width=None,
height=None,
crop_w=None,
@@ -174,7 +177,8 @@ class BatchPromptScheduleLatentInput:
},
"optional": {"pre_text": ("STRING", {"multiline": True, "forceInput": True}),
"app_text": ("STRING", {"multiline": True, "forceInput": True}),
"start_frame": ("INT", {"default": 0.0, "min": 0, "max": 9999, "step": 1, }),
"start_frame": ("INT", {"default": 0.0, "min": 0, "max": 9999, "step": 1, "display": "start_frame(print_only)", }),
"end_frame": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1, "display": "end_frame(print_only)", }),
"pw_a": ("FLOAT", {"default": 0.0, "min": -9999.0, "max": 9999.0, "step": 0.1, "forceInput": True }),
"pw_b": ("FLOAT", {"default": 0.0, "min": -9999.0, "max": 9999.0, "step": 0.1, "forceInput": True }),
"pw_c": ("FLOAT", {"default": 0.0, "min": -9999.0, "max": 9999.0, "step": 0.1, "forceInput": True }),
@@ -188,7 +192,7 @@ class BatchPromptScheduleLatentInput:
CATEGORY = "FizzNodes 📅🅕🅝/BatchScheduleNodes"
def animate(self, text, num_latents, print_output, clip, start_frame, pw_a=0, pw_b=0, pw_c=0, pw_d=0, pre_text='', app_text=''
def animate(self, text, num_latents, print_output, clip, start_frame, end_frame, pw_a=0, pw_b=0, pw_c=0, pw_d=0, pre_text='', app_text=''
):
settings = ScheduleSettings(
text_g=text,
@@ -205,6 +209,7 @@ class BatchPromptScheduleLatentInput:
pw_c=pw_c,
pw_d=pw_d,
start_frame=start_frame,
end_frame=end_frame,
width=None,
height=None,
crop_w=None,
@@ -255,6 +260,7 @@ class StringSchedule:
pw_c = pw_c,
pw_d = pw_d,
start_frame = 0,
end_frame=0,
width = None,
height = None,
crop_w = None,
@@ -309,6 +315,7 @@ class BatchStringSchedule:
pw_c=pw_c,
pw_d=pw_d,
start_frame=0,
end_frame=0,
width=None,
height=None,
crop_w=None,
@@ -373,6 +380,7 @@ class PromptScheduleEncodeSDXL:
pw_c=pw_c,
pw_d=pw_d,
start_frame=0,
end_frame=0,
width=width,
height=height,
crop_w=crop_w,
@@ -436,6 +444,7 @@ class BatchPromptScheduleEncodeSDXL:
pw_c=pw_c,
pw_d=pw_d,
start_frame=0,
end_frame=0,
width=width,
height=height,
crop_w=crop_w,
@@ -500,6 +509,7 @@ class BatchPromptScheduleEncodeSDXLLatentInput:
pw_c=pw_c,
pw_d=pw_d,
start_frame=0,
end_frame=0,
width=width,
height=height,
crop_w=crop_w,
@@ -586,6 +596,7 @@ class PromptScheduleNodeFlowEnd:
pw_c=pw_c,
pw_d=pw_d,
start_frame=0,
end_frame=0,
width=None,
height=None,
crop_w=None,
@@ -619,7 +630,7 @@ class BatchPromptScheduleNodeFlowEnd:
CATEGORY = "FizzNodes 📅🅕🅝/BatchScheduleNodes"
def animate(self, text, max_frames, start_frame, print_output, clip, pw_a=0, pw_b=0, pw_c=0, pw_d=0, pre_text='',
def animate(self, text, max_frames, start_frame, end_frame, print_output, clip, pw_a=0, pw_b=0, pw_c=0, pw_d=0, pre_text='',
app_text=''):
if text[-1] == ",":
text = text[:-1]
@@ -640,6 +651,7 @@ class BatchPromptScheduleNodeFlowEnd:
pw_c=pw_c,
pw_d=pw_d,
start_frame=start_frame,
end_frame=end_frame,
width=None,
height=None,
crop_w=None,
@@ -800,7 +812,6 @@ class ImagesFromBatchSchedule:
def animate(self, images, text, current_frame, max_frames, print_output):
inputText = str("{" + text + "}")
inputText = re.sub(r',\s*}', '}', inputText)
start_frame = 0
animation_prompts = json.loads(inputText.strip())
pos_cur_prompt, pos_nxt_prompt, weight = interpolate_prompt_series(animation_prompts, max_frames, 0, "",
"", 0,