What are you trying to achieve?
I aim to retrieve a new, distinct image from the Leonardo API each time, with a unique file name, to set as the featured image in WordPress.
Steps taken so far
When I execute my modules, I consistently receive the same image in my content and thumbnail, despite modifying the prompt and settings within Leonardo. The file name remains unchanged, always ending with _0.jpg. I've experimented with various methods, including using Google Sheets to input the URL and alter the filename, but without success. I've also tried using set variables, HTTP get file, and numerous other approaches. I've included some screenshots below and would appreciate assistance in resolving this issue. Leonardo generates a new image, but the filename persists, and consequently, new articles display the same image repeatedly. Thank you for your help.
Screenshots: scenario setup, module configuration, errors
Hi and welcome to callin.io!
Could you share a screenshot of your scenario? I'm having a little difficulty grasping what you mean by “I get the same image in my content and thumbnail, even though I have changed the prompt and setting with Leonardo.”
By viewing your scenario (and the input/output bundles), it will be simpler to assist you.
L
The image generated by Leonardo and sent to the WordPress post module for the featured image does not update. When I re-run the modules, the new image never appears in the WordPress post module; the previous image is displayed again, not the new one, even though Leonardo is creating a new image. Consequently, the first image created remains as the featured image and never changes.
Hi,
Is the issue related to the HTTP module, the WP module, or both? Could you please show the input and output bundles following the Leonardo call? Without this detail, it's difficult to determine if the HTTP request is receiving the correct data.
Furthermore, is this problem occurring in just one execution of your scenario, or are all executions yielding the same outcome? If it's isolated to a single run, I suspect the set/get variables might not be functioning as anticipated. If it's happening in every run, the Leonardo call itself could be the source of the problem, as it might consistently be retrieving the same API call result.
L
Alright, let's concentrate on the Leonardo module.
What does the configuration look like?
What are the inputs and outputs? Do they vary with each execution?
Another potential issue could be that the HTTP module consistently utilizes the same cell within the Google Sheet. If you're saving data from Leonardo there, this might account for the observed behavior.
L
Please see the attached images for the configuration.
I've experimented with various prompts, including using the same one repeatedly, but it doesn't alter the outcome. Once an image is generated, it simply continues to produce new articles.
I have removed the Google Sheets integration.
Could you also share the input and output bundles for the Leonardo call?
Additionally, would you be able to export and share your blueprint?
Finally, have you attempted a very basic scenario consisting solely of a Leonardo.AI call, with no other components, to check if you're still encountering the same image issue? I suspect there might be something hard-coded within your scenario, causing it to reuse the same URL each time you run it, despite expecting a different one. However, I cannot confirm this based on the information provided so far.
Furthermore, I do not have a Leonardo API account, which prevents me from testing this directly.
L
One thing I just noticed in your last picture: your prompt is hard coded (“A professional setting (e.g….”). I wonder if that’s not the issue. Is Leonardo seeing the exact same prompt from the exact same account and reusing the previous version?
Hi,
I've sent you a message with an alternative to try. If it proves successful, kindly share your findings with the community!
L
After some discussion, we identified the issue.
The module was configured such that files were consistently uploaded with the same filename. The HTTP Get file operation generates filenames as "file.jpeg" by default. To distinguish between different files, a path is used. Therefore, one solution is to create a unique filename for each upload.
One method involves utilizing existing functions. I used the following:
Leonardo-{{formatDate(now; “YYYY-MM-DD-HH-ss”)}}-{{13.fileName}}
This generates a new filename for each instance.
An alternative approach is to use the filename generated by Leonardo, as suggested later, like this:
{{last(split(1.filename; “/”))}}
Here, filename
refers to the URL provided by Leonardo.