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

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 '|'.


Assisted-by: Pi: DeepSeek V4 Pro

Signed-off-by: Fedor Zuev <Fedor.Zuev@gmail.com>
This commit is contained in:
lqp authored and GitHub committed 2026-09-18 23:28:14 +02:00
1 parent d1ceeaa99a
commit dbee3db07f
3 files changed
+11 -4

No files matched your search

+2 -2
View File
@@ -24,9 +24,9 @@ curl http://localhost:8080/v1/images/generations -H "Content-Type: application/j
}'
```
Available additional parameters: `mode`, `step`.
Available additional parameters: `mode`, `step`, `negative_prompt`.
Note: To set a negative prompt, you can split the prompt with `|`, for instance: `a cute baby sea otter|malformed`.
To set a negative prompt you can either pass a separate `negative_prompt` field or split the prompt with `|`, e.g. `a cute baby sea otter|malformed`. When both are present they are joined with a comma (`negative_prompt` first, then the `|`-suffixed tags), so a global negative prompt can live in `negative_prompt` while per-image negatives are appended after `|`.
```bash
curl http://localhost:8080/v1/images/generations -H "Content-Type: application/json" -d '{