Generating Images via Stability AI Service on Wix Platform

Question:
Hello Wix Community,

I’ve built a platform on the Wix platform that allows users to generate images using the Stability AI service. The workflow is as follows:

  1. Users enter details (prompt, output format, etc.) in an input form on the frontend.
  2. The frontend sends a request to a Wix Function that handles the image generation.
  3. The Wix Function makes a request to the Stability AI service to generate the image based on the user’s input.
  4. The Wix Function receives a base64-encoded image in the response from the Stability AI service.
  5. The Wix Function then returns the base64-encoded image to the frontend.

However, I’m encountering an issue with the response from the Stability AI service. I’m receiving the following error:

Code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
This distribution is not configured to allow the HTTP request method that was used for this request. The distribution supports only cachable requests.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: 5KWYkMwbISWkfOCAcY4PLXBsn-Pad4-pKRJpse-BjCMre9n5VzlIWA==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>

Based on the error message, it seems that the issue is related to the CloudFront distribution configuration. I’ve checked the distribution settings, but I’m not sure how to resolve this issue.

Can the Wix community please provide any guidance or suggestions on how to troubleshoot and resolve this problem? I’m open to any advice or best practices for generating images using the Stability AI service within the Wix platform.

Thank you in advance for your help!