What are you trying to achieve?
I want to get a new, different image from the Leonardo API each time with a different file name to put into the WP featured image.
Steps taken so far
When I run my modules, I get the same image in my content and thumbnail, even though I have changed the prompt and setting with Leonardo. The file name is the same and doesn’t change_0.jpg at the end. I have tried many different ways, from using Google Sheets to input the URL and change the filename, but it doesn’t work. Used set vars, HTTP get file, and many other ways. Here are some images, but I need some help to get this resolved. Leonardo creates a new image but the file name stays the same and an image for a new article doesn’t show that image it shows one over and over. Thank you for the help
Screenshots: scenario setup, module configuration, errors
Hi @Raymond1 and welcome to Make!
Can you post a screenshot of your scenario? I’m having a bit of trouble understanding 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 seeing your scenario (and the input/output bundles) it will be easier to help you.
L
Hi, this is the basic layout. I did a set and get vars, thinking maybe I could clear the cache, and that may work.
Thanks for the help.
Ray
The image that Leonardo creates and goes to the wp post module for the featured image does not change. When I run the modules again the new image never shows in the wp post module as the previous image shows again and not the new image, even thou leonardo creates a new image. So the first image created stays in featured image and never changes.
Hi,
Is the problem at the HTTP module level? Or the WP module level? Or both? What do the input and output bundles look like after the Leonardo call? Without that information, it’s hard to tell if the HTTP call is getting the correct data.
Also, is the problem happening in a single run of your scenario? Or is every run of the scenario producing the same result? If it’s within a single run, I suspect the set/get variables might not be doing what you expect. If it’s every run, then the Leonardo call may be the problem because it’s always getting the same API call result.
L
The problem is on every run of the scenario and produces the same results. Yes I agree I think it’s Leonardo but don’t know how to fix it.
As you can see 3 articles (testing articles) all same image.
OK, so let’s focus on the Leonardo module.
What is the configuration?
What are the input and the output? Are they different for every run?
The other possible culprit is that the HTTP module is always using the same cell in the Google Sheet. If you’re storing the data from Leonardo there, it could explain the behavior.
L
See images for config
I have tried different prompts and same prompt, but makes no difference as once a image is created it just repeats with new articles.
I took out Google Sheets.
Can you also provide the input and output bundles of the Leonardo call.
Also, can you export and share your blueprint?
Finally, have you tried a very simple scenario where there is only a Leonardo.AI call, nothing else, to see if you get the same image still? I suspect there is something hard-coded in your scenario and every time you run it, you expect to use a different image URL but you’re actually reusing the same URL everytime. But I can’t tell from what I’m seeing so far.
Also, I don’t have a Leonardo API account, so I can’t test 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 problemm. Is Leonardo seeing the exact same prompt from the exact same account and reusing the previous version?
L
Good question if I don’t put a text prompt in, then I get an error. So how do I have different prompt for different articles? I thought about this as well and haven’t come up with any solution.
I have tried simple scenarios and the same results.
If you want and have a email I can send you the blueprint and API to test it.
Hi,
I sent you a message with something else to try. If it works, please let everyone know!
L
After a bit of back and forth we finally found the problem.
The way the module was set up, files were always uploaded with the same name. The way HTTP Get file works is that the generated file name is always “file.jpeg.” The way to differentiate one file from another is by a path. So one solution is to generate a unique file name every time.
One way is to use the functions that already exist in I used this:
Leonardo-{{formatDate(now; “YYYY-MM-DD-HH-ss”)}}-{{13.fileName}}
Which creates a new file every time.
Another option is to use the name that Leonardo generated (and @Raymond2 this came to me after), like this:
{{last(split(1.filename; “/”))}}
Where filename is the URL that Leonardo creates.
L
1 Like