Have others been able to run text-to-
Have others been able to run text-to-image models in NextJS apps that run on Pages? I have a nextJS app set up via C3 and a server action performing the following:
However, I'm running into
Error: A Node.js API is used (DecompressionStream) which is not supported in the Edge Runtime. Learn more: https://nextjs.org/docs/api-reference/edge-runtime
I'm guessing there some decompression going on under the hood with the AI interface?
If it matters, my next step is to write the response as a file to R2, so I'm not sure that I actually need to decompress for my purposes...1 Reply
For anyone reading this in the future,
what worked for me was to push all of the AI operations I was running into a separate worker that I then added to my NextJS app as a Service Binding (https://developers.cloudflare.com/workers/configuration/bindings/about-service-bindings/). This works well for my needs.