Skip to content

Fix: add SD negative prompt graph wiring and history - #9243

Merged
lstein merged 5 commits into
invoke-ai:mainfrom
DustyShoe:fix/sd-negative-prompt-history
Jun 6, 2026
Merged

Fix: add SD negative prompt graph wiring and history#9243
lstein merged 5 commits into
invoke-ai:mainfrom
DustyShoe:fix/sd-negative-prompt-history

Conversation

@DustyShoe

@DustyShoe DustyShoe commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes SD negative prompt graph wiring and prompt history behavior.

SD1/SD2, SDXL, SD3, and multidiffusion upscale graphs now create a dedicated negative prompt string node and wire it into negative conditioning and negative_prompt metadata. The enqueue batch config also batches the negative prompt node using the preset-modified negative prompt, matching the positive prompt node flow.

Prompt history now stores positive and negative prompts together in one history item. Reusing a history item restores both prompts, search matches both fields, and old string-only prompt history entries are migrated to the new pair shape.

Related Issues / Discussions

N/A

QA Instructions

QA Instructions

  1. Select an SD1.5 or SDXL model.
  2. Enter a positive prompt and a negative prompt.
  3. Generate an image.
  4. Open the generated image in the workflow editor and verify the negative prompt string node is wired to the negative conditioning input and the metadata negative_prompt input connector.
  5. Repeat with multidiffusion upscale and verify the negative prompt string node is wired to the negative conditioning input and the metadata negative_prompt input connector.
  6. Open prompt history from the positive prompt field.
  7. Verify one history entry shows both Prompt: and Negative Prompt:.
  8. Click the history entry and verify both positive and negative prompt fields are restored.
  9. Use Alt+Up/Down in the positive prompt field and verify both prompts are restored together.

Merge Plan

No special merge plan. This is a frontend-only change with no backend schema or generated API type changes expected.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions Bot added the frontend PRs that change frontend files label May 27, 2026
@lstein lstein added the 6.13.5 Library Updates label May 27, 2026
@lstein lstein moved this to 6.13.5 LIBRARY UPDATES in Invoke - Community Roadmap May 27, 2026

@lstein lstein left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code clean. Works as advertised.

I added guards to protect against the negativePromptChanged dispatching when the active model doesn't support a negative prompt. This is to avoid the negative prompt persisting but not visible in the UI and then resurfacing when switching to a model that does support negative prompts.

@lstein
lstein merged commit df83fd0 into invoke-ai:main Jun 6, 2026
14 checks passed
@DustyShoe
DustyShoe deleted the fix/sd-negative-prompt-history branch June 13, 2026 10:15
dunkeroni pushed a commit to dunkeroni/InvokeAI that referenced this pull request Jun 29, 2026
* Fix: add SD negative prompt graph wiring and history

* Guard negativePromptChanged dispatch to only run in models that support negative prompt

---------

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.13.5 Library Updates frontend PRs that change frontend files

Projects

Status: 6.13.5 LIBRARY UPDATES

Development

Successfully merging this pull request may close these issues.

3 participants