ForeignGods/ComfyUI-Mana-Nodes

Potentially small error in time to frame aligment in font2img_node

Closed this issue · 2 comments

I am not sure if this is just due to the way I use this node, but I was struggling with the issue that the very first word would never get rendered if it starts at start time 0.0. The reason seems to be in the format_transcription() method where it calculates

frame_number = round(start_time * transcription_fps)

It looks to me like it assumes that frame numbering starts at 0, but further down in the generate_images() code the first frame is 1:

for i in range(1, frame_count + 1):

So my fix is to add 1 to frame_number which seems to work:
frame_number = 1 + round(start_time * transcription_fps)

The intended logic is to start the frame numbering at 1.
So you're right for spotting this error, thank you.
You could submit a pull request, so I can merge the solution you proposed.
Or else I'll just make the fix myself.

Anyway thanks again for reaching out.

Happy to help! And I just submitted the pull request.