spring-projects / spring-projects/spring-ai

Unable to change image generation model for stability API

Open
#4,580 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stabilityai
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the StabilityAiImageModel.call invocation and StabilityAiImageOptions.builder shown in the issue, then inspect how the model option is sent to the Stability API. Reproduce the call with the supplied model value and verify that changing the model produces a request accepted by the API rather than the same 404 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
ai, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.