Issues with creating a custom LeonardoAI node

Hey, I’m trying to create a custom node to use LeonardoAI to generate images based on a prompt. When testing the node I get this error:

Leonardo Image generation Failed!
Command exited with code 1 and error:
Traceback (most recent call last):
File “/index.py”, line 90, in
print(‘FUNCTION_OUTPUT\n’ + str(main(‘girl riding a horse’, {})))
File “/index.py”, line 89, in main
return Image
NameError: name ‘Image’ is not defined

Here is the run link: https://www.gumloop.com/custom-nodes/builder?node_id=hkCLbmfqfMA5hKX54fUEmp

Hey @grube386 - It’s actually not possible to return files from the run code node or custom nodes at the moment. The recommendation we give here is uploading the file to some external store within the code itself (ie. Amazon S3), and then outputting an accessible link to the file

This topic was solved and automatically closed 60 minutes after the last reply. New replies are no longer allowed.