Help referencing future output in n8n

I want to be able to reference previous data from my n8n workflow. I will provide an example to better explain it.

I have a Gemini node that creates 10 image prompts. Each prompt goes into a Gemini image generation node one by one by using a loop node in n8n. After the image is generated, the next prompt goes through the loop. However, what I want is for the next prompt to also use the previous image generated as a reference to the AI model (Nano-Banana) to create a similar environment and style. How do I go about doing this?

This is how my workflow looks like :backhand_index_pointing_up:

2 Likes

If i understand it correct, i would say just put the nano banana node also into the loop.

It is in the loop check the image of the workflow.

I think you want each of the 10 promts to reference the previous promt’s output, or you want each of your gemini promts’ outputs to guide the next nano-banana model. Either way, i think the problem is that first you use text-to-image and then you need to use image-to-image. I don’t believe it can be achieved in just one node.

yeah, you need another image-node in the loop, a second one right behind the irst one