Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
a00c73a5
Unverified
Commit
a00c73a5
authored
Apr 22, 2025
by
josephrocca
Committed by
GitHub
Apr 21, 2025
Browse files
Support different-length pos/neg prompts for FLUX.1-schnell variants like Chroma (#11120)
Co-authored-by:
YiYi Xu
<
yixu310@gmail.com
>
parent
0434db9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
src/diffusers/pipelines/flux/pipeline_flux.py
src/diffusers/pipelines/flux/pipeline_flux.py
+2
-10
No files found.
src/diffusers/pipelines/flux/pipeline_flux.py
View file @
a00c73a5
...
...
@@ -490,14 +490,6 @@ class FluxPipeline(
f
"
{
negative_prompt_embeds
}
. Please make sure to only forward one of the two."
)
if
prompt_embeds
is
not
None
and
negative_prompt_embeds
is
not
None
:
if
prompt_embeds
.
shape
!=
negative_prompt_embeds
.
shape
:
raise
ValueError
(
"`prompt_embeds` and `negative_prompt_embeds` must have the same shape when passed directly, but"
f
" got: `prompt_embeds`
{
prompt_embeds
.
shape
}
!= `negative_prompt_embeds`"
f
"
{
negative_prompt_embeds
.
shape
}
."
)
if
prompt_embeds
is
not
None
and
pooled_prompt_embeds
is
None
:
raise
ValueError
(
"If `prompt_embeds` are provided, `pooled_prompt_embeds` also have to be passed. Make sure to generate `pooled_prompt_embeds` from the same text encoder that was used to generate `prompt_embeds`."
...
...
@@ -821,7 +813,7 @@ class FluxPipeline(
(
negative_prompt_embeds
,
negative_pooled_prompt_embeds
,
_
,
negative_text_ids
,
)
=
self
.
encode_prompt
(
prompt
=
negative_prompt
,
prompt_2
=
negative_prompt_2
,
...
...
@@ -938,7 +930,7 @@ class FluxPipeline(
guidance
=
guidance
,
pooled_projections
=
negative_pooled_prompt_embeds
,
encoder_hidden_states
=
negative_prompt_embeds
,
txt_ids
=
text_ids
,
txt_ids
=
negative_
text_ids
,
img_ids
=
latent_image_ids
,
joint_attention_kwargs
=
self
.
joint_attention_kwargs
,
return_dict
=
False
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment