Currently, many digital artists use generative AI technology as a support to accelerate the delivery of their work. Nowadays it is possible to generate a corresponding image from a text sentence. There are several market solutions for this, including some available to be used through APIs. See some at this link: https://www.analyticsvidhya.com/blog/2023/08/ai-image-generators/.
I created a new application to use in IRIS taking advantage of one of these APIs. I chose the Imagine API. It allows up to 50 free calls per day, and has an interesting paid package that allows you to create thousands of images per month. To subscribe to the API and obtain an API key to use the service go to: https://platform.imagine.art/dashboard/auth.
Then you can use my application, changing your key, generate the JAR, copy it to the root of my IRIS project and then generate your images. My project is at https://github.com/yurimarx/imageaicreator.
The Image AI Creator in action
1. Copy, build and run the docker project:
git clone https://github.com/yurimarx/imageaicreator.git
$ docker-compose build
$ docker-compose up -d
2. Open http://localhost:/swagger-ui/index.html. On swagger explore put http://localhost:/image-ai-creator/_spec:
3. Run the method /generate passing in the body a text with instructions to generate the image (use english):
4. Download the png file on the link Download file and see the results:
5. See the image for the sentence "a ragdoll playing tennis" (the AI knows that ragdoll is type of cat, fantastic!):
Hi Yuri,
very interesting project.
Is there any particular reason for using Java to call a (relatively) simple REST API?
Calling a REST API can be easily implemented in IRIS directly without the "Java layer".
Enrico
This app is subscribed on java comtest and it is a way to demonstrate how easy is call java libraries
It was never a question of this could have been done differently
As I understand it, the important point is that IRIS has some role to play
I understand that IRIS is a multilanguage RPC for the most popular languages, so iris can be the gateway to inter language interoperability. With, in a same class method you can use java, .net and python, for example. It is very poweful!
Thank you Robert for the clarification, really helpful for the community....
I just didn't realized that this article was submitted for the Java Contest, how could I have understood this from the post above? Maybe I lack a bit of imagination
Enrico