Merge pull request #96 from FizzleDorf/start_frame_fix
Start/end_frame print fix
This commit is contained in:
+17
-5
@@ -178,14 +178,22 @@ def interpolate_prompt_seriesA(animation_prompts, settings:ScheduleSettings):
|
||||
index_offset = 0
|
||||
|
||||
# Evaluate the current and next prompt's expressions
|
||||
for i in range(settings.start_frame, len(cur_prompt_series)):
|
||||
for i in range(0, len(cur_prompt_series)):
|
||||
cur_prompt_series[i] = prepare_batch_promptA(cur_prompt_series[i], settings, i)
|
||||
nxt_prompt_series[i] = prepare_batch_promptA(nxt_prompt_series[i], settings, i)
|
||||
if settings.print_output == True:
|
||||
# Show the to/from prompts with evaluated expressions for transparency.
|
||||
print("\n", "Max Frames: ", settings.max_frames, "\n", "frame index: ", (settings.start_frame + i), "\n", "Current Prompt: ",
|
||||
cur_prompt_series[i], "\n", "Next Prompt: ", nxt_prompt_series[i], "\n", "Strength : ",
|
||||
weight_series[i], "\n")
|
||||
if(settings.start_frame >= i):
|
||||
if(settings.end_frame > 0):
|
||||
if(settings.end_frame > i):
|
||||
print("\n", "Max Frames: ", settings.max_frames, "\n", "frame index: ", (settings.start_frame + i),
|
||||
"\n", "Current Prompt: ",
|
||||
cur_prompt_series[i], "\n", "Next Prompt: ", nxt_prompt_series[i], "\n", "Strength : ",
|
||||
weight_series[i], "\n")
|
||||
else:
|
||||
print("\n", "Max Frames: ", settings.max_frames, "\n", "frame index: ", (settings.start_frame + i), "\n", "Current Prompt: ",
|
||||
cur_prompt_series[i], "\n", "Next Prompt: ", nxt_prompt_series[i], "\n", "Strength : ",
|
||||
weight_series[i], "\n")
|
||||
index_offset = index_offset + 1
|
||||
|
||||
# Output methods depending if the prompts are the same or if the current frame is a keyframe.
|
||||
@@ -280,12 +288,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: ",
|
||||
@@ -295,7 +307,7 @@ def interpolate_prompt_series(animation_prompts, max_frames, start_frame, pre_te
|
||||
|
||||
|
||||
|
||||
# Output methods depending if the prompts are the same or if the current frame is a keyframe.
|
||||
# Output methods depend on if the prompts are the same or if the current frame is a keyframe.
|
||||
# if it is an in-between frame and the prompts differ, composable diffusion will be performed.
|
||||
return (cur_prompt_series, nxt_prompt_series, weight_series)
|
||||
|
||||
|
||||
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user