According to https://docs.spring.io/spring-ai/reference/api/imageclient.html Spring AI only supports two commercial image generators. It would be nice to include Stable Diffusion in the lineup as an alternative, particularly for demonstration purposes. However, I recognize that calling Python programs, as required for Stable Diffusion, involves a more complex process compared to the straightforward REST calls currently in use.

Comment From: markpollack

Contributions welcome - https://stablediffusionapi.com/docs/

Comment From: ullenboom

To clarify, you are referring to a commercial product. The company formerly known as Stable Diffusion API, now ModelsLab, provides a cloud-based API service for easy access to Stable Diffusion and other AI models. However, this service cannot be used to access the free local text-to-image generative AI model, Stable Diffusion.

Comment From: inpink

I have implemented the client for StabilityAI’s Stable Diffusion Image Edit - Remove Background. I would appreciate it if you could review it at your convenience.

1344

Comment From: yonatankarp

While checking online, I discovered that AUTOMATIC1111 has API support around stable diffusion so (hopefully) it can be used with Spring AI as a wrapper.

curl 'http://127.0.0.1:7860/sdapi/v1/txt2img' \
--header 'Content-Type: application/json' \
--data '{
  "prompt": "a beautiful sunset over a mountain range",
  "steps": 50
}'