Auto post to IG, Facebook and tiktok with text on image posts?

I am wondering is there any opensource app that I can use to generate text over image for social media posting?

The idea is, I will feed the content of the post to ai engine, such as:

Create social media content about Java variables (max 500 words). The content will be used for a single post, but may be divided into multiple images. Break the content into paragraphs with a maximum of 100 words each (up to 9 blocks). Format the output in JSON with title, content blocks, and hashtags.

Then another engine to take block contents generate a few random vector background images, and the 3rd app to print the content to the images (one block per image, make the text fit the image, align horizontal and vertically, with some effects, such as bordered, shadow etc)

Any recommendations? For generating the content and image which model is good for it? If can be done in one that would be better.

However, for overlaying text on image, is there any open source code does the similar thing? For this task, I don’t think AI is a good fit.

Thanks!