1 Commits
Author SHA1 Message Date
FizzleDorf ef654a6b84 added batch begin/end inputs to nodes 2024-06-02 20:52:03 -04:00
7 changed files with 84 additions and 132 deletions
+20 -47
View File
@@ -313,25 +313,16 @@ def interpolate_prompt_series(animation_prompts, max_frames, start_frame, pre_te
# 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)
def BatchPoolAnimConditioning(cur_prompt_series, nxt_prompt_series, weight_series, clip, settings:ScheduleSettings):
def BatchPoolAnimConditioning(cur_prompt_series, nxt_prompt_series, weight_series, clip):
pooled_out = []
cond_out = []
max_size = 0
if settings.end_frame == 0:
settings.end_frame = settings.max_frames
print("end_frame at 0, using max_frames instead!")
if settings.start_frame >= settings.end_frame:
settings.start_frame = 0
print("start_frame larger than or equal to end_frame, using max_frames instead!")
if max_size == 0:
for i in range(0, settings.end_frame):
for i in range(len(cur_prompt_series)):
tokens = clip.tokenize(str(cur_prompt_series[i]))
cond_to, pooled_to = clip.encode_from_tokens(tokens, return_pooled=True)
max_size = max(max_size, cond_to.shape[1])
for i in range(settings.start_frame, settings.end_frame):
for i in range(len(cur_prompt_series)):
tokens = clip.tokenize(str(cur_prompt_series[i]))
cond_to, pooled_to = clip.encode_from_tokens(tokens, return_pooled=True)
@@ -389,29 +380,14 @@ def BatchGLIGENConditioning(cur_prompt_series, nxt_prompt_series, weight_series,
return cond_out, pooled_out
def BatchPoolAnimConditioningSDXL(cur_prompt_series, nxt_prompt_series, weight_series, clip, settings:ScheduleSettings):
def BatchPoolAnimConditioningSDXL(cur_prompt_series, nxt_prompt_series, weight_series):
pooled_out = []
cond_out = []
max_size = 0
if settings.end_frame == 0:
settings.end_frame = settings.max_frames
print("end_frame at 0, using max_frames instead!")
if settings.start_frame >= settings.end_frame:
settings.start_frame = 0
print("start_frame larger than or equal to end_frame, using max_frames instead!")
if max_size == 0:
for i in range(0, settings.end_frame):
tokens = clip.tokenize(str(cur_prompt_series[i]))
cond_to, pooled_to = clip.encode_from_tokens(tokens, return_pooled=True)
max_size = max(max_size, cond_to.shape[1])
for i in range(settings.start_frame,settings.end_frame):
for i in range(len(cur_prompt_series)):
interpolated_conditioning = addWeighted(cur_prompt_series[i],
nxt_prompt_series[i],
weight_series[i], max_size)
weight_series[i])
interpolated_cond = interpolated_conditioning[0][0]
interpolated_pooled = interpolated_conditioning[0][1].get("pooled_output")
@@ -468,12 +444,9 @@ def BatchInterpolatePromptsSDXL(animation_promptsG, animation_promptsL, clip, se
return cur_prompt, nxt_prompt
# in case there is only one keyed promt, set all prompts to that prompt
cur_prompt_series_G, nxt_prompt_series_G = constructPrompt(sorted_prompts_G, cur_prompt_series_G,
nxt_prompt_series_G, settings.pre_text_G,
settings.app_text_G)
cur_prompt_series_L, nxt_prompt_series_L = constructPrompt(sorted_prompts_L, cur_prompt_series_L,
nxt_prompt_series_L, settings.pre_text_L,
settings.app_text_L)
cur_prompt_series_G, nxt_prompt_series_G = constructPrompt(sorted_prompts_G, cur_prompt_series_G, nxt_prompt_series_G, settings.pre_text_G, settings.app_text_G)
cur_prompt_series_L, nxt_prompt_series_L = constructPrompt(sorted_prompts_G, cur_prompt_series_G,
nxt_prompt_series_G, settings.pre_text_G, settings.app_text_G)
if len(sorted_prompts_L) - 1 == 0:
for i in range(0, len(cur_prompt_series_L) - 1):
current_prompt_L = sorted_prompts_L[0][1]
@@ -514,8 +487,8 @@ def BatchInterpolatePromptsSDXL(animation_promptsG, animation_promptsL, clip, se
nxt_prompt_series_G[f] = ''
weight_series[f] = 0.0
cur_prompt_series_G[f] += (str(current_prompt_G))
nxt_prompt_series_G[f] += (str(next_prompt_G))
cur_prompt_series_G[f] += (str(settings.pre_text_G) + " " + str(current_prompt_G) + " " + str(settings.app_text_G))
nxt_prompt_series_G[f] += (str(settings.pre_text_G) + " " + str(next_prompt_G) + " " + str(settings.app_text_G))
weight_series[f] += current_weight
@@ -531,8 +504,8 @@ def BatchInterpolatePromptsSDXL(animation_promptsG, animation_promptsL, clip, se
nxt_prompt_series_G[f] = ''
weight_series[f] = current_weight
cur_prompt_series_G[f] = (str(current_prompt_G))
nxt_prompt_series_G[f] = (str(next_prompt_G))
cur_prompt_series_G[f] += (str(settings.pre_text_G) + " " + str(current_prompt_G) + " " + str(settings.app_text_G))
nxt_prompt_series_G[f] += (str(settings.pre_text_G) + " " + str(next_prompt_G) + " " + str(settings.app_text_G))
# Reset outside of loop for nan check
current_key = 0
@@ -567,8 +540,8 @@ def BatchInterpolatePromptsSDXL(animation_promptsG, animation_promptsL, clip, se
nxt_prompt_series_L[f] = ''
weight_series[f] = 0.0
cur_prompt_series_L[f] += (str(current_prompt_L))
nxt_prompt_series_L[f] += (str(next_prompt_L))
cur_prompt_series_L[f] += (str(settings.pre_text_L) + " " + str(current_prompt_L) + " " + str(settings.app_text_L))
nxt_prompt_series_L[f] += (str(settings.pre_text_L) + " " + str(next_prompt_L) + " " + str(settings.app_text_L))
weight_series[f] += current_weight
@@ -578,13 +551,14 @@ def BatchInterpolatePromptsSDXL(animation_promptsG, animation_promptsL, clip, se
# second loop to catch any nan runoff
for f in range(current_key, next_key):
next_weight = weight_step * (f - current_key)
# add the appropriate prompts and weights to their respective containers.
cur_prompt_series_L[f] = ''
nxt_prompt_series_L[f] = ''
weight_series[f] = current_weight
cur_prompt_series_L[f] += (str(current_prompt_L))
nxt_prompt_series_L[f] += (str(next_prompt_L))
cur_prompt_series_L[f] += (str(settings.pre_text_L) + " " + str(current_prompt_L) + " " + str(settings.app_text_L))
nxt_prompt_series_L[f] += (str(settings.pre_text_L) + " " + str(next_prompt_L) + " " + str(settings.app_text_L))
# Evaluate the current and next prompt's expressions
for i in range(0, settings.max_frames):
@@ -604,9 +578,8 @@ def BatchInterpolatePromptsSDXL(animation_promptsG, animation_promptsL, clip, se
if settings.print_output == True:
# Show the to/from prompts with evaluated expressions for transparency.
for i in range(0, settings.max_frames):
print("\n", "Max Frames: ", settings.max_frames, "Curr Frame: ", i, "\n", "Current Prompt G: ",
cur_prompt_series_G[i],
print("\n", "Max Frames: ", settings.max_frames, "\n", "Current Prompt G: ", cur_prompt_series_G[i],
"\n", "Current Prompt L: ", cur_prompt_series_L[i], "\n", "Next Prompt G: ", nxt_prompt_series_G[i],
"\n", "Next Prompt L : ", nxt_prompt_series_L[i], "\n", "Current weight: ", weight_series[i])
"\n", "Next Prompt L : ", nxt_prompt_series_L[i], "\n"), "\n", "Current weight: ", weight_series[i]
return current_conds, next_conds, weight_series
+1 -3
View File
@@ -95,7 +95,6 @@ class InitNodeFrame:
}
}
RETURN_TYPES = ("FIZZFRAME","CONDITIONING","CONDITIONING",)
RETURN_NAMES = ("FIZZFRAME","POS_COND","NEG_COND",)
FUNCTION = "create_frame"
CATEGORY = "FizzNodes 📅🅕🅝/FrameNodes"
@@ -157,7 +156,6 @@ class NodeFrame:
}
}
RETURN_TYPES = ("FIZZFRAME","CONDITIONING","CONDITIONING",)
RETURN_NAMES = ("FIZZFRAME","POS_COND","NEG_COND",)
FUNCTION = "create_frame"
CATEGORY = "FizzNodes 📅🅕🅝/FrameNodes"
@@ -221,4 +219,4 @@ class FrameConcatenate:
text_list += f'",\n'
text_list = text_list[:-2]
return (text_list,)
return (text_list,)
+4
View File
@@ -33,6 +33,8 @@ class ScheduleSettings:
pw_d: float,
start_frame: int,
end_frame:int,
batch_start:int,
batch_end:int,
width: int,
height: int,
crop_w: int,
@@ -55,6 +57,8 @@ class ScheduleSettings:
self.pw_d=pw_d
self.start_frame=start_frame
self.end_frame=end_frame
self.batch_start=batch_start
self.batch_end=batch_end
self.width=width
self.height=height
self.crop_w=crop_w
+8 -49
View File
@@ -46,8 +46,8 @@ def batch_prompt_schedule(settings:ScheduleSettings,clip):
neg_cur_prompt, neg_nxt_prompt, weight = interpolate_prompt_seriesA(neg, settings)
# Apply composable diffusion across the batch
p = BatchPoolAnimConditioning(pos_cur_prompt, pos_nxt_prompt, weight, clip, settings)
n = BatchPoolAnimConditioning(neg_cur_prompt, neg_nxt_prompt, weight, clip, settings)
p = BatchPoolAnimConditioning(pos_cur_prompt, pos_nxt_prompt, weight, clip, )
n = BatchPoolAnimConditioning(neg_cur_prompt, neg_nxt_prompt, weight, clip, )
# return positive and negative conditioning as well as the current and next prompts for each
return (p, n,)
@@ -63,13 +63,13 @@ def batch_prompt_schedule_latentInput(settings:ScheduleSettings,clip, latents):
pos_cur_prompt, pos_nxt_prompt, weight = interpolate_prompt_seriesA(pos, settings)
# Apply composable diffusion across the batch
p = BatchPoolAnimConditioning(pos_cur_prompt, pos_nxt_prompt, weight, clip, settings)
p = BatchPoolAnimConditioning(pos_cur_prompt, pos_nxt_prompt, weight, clip)
# Interpolate the negative prompt weights over frames
neg_cur_prompt, neg_nxt_prompt, weight = interpolate_prompt_seriesA(neg, settings)
# Apply composable diffusion across the batch
n = BatchPoolAnimConditioning(neg_cur_prompt, neg_nxt_prompt, weight, clip, settings)
n = BatchPoolAnimConditioning(neg_cur_prompt, neg_nxt_prompt, weight, clip)
return (p, n, latents,)
@@ -144,8 +144,8 @@ def batch_prompt_schedule_SDXL(settings:ScheduleSettings,clip):
pc, pn, pw = BatchInterpolatePromptsSDXL(posG, posL, clip, settings,)
nc, nn, nw = BatchInterpolatePromptsSDXL(negG, negL, clip, settings,)
p = BatchPoolAnimConditioningSDXL(pc, pn, pw, clip, settings)
n = BatchPoolAnimConditioningSDXL(nc, nn, nw, clip, settings)
p = BatchPoolAnimConditioningSDXL(pc, pn, pw)
n = BatchPoolAnimConditioningSDXL(nc, nn, nw)
return (p, n,)
@@ -163,53 +163,12 @@ def batch_prompt_schedule_SDXL_latentInput(settings:ScheduleSettings,clip, laten
pc, pn, pw = BatchInterpolatePromptsSDXL(posG, posL, clip, settings)
nc, nn, nw = BatchInterpolatePromptsSDXL(negG, negL, clip, settings)
p = BatchPoolAnimConditioningSDXL(pc, pn, pw, clip, settings)
n = BatchPoolAnimConditioningSDXL(nc, nn, nw, clip, settings)
p = BatchPoolAnimConditioningSDXL(pc, pn, pw)
n = BatchPoolAnimConditioningSDXL(nc, nn, nw)
return (p, n, latents,)
def prompt_schedule_SD3(settings:ScheduleSettings,clip):
# modulus rollover when current frame exceeds max frames
settings.current_frame = settings.current_frame % settings.max_frames
# Clear whitespace and newlines from json
animation_prompts_G = process_input_text(settings.text_g)
animation_prompts_L = process_input_text(settings.text_l)
animation_prompts_T = process_input_text(settings.text_l)
# add pre_text and app_text then split the combined prompt into positive and negative prompts
posG, negG = batch_split_weighted_subprompts(animation_prompts_G, settings.pre_text_G, settings.app_text_G)
posL, negL = batch_split_weighted_subprompts(animation_prompts_L, settings.pre_text_L, settings.app_text_L)
posT, negT = batch_split_weighted_subprompts(animation_prompts_L, settings.pre_text_L, settings.app_text_L)
pc, pn, pw = BatchInterpolatePromptsSD3(posG, posL, clip, settings, )
nc, nn, nw = BatchInterpolatePromptsSD3(negG, negL, clip, settings, )
#apply composable diffusion to the current frame
p = addWeighted(pc[settings.current_frame], pn[settings.current_frame], pw[settings.current_frame])
n = addWeighted(nc[settings.current_frame], nn[settings.current_frame], nw[settings.current_frame])
return (p, n,)
def batch_prompt_schedule_SD3(settings:ScheduleSettings,clip):
# Clear whitespace and newlines from json
animation_prompts_G = process_input_text(settings.text_g)
animation_prompts_L = process_input_text(settings.text_l)
animation_prompts_T = process_input_text(settings.text_l)
# add pre_text and app_text then split the combined prompt into positive and negative prompts
posG, negG = batch_split_weighted_subprompts(animation_prompts_G, settings.pre_text_G, settings.app_text_G)
posL, negL = batch_split_weighted_subprompts(animation_prompts_L, settings.pre_text_L, settings.app_text_L)
posT, negT = batch_split_weighted_subprompts(animation_prompts_L, settings.pre_text_L, settings.app_text_L)
#pc, pn, pw = BatchInterpolatePromptsSD3(posG, posL, clip, settings,)
#nc, nn, nw = BatchInterpolatePromptsSD3(negG, negL, clip, settings,)
#p = BatchPoolAnimConditioningSD3(pc, pn, pw)
#n = BatchPoolAnimConditioningSD3(nc, nn, nw)
return (p, n,)
+49 -30
View File
@@ -89,7 +89,9 @@ class PromptSchedule:
pw_c=pw_c,
pw_d=pw_d,
start_frame=0,
end_frame=max_frames,
end_frame=0,
batch_start=0,
batch_end=0,
width=None,
height=None,
crop_w=None,
@@ -116,8 +118,10 @@ 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, "display": "start_frame(print_only)", }),
"end_frame": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1, "display": "end_frame(print_only)",}),
"start_frame": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1,}),
"end_frame": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1,}),
"batch_start": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1,}),
"batch_end": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1, }),
"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}),
@@ -131,7 +135,7 @@ class BatchPromptSchedule:
CATEGORY = "FizzNodes 📅🅕🅝/BatchScheduleNodes"
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=''
def animate(self, text, max_frames, print_output, clip, start_frame, end_frame, batch_start, batch_end, pw_a=0, pw_b=0, pw_c=0, pw_d=0, pre_text='', app_text=''
):
settings = ScheduleSettings(
text_g=text,
@@ -149,6 +153,8 @@ class BatchPromptSchedule:
pw_d=pw_d,
start_frame=start_frame,
end_frame=end_frame,
batch_start=batch_start,
batch_end=batch_end,
width=None,
height=None,
crop_w=None,
@@ -179,6 +185,8 @@ class BatchPromptScheduleLatentInput:
"app_text": ("STRING", {"multiline": True, "forceInput": True}),
"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)", }),
"batch_start": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1, }),
"batch_end": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1, }),
"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 }),
@@ -192,7 +200,7 @@ class BatchPromptScheduleLatentInput:
CATEGORY = "FizzNodes 📅🅕🅝/BatchScheduleNodes"
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=''
def animate(self, text, num_latents, print_output, clip, start_frame, end_frame, batch_start, batch_end, pw_a=0, pw_b=0, pw_c=0, pw_d=0, pre_text='', app_text=''
):
settings = ScheduleSettings(
text_g=text,
@@ -210,6 +218,8 @@ class BatchPromptScheduleLatentInput:
pw_d=pw_d,
start_frame=start_frame,
end_frame=end_frame,
batch_start=batch_start,
batch_end=batch_end,
width=None,
height=None,
crop_w=None,
@@ -260,7 +270,9 @@ class StringSchedule:
pw_c = pw_c,
pw_d = pw_d,
start_frame = 0,
end_frame=max_frames,
end_frame=0,
batch_start=0,
batch_end=0,
width = None,
height = None,
crop_w = None,
@@ -315,7 +327,9 @@ class BatchStringSchedule:
pw_c=pw_c,
pw_d=pw_d,
start_frame=0,
end_frame=max_frames,
end_frame=0,
batch_start=0,
batch_end=0,
width=None,
height=None,
crop_w=None,
@@ -345,7 +359,7 @@ class PromptScheduleEncodeSDXL:
"text_l": ("STRING", {"multiline": True, }), "clip": ("CLIP", ),
"max_frames": ("INT", {"default": 120.0, "min": 1.0, "max": 999999.0, "step": 1.0}),
"current_frame": ("INT", {"default": 0.0, "min": 0.0, "max": 999999.0, "step": 1.0}),
"print_output":("BOOLEAN", {"default": False}),
"print_output":("BOOLEAN", {"default": False})
},
"optional": {
"pre_text_G": ("STRING", {"multiline": True, "forceInput": True}),
@@ -364,7 +378,7 @@ class PromptScheduleEncodeSDXL:
CATEGORY = "FizzNodes 📅🅕🅝/ScheduleNodes"
def animate(self, clip, text_g, text_l, width, height, crop_w, crop_h, target_width, target_height, max_frames, current_frame, print_output, app_text_G = '', app_text_L = '', pre_text_G = '', pre_text_L = '', pw_a=0, pw_b=0, pw_c=0, pw_d=0):
def animate(self, clip, width, height, crop_w, crop_h, target_width, target_height, text_g, text_l, app_text_G, app_text_L, pre_text_G, pre_text_L, max_frames, current_frame, print_output, pw_a, pw_b, pw_c, pw_d):
settings = ScheduleSettings(
text_g=text_g,
pre_text_G=pre_text_G,
@@ -380,7 +394,9 @@ class PromptScheduleEncodeSDXL:
pw_c=pw_c,
pw_d=pw_d,
start_frame=0,
end_frame=max_frames,
end_frame=0,
batch_start=0,
batch_end=0,
width=width,
height=height,
crop_w=crop_w,
@@ -409,10 +425,8 @@ class BatchPromptScheduleEncodeSDXL:
"text_l": ("STRING", {"multiline": True, }), "clip": ("CLIP", ),
"max_frames": ("INT", {"default": 120.0, "min": 1.0, "max": 999999.0, "step": 1.0}),
"print_output":("BOOLEAN", {"default": False}),
},
"optional": {
"pre_text_G": ("STRING", {"multiline": True, "forceInput": True}),
"app_text_G": ("STRING", {"multiline": True, "forceInput": True}),
"pre_text_L": ("STRING", {"multiline": True, "forceInput": True}),
@@ -421,20 +435,16 @@ class BatchPromptScheduleEncodeSDXL:
"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 }),
"pw_d": ("FLOAT", {"default": 0.0, "min": -9999.0, "max": 9999.0, "step": 0.1, "forceInput": True }),
"start_frame": (
"INT", {"default": 0, "min": 0, "max": 9999, "step": 1, "display": "start_frame(print_only)", }),
"end_frame": (
"INT", {"default": 120, "min": 0, "max": 9999, "step": 1, "display": "end_frame(print_only)", }),
}
}
RETURN_TYPES = ("CONDITIONING", "CONDITIONING",)# "CONDITIONING", "CONDITIONING", "CONDITIONING", "CONDITIONING",)
RETURN_NAMES = ("POS", "NEG")#, "POS_CUR", "NEG_CUR", "POS_NXT", "NEG_NXT",)
RETURN_NAMES = ("POS", "NEG", "POS_CUR", "NEG_CUR", "POS_NXT", "NEG_NXT",)
FUNCTION = "animate"
CATEGORY = "FizzNodes 📅🅕🅝/BatchScheduleNodes"
def animate(self, clip, text_g, text_l, width, height, crop_w, crop_h, target_width, target_height, max_frames, print_output, app_text_G = '', app_text_L = '', pre_text_G = '', pre_text_L = '', pw_a=0, pw_b=0, pw_c=0, pw_d=0, start_frame=0, end_frame=120):
def animate(self, clip, width, height, crop_w, crop_h, target_width, target_height, text_g, text_l, app_text_G, app_text_L, pre_text_G, pre_text_L, max_frames, print_output, pw_a=0, pw_b=0, pw_c=0, pw_d=0):
settings = ScheduleSettings(
text_g=text_g,
pre_text_G=pre_text_G,
@@ -449,8 +459,10 @@ class BatchPromptScheduleEncodeSDXL:
pw_b=pw_b,
pw_c=pw_c,
pw_d=pw_d,
start_frame=start_frame,
end_frame=end_frame,
start_frame=0,
end_frame=0,
batch_start=0,
batch_end=0,
width=width,
height=height,
crop_w=crop_w,
@@ -491,19 +503,15 @@ class BatchPromptScheduleEncodeSDXLLatentInput:
"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 }),
"pw_d": ("FLOAT", {"default": 0.0, "min": -9999.0, "max": 9999.0, "step": 0.1, "forceInput": True }),
"start_frame": (
"INT", {"default": 0, "min": 0, "max": 9999, "step": 1, "display": "start_frame(print_only)", }),
"end_frame": (
"INT", {"default": 120, "min": 0, "max": 9999, "step": 1, "display": "end_frame(print_only)", }),
}
}
RETURN_TYPES = ("CONDITIONING", "CONDITIONING", "LATENT",)# "CONDITIONING", "CONDITIONING", "CONDITIONING", "CONDITIONING",)
RETURN_NAMES = ("POS", "NEG", "INPUT_LATENTS")#, "NEG_CUR", "POS_NXT", "NEG_NXT",)
RETURN_NAMES = ("POS", "NEG", "POS_CUR", "NEG_CUR", "POS_NXT", "NEG_NXT",)
FUNCTION = "animate"
CATEGORY = "FizzNodes 📅🅕🅝/BatchScheduleNodes"
def animate(self, clip, text_g, text_l, width, height, crop_w, crop_h, target_width, target_height, num_latents, print_output, app_text_G = '', app_text_L = '', pre_text_G = '', pre_text_L = '', pw_a=0, pw_b=0, pw_c=0, pw_d=0, start_frame=0, end_frame=120):
def animate(self, clip, width, height, crop_w, crop_h, target_width, target_height, text_g, text_l, app_text_G, app_text_L, pre_text_G, pre_text_L, num_latents, print_output, pw_a, pw_b, pw_c, pw_d):
settings = ScheduleSettings(
text_g=text_g,
pre_text_G=pre_text_G,
@@ -518,8 +526,10 @@ class BatchPromptScheduleEncodeSDXLLatentInput:
pw_b=pw_b,
pw_c=pw_c,
pw_d=pw_d,
start_frame=start_frame,
end_frame=end_frame,
start_frame=0,
end_frame=0,
batch_start=0,
batch_end=0,
width=width,
height=height,
crop_w=crop_w,
@@ -606,7 +616,9 @@ class PromptScheduleNodeFlowEnd:
pw_c=pw_c,
pw_d=pw_d,
start_frame=0,
end_frame=max_frames,
end_frame=0,
batch_start=0,
batch_end=0,
width=None,
height=None,
crop_w=None,
@@ -627,6 +639,10 @@ class BatchPromptScheduleNodeFlowEnd:
},
"optional": {"pre_text": ("STRING", {"multiline": False, "forceInput": True}),
"app_text": ("STRING", {"multiline": False, "forceInput": True}),
"start_frame": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1, }),
"end_frame": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1, }),
"batch_start": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1, }),
"batch_end": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1, }),
"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}),
@@ -640,7 +656,7 @@ class BatchPromptScheduleNodeFlowEnd:
CATEGORY = "FizzNodes 📅🅕🅝/BatchScheduleNodes"
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='',
def animate(self, text, max_frames, start_frame, end_frame, batch_start, batch_end, 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]
@@ -662,6 +678,8 @@ class BatchPromptScheduleNodeFlowEnd:
pw_d=pw_d,
start_frame=start_frame,
end_frame=end_frame,
batch_start=batch_start,
batch_end=batch_end,
width=None,
height=None,
crop_w=None,
@@ -688,6 +706,7 @@ class BatchGLIGENSchedule:
"y": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
"max_frames": ("INT", {"default": 120.0, "min": 1.0, "max": 999999.0, "step": 1.0}),
"print_output":("BOOLEAN", {"default": False})},
# "forceInput": True}),},
"optional": {"pre_text": ("STRING", {"multiline": True, "forceInput": True}),
"app_text": ("STRING", {"multiline": True, "forceInput": True}),
"pw_a": ("FLOAT", {"default": 0.0, "min": -9999.0, "max": 9999.0, "step": 0.1, "forceInput": True }),
+2 -2
View File
@@ -1,8 +1,8 @@
[project]
name = "comfyui_fizznodes"
description = "Scheduled prompts, scheduled float/int values and wave function nodes for animations and utility. compatable with [a/framesync](https://www.framesync.xyz/) and [a/keyframe-string-generator](https://www.chigozie.co.uk/keyframe-string-generator/) for audio synced animations in Comfyui."
version = "1.0.2"
license = { file = "LICENCE.txt" }
version = "1.0.0"
license = "LICENSE"
dependencies = ["pandas", "numexpr"]
[project.urls]
-1
View File
@@ -1,3 +1,2 @@
numpy
pandas
numexpr