I’m working on an app where users can upload an image, initiate an API call to generate an AI image based on a prompt, and then another API call to receive the generated image. However, when attempting the second API call to receive the image, the output is consistently empty. Specifically, if I create the two steps in one workflow, the second API call output always comes back empty—there is no file present.
As a temporary solution, I created a separate page called “result” where the data is successfully received from the database on load. The workflow on this page involves an API call to generate the image, create database entries, and handle images, resulting in a successful outcome.
Now, I’m wondering why making two API calls in the same page doesn’t work as expected, and I’m looking for a solution to avoid creating a new page just to load the result. Any insights or suggestions would be appreciated.