FizzleDorf / ComfyUI_FizzNodes

Custom Nodes for Comfyui
MIT License
370 stars 56 forks source link

PromptSchedule crashing on invalid index to scalar variable #59

Closed tholonia closed 7 months ago

tholonia commented 7 months ago

I read that you planned on releasing a full workflow for the example in the README.md. Is that coming soon? The partial example you do show does not work when I add the missing pieces, or at least when I am guessing are the missing pieces. I just get a PromptScheduler error no matter what I put in the Value_Schedule. I have tried a single entry of 0:(0.95) and 120 entries from Keyframe string generator.

Error occurred when executing PromptSchedule:

invalid index to scalar variable.

ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
  File "/home/jw/store/src/ComfyUI/execution.py", line 154, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "/home/jw/store/src/ComfyUI/execution.py", line 84, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "/home/jw/store/src/ComfyUI/execution.py", line 77, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "/home/jw/store/src/ComfyUI/custom_nodes/ComfyUI_FizzNodes/ScheduledNodes.py", line 81, in animate
    pos_cur_prompt, pos_nxt_prompt, weight = interpolate_prompt_series(pos, max_frames, start_frame, pre_text, app_text, pw_a,
  File "/home/jw/store/src/ComfyUI/custom_nodes/ComfyUI_FizzNodes/BatchFuncs.py", line 157, in interpolate_prompt_series
    cur_prompt_series[i] = prepare_batch_prompt(cur_prompt_series[i], max_frames, i, prompt_weight_1[i],
IndexError: invalid index to scalar variable.

In your examples, you use both 'pw_a' and `pw_a` (single quote vs backtick). What is the correct usage, or does it even matter?

The error begins around line 161 in BatchFuncs.py, but the value of prompt_weight_1[i] is being correctly read, so the problem is inside PromotSchedule, or so it appears.

FizzleDorf commented 7 months ago

yes I am rewriting the readme now and putting most of it into an organized github wiki you can download. For the regular prompt schedule, you need to make sure the max_frames are matching for both schedules (I normally just use a prim connected to max_frames converted to an input. For the prompt weight variables (ie: pw_a), it needs to have backticks as that is what is being parsed by regex. I'll do some testing to see if things are working properly after I have the README.md sorted. Let me know if you have any other questions with what I have here or anything else you came across. Cheers!

tholonia commented 7 months ago

Thank you the prompt reply. I look forward to the updated docs.
I applied your suggestion of using prims for the max_frames, and I removed all refs to the Value_Schedules from the prompt, and I still get the same error. I have attached the smallest possible test case I could make, in case you want to replicate the problem. anitest.json

FizzleDorf commented 7 months ago

I've fixed the issue with the latest commit. you should be able to schedule now. I used your test workflow and altered so you can see the changes better fixed anitest.json. I'll be making example workflows too for documentation. Thanks for your patence I had technical difficulties setting up a new rig in Japan.