Skip to content

Conversation

@lawfordp2017
Copy link
Contributor

@lawfordp2017 lawfordp2017 commented Mar 16, 2024

What does this PR do?

For Stable Cascade:
Adds support for non-integral image resolutions (I.e. not divisible by 32) when the model quantization choice is other than float32 (I.e. using bfloat16 et al.)

Fixes #7355

Before submitting

Who can review?

@sayakpaul @yiyixuxu @DN6

@sayakpaul sayakpaul requested review from DN6 and kashif March 17, 2024 15:30
x = torch.nn.functional.interpolate(
x.float(), skip.shape[-2:], mode="bilinear", align_corners=True
)
x = x.type(orig_type)
Copy link
Collaborator

@DN6 DN6 Mar 18, 2024

Choose a reason for hiding this comment

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

Could we use x = x.to(orig_dtype) just to be consistent with how casting in done in other parts of the library.

Copy link
Collaborator

@DN6 DN6 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 catching! Could we add a similar casting operation to the training section as well.

@HuggingFaceDocBuilderDev

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.

@lawfordp2017
Copy link
Contributor Author

Thanks for the suggestions, I've changed the casting call and added the same code in the corresponding training location.

@sayakpaul sayakpaul requested a review from DN6 March 19, 2024 02:27
@sayakpaul
Copy link
Member

@DN6 good to merge?

Copy link
Collaborator

@DN6 DN6 left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏽

@DN6 DN6 merged commit 139f707 into huggingface:main Mar 19, 2024
@lawfordp2017 lawfordp2017 deleted the cascade_interpolated_resolution branch March 29, 2024 02:39
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.

Stable Cascade, error when generating images with arbitrary resolutions and bfloat16.

5 participants