mirror of
https://github.com/mudler/LocalAI.git
synced 2026-09-22 06:04:55 -04:00
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:
3 files changed
+11
-4
No files matched your search
@@ -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 '{
|
||||
|
||||
Reference in new issue
Block a user