Leonardo AI, cannot send "num_images" parameter

image
pretty much, in the documentation i have a header “num_images” but when I input in n8n the number 1 it keeps saying that it received a string. Seems like it’s an n8n issue and not API problem. any ideas?
image

if I remove this header it works.

{
“nodes”: [
{
“parameters”: {
“method”: “POST”,
“url”: “https://cloud.leonardo.ai/api/rest/v1/generations”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “accept”,
“value”: “application/json”
},
{
“name”: “authorization”,
“value”: “Bearer API KEY”
}
]
},
“sendBody”: true,
“bodyParameters”: {
“parameters”: [
{
“name”: “modelId”,
“value”: “de7d3faf-762f-48e0-b3b7-9d0ac3a3fcf3”
},
{
“name”: “contrast”,
“value”: 3.5
},
{
“name”: “prompt”,
“value”: “={{ $json.prompt }}”
},
{
“name”: “width”,
“value”: 1472
},
{
“name”: “height”,
“value”: 832
},
{
“name”: “alchemy”,
“value”: true
},
{
“name”: “styleUUID”,
“value”: “111dc692-d470-4eec-b791-3475abac4c46”
},
{
“name”: “enhancePrompt”,
“value”: false
},
{
“name”: “num_images”,
“value”: “=1”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
3640,
1060
],
“id”: “3798193e-e8a2-448a-a2ca-16bdae9d51d5”,
“name”: “Generate Images”
}
],
“connections”: {
“Generate Images”: {
“main”: [

]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “8d0a33e40c50c7588fc6e8e558ef4d17e4f3f04ca1f5be07284ae05f5afb0ffe”
}
}

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Running n8n via (n8n cloud

  • **Operating system: windows 11

image

for anyone having the same issue, this seemed to work

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.