Insert a dynamically generated image from JavaScript into a Google Sheet cell

I’ve got some client-side javascript that generates an image based on passed in parameters, like so:

https://medabots.github.io/medarot3_dialog-previewer-js/?t=%3C%40LL%2C00%2C04%3EIt%27s%20a%20vending%20machine%20that%20sells%20ice%20cream.%3CCF%3E%3C%40LL%2C00%2C04%3EPudding%20ice%20cream…!%3CCF%3E%3C%40LL%2C00%2C04%3ENah...

the generated image

It uses the Canvas API to draw the image.

However, this does not seem to work within Google Sheets. I’d like to take advantage of GitHub pages or Google Sheets such that I don’t need to host this image generation tool on a personally-hosted server.

Specifically, I’ve tried:

=IMAGE(CONCAT("https://medabots.github.io/medarot3_dialog-previewer-js/?t=", ENCODEURL("<%40LL%2C00%2C04>It's a vending machine that sells ice cream.<CF><%40LL%2C00%2C04>Pudding ice cream...!<CF><%40LL%2C00%2C04>Nah...")))

and it doesn’t seem to load at all.

A PHP implementation running on an external server works fine, but I assume this is because an image is being pre-generated and served to the client without any hassle…

Is there any solution that can work with Google Sheets such that I don’t need to host the preview tool myself (e.g. doing this within AppScript)? Or is a hosted solution the only feasible answer?