From a696099cf45aba15042928c5579ecd38f367030c Mon Sep 17 00:00:00 2001 From: FizzleDorf <1fizzledorf@gmail.com> Date: Thu, 21 Mar 2024 23:19:01 -0400 Subject: [PATCH] SDXL schedules fixed --- BatchFuncs.py | 4 ++-- ScheduledNodes.py | 27 ++++++++++++++++++--------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/BatchFuncs.py b/BatchFuncs.py index 2c8d5b0..b90e395 100644 --- a/BatchFuncs.py +++ b/BatchFuncs.py @@ -236,7 +236,7 @@ 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): +def BatchPoolAnimConditioningSDXL(cur_prompt_series, nxt_prompt_series, weight_series): pooled_out = [] cond_out = [] @@ -439,4 +439,4 @@ def BatchInterpolatePromptsSDXL(animation_promptsG, animation_promptsL, max_fram "\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"), "\n", "Current weight: ", weight_series[i] - return BatchPoolAnimConditioningSDXL(current_conds, next_conds, weight_series, clip) + return current_conds, next_conds, weight_series diff --git a/ScheduledNodes.py b/ScheduledNodes.py index df0a346..3b7acc5 100644 --- a/ScheduledNodes.py +++ b/ScheduledNodes.py @@ -9,12 +9,9 @@ import re import json -from .ScheduleFuncs import ( - check_is_number, interpolate_prompts_SDXL, PoolAnimConditioning, - interpolate_string, addWeighted, reverseConcatenation, split_weighted_subprompts -) -from .BatchFuncs import interpolate_prompt_series, BatchPoolAnimConditioning, BatchInterpolatePromptsSDXL, batch_split_weighted_subprompts #, BatchGLIGENConditioning -from .ValueFuncs import batch_get_inbetweens, batch_parse_key_frames, parse_key_frames, get_inbetweens, sanitize_value +from .ScheduleFuncs import * +from .BatchFuncs import * #, BatchGLIGENConditioning +from .ValueFuncs import * #Max resolution value for Gligen area calculation. MAX_RESOLUTION=8192 @@ -296,7 +293,12 @@ class BatchPromptScheduleEncodeSDXL: inputTextL = re.sub(r',\s*}', '}', inputTextL) animation_promptsG = json.loads(inputTextG.strip()) animation_promptsL = json.loads(inputTextL.strip()) - return (BatchInterpolatePromptsSDXL(animation_promptsG, animation_promptsL, max_frames, clip, app_text_G, app_text_L, pre_text_G, pre_text_L, pw_a, pw_b, pw_c, pw_d, width, height, crop_w, crop_h, target_width, target_height, print_output,),) + c, n, w = BatchInterpolatePromptsSDXL(animation_promptsG, animation_promptsL, max_frames, clip, app_text_G, + app_text_L, pre_text_G, pre_text_L, pw_a, pw_b, pw_c, pw_d, width, height, + crop_w, crop_h, target_width, target_height, print_output, ) + pc = BatchPoolAnimConditioningSDXL(c,n,w) + + return (pc,) class BatchPromptScheduleEncodeSDXLLatentInput: @classmethod @@ -334,7 +336,12 @@ class BatchPromptScheduleEncodeSDXLLatentInput: inputTextL = re.sub(r',\s*}', '}', inputTextL) animation_promptsG = json.loads(inputTextG.strip()) animation_promptsL = json.loads(inputTextL.strip()) - return (BatchInterpolatePromptsSDXL(animation_promptsG, animation_promptsL, max_frames, clip, app_text_G, app_text_L, pre_text_G, pre_text_L, pw_a, pw_b, pw_c, pw_d, width, height, crop_w, crop_h, target_width, target_height, print_output, ), num_latents, ) + c, n, w = BatchInterpolatePromptsSDXL(animation_promptsG, animation_promptsL, max_frames, clip, app_text_G, + app_text_L, pre_text_G, pre_text_L, pw_a, pw_b, pw_c, pw_d, width, height, + crop_w, crop_h, target_width, target_height, print_output, ) + pc = BatchPoolAnimConditioningSDXL(c, n, w) + + return (pc,) class PromptScheduleEncodeSDXL: @classmethod @@ -373,7 +380,9 @@ class PromptScheduleEncodeSDXL: inputTextL = re.sub(r',\s*}', '}', inputTextL) animation_promptsG = json.loads(inputTextG.strip()) animation_promptsL = json.loads(inputTextL.strip()) - return (interpolate_prompts_SDXL(animation_promptsG, animation_promptsL, max_frames, current_frame, clip, app_text_G, app_text_L, pre_text_G, pre_text_L, pw_a, pw_b, pw_c, pw_d, width, height, crop_w, crop_h, target_width, target_height, print_output,),) + c,n,w = BatchInterpolatePromptsSDXL(animation_promptsG, animation_promptsL, max_frames, clip, app_text_G, app_text_L, pre_text_G, pre_text_L, pw_a, pw_b, pw_c, pw_d, width, height, crop_w, crop_h, target_width, target_height, print_output,) + pc = addWeighted(c[current_frame], n[current_frame], w[current_frame]) + return (pc,) # This node schedules the prompt using separate nodes as the keyframes. # The values in the prompt are evaluated in NodeFlowEnd.