Skip to content

[SD3 Inference] T5 Token limit#8506

Merged
yiyixuxu merged 7 commits into
huggingface:mainfrom
asomoza:token-max-length
Jun 18, 2024
Merged

[SD3 Inference] T5 Token limit#8506
yiyixuxu merged 7 commits into
huggingface:mainfrom
asomoza:token-max-length

Conversation

@asomoza
Copy link
Copy Markdown
Member

@asomoza asomoza commented Jun 13, 2024

What does this PR do?

Adds an argument max_sequence_length to set the token limit for the T5.

Prompt:

A whimsical and creative image depicting a hybrid creature that is a mix of a waffle and a hippopotamus. This imaginative creature features the distinctive, bulky body of a hippo, but with a texture and appearance resembling a golden-brown, crispy waffle. The creature might have elements like waffle squares across its skin and a syrup-like sheen. It’s set in a surreal environment that playfully combines a natural water habitat of a hippo with elements of a breakfast table setting, possibly including oversized utensils or plates in the background. The image should evoke a sense of playful absurdity and culinary fantasy.

Before max_sequence_length=256
20240612204503_2888268196 20240612204440_2888268196

I did a quick test with enabling long prompts for the clip models but it didn't make any noticeable difference, so for now this PR will only enable the long prompt for the T5 to avoid adding more code and complexity to the pipeline.

Who can review?

Anyone in the community is free to review

@asomoza asomoza changed the title max_sequence_length for the T5 T5 Token limit Jun 13, 2024
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@yiyixuxu yiyixuxu mentioned this pull request Jun 13, 2024
@asomoza
Copy link
Copy Markdown
Member Author

asomoza commented Jun 14, 2024

the failing test is not from this PR

@asomoza asomoza marked this pull request as ready for review June 14, 2024 00:13
@asomoza asomoza requested review from sayakpaul and yiyixuxu June 14, 2024 00:14
Copy link
Copy Markdown
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

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

thanks!

Comment thread src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_img2img.py Outdated
Comment thread src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_img2img.py Outdated
@asomoza asomoza changed the title T5 Token limit [SD3 Inference] T5 Token limit Jun 14, 2024
Comment thread src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py Outdated
Copy link
Copy Markdown
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Thanks for the prompt PR. I left some questions. Overall this looks good to me. My only concern is that we're introducing a change that might lead to different results for the same prompt.

@yiyixuxu yiyixuxu merged commit f3209b5 into huggingface:main Jun 18, 2024
@yiyixuxu
Copy link
Copy Markdown
Collaborator

@asomoza can we add a section to the doc (in a new PR)?

@asomoza asomoza deleted the token-max-length branch June 18, 2024 16:58
yiyixuxu added a commit that referenced this pull request Jun 20, 2024
* max_sequence_length for the T5

* updated img2img

* apply suggestions

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: YiYi Xu <yixu310@gmail.com>
sayakpaul added a commit that referenced this pull request Dec 23, 2024
* max_sequence_length for the T5

* updated img2img

* apply suggestions

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: YiYi Xu <yixu310@gmail.com>
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.

5 participants