Bug description I have a basic setup where I call stability image generation API with minimal options and I get a 404 error in API response.

404 - {"id":"0f91b262f6b5728385f167fe34688ec8","message":"The specified engine (ID stable-diffusion-v1-6) was not found.","name":"not_found"}

org.springframework.ai.retry.NonTransientAiException: 404 - {"id":"0f91b262f6b5728385f167fe34688ec8","message":"The specified engine (ID stable-diffusion-v1-6) was not found.","name":"not_found"}

When I tried changing the stability engine/model, it didn't work and I keep getting the same error back from API.

Environment Development environment: Java version: 21 Spring boot: 3.4.4 Spring AI: 1.0.3

Steps to reproduce Here is a sample call to the stability API

stabilityAiImageModel.call(
            new ImagePrompt("A light cream colored mini golden doodle",
                StabilityAiImageOptions.builder()
                    .stylePreset("cinematic")
                    .N(1)
                    .height(512)
                    .model("stable-diffusion-xl-1024-v1-0")
                    .width(512).build())
                );

Above call results in 404 - Not found error mentioned above.

Expected behavior Client should be able to chose the engine/model from stability to use for image generation.

Comment From: startcodeing

I have same problem, even when i have changed the model. Is there any way to slove this?

Comment From: runishkumar

@startcodeing You could set the model name in the configuration file application.yml and then it works.

But, the issue should still be fixed and allow the devs to set the model at runtime in my opinion.

Comment From: ShadowSlayer03

Hey guys @startcodeing @runishkumar, Did you come across any potential fix for this problem?

I tried something like this in application.properties: spring.ai.stabilityai.image.option.model=stable-diffusion-3.5-flash But this didn't work.

Also tried this snippet to override the default model but it didn't work as well.

public String generateImageFromAI(@RequestParam String query) { ImageOptions options = StabilityAiImageOptions.builder() .model("stable-diffusion-3.5-flash") .stylePreset("cinematic") .N(4) .height(1024) .width(1024) .build();

    ImageResponse response = stabilityaiImageModel.call(
            new ImagePrompt(query, options)
    );

    return response.toString();
}