Skip to content

Add negative_prompt parameter to GLMImagePipeline#13422

Open
akshan-main wants to merge 1 commit intohuggingface:mainfrom
akshan-main:add-negative-prompt-glm-image
Open

Add negative_prompt parameter to GLMImagePipeline#13422
akshan-main wants to merge 1 commit intohuggingface:mainfrom
akshan-main:add-negative-prompt-glm-image

Conversation

@akshan-main
Copy link
Copy Markdown

@akshan-main akshan-main commented Apr 6, 2026

What does this PR do?

Fixes #13421

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

Discussed in #13416

Changes:

  • Added negative_prompt: str | list[str] | None = None parameter to __call__() and encode_prompt()
  • Falls back to "" when None (backward compatible)
  • Added length validation when negative_prompt is a list
  • Updated docstrings

Before submitting

Who can review?

@asomoza @sayakpaul @yiyixuxu

@yiyixuxu
Copy link
Copy Markdown
Collaborator

yiyixuxu commented Apr 6, 2026

hi @akshan-main

Thanks for the PR, however, I think the parameter was not exposed by design because this pipeline does not accept negative_prompt - the model was not trained to work with a custom negative prompt

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.

Add negative_prompt parameter to GLMImagePipeline

2 participants