Skip to content

feat(openai): add negative_prompt field to image generation request - #12031

Merged
mudler merged 2 commits into
mudler:masterfrom
lqp:master
Sep 18, 2026
Merged

mudler merged 2 commits into
mudler:masterfrom
lqp:master

Conversation

@lqp

@lqp lqp commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Description

Expose a negative_prompt string parameter on the image endpoints, as is customary in many programs. When both the negative_prompt parameter and a '|'-suffixed negative prompt in the main prompt are present, they are joined with a comma so callers can keep a global negative prompt in negative_prompt and add per-image negative tags after '|'.

Why

I use LocalAI's /v1/images/generations endpoint to auto-generate images in TAVO AI, an Android RPG AI chatbot frontend. It is very inconvenient to have the negative prompt in the "positive prompt|negative prompt" format β€” I have to reconfigure the whole app every time I change the image generation model. With "negative_prompt" (provided by most other programs, from kobold.cpp to vLLM), a separate model definition for each model is enough.

Testing

I compiled the binary and manually tested the negative_prompt passthrough (using the aforementioned TAVO AI).

Run tests:

- go vet ./core/schema/... ./core/http/endpoints/openai/...   OK
- go test ./core/schema/...   ok
- go test ./core/http/endpoints/openai/...   ok

Signed commits

  • [ X] Yes, I signed my commits.
  • [X ] Documentation updated (docs/content/) for user-facing changes, or not applicable

lqp added 2 commits September 14, 2026 03:18
Expose a negative_prompt string parameter on the image endpoints,
matching Stable Diffusion WebUI / vLLM-Omni conventions. When both the
negative_prompt parameter and a '|'-suffixed negative prompt in the
main prompt are present, they are joined with a comma so callers can
keep a global negative prompt in negative_prompt and add per-image
negative tags after '|'.

Signed-off-by: Fedor Zuev <Fedor.Zuev@gmail.com>
Assisted-by: Pi: DeepSeek V4 Pro
@mudler
mudler disabled auto-merge September 18, 2026 21:28
@mudler
mudler merged commit dbee3db into mudler:master Sep 18, 2026
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants