Skip to content

Add negative_prompt to Flux2KleinPipeline#13420

Closed
akshan-main wants to merge 1 commit intohuggingface:mainfrom
akshan-main:add-negative-prompt-flux2-klein
Closed

Add negative_prompt to Flux2KleinPipeline#13420
akshan-main wants to merge 1 commit intohuggingface:mainfrom
akshan-main:add-negative-prompt-flux2-klein

Conversation

@akshan-main
Copy link
Copy Markdown

What does this PR do?

Fixes #13416

Adds negative_prompt parameter to Flux2KleinPipeline.__call__(). Previously, the unconditional prompt was hardcoded to "" when CFG was active, with no way for users to provide a custom negative prompt.

Changes:

  • Added negative_prompt: str | list[str] | None = None parameter
  • Falls back to "" when None (backward compatible)
  • Added length validation when both prompt and negative_prompt are lists
  • Fixed negative_prompt_embeds type hint from str | list[str] to torch.Tensor
  • Updated docstrings

Fixes #13416

Before submitting

Who can review?

@asomoza @sayakpaul

@yiyixuxu
Copy link
Copy Markdown
Collaborator

yiyixuxu commented Apr 6, 2026

hi @akshan-main,

We did not expose negative_prompt in flux2-klein base the original model does not accept it and we'd like to respect that.

however if community find a strong usewhere where custom negative prompt can make a meaninful improvement over the generatrion quality, happy to support that in modular

@akshan-main
Copy link
Copy Markdown
Author

got it! closing now

@akshan-main akshan-main closed this Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

how to use zimage and flux2 with negative prompt?

2 participants