Skip to content

Conversation

@a-r-r-o-w
Copy link
Contributor

No description provided.

@a-r-r-o-w a-r-r-o-w changed the title Fix latent image ids and vae sample generators for flux Fix prepare latent image ids and vae sample generators for flux Nov 21, 2024
Copy link
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!

@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.

@a-r-r-o-w
Copy link
Contributor Author

a-r-r-o-w commented Nov 21, 2024

Wow, changing a randomly sampled latent (on every CI test run so far) to an actually properly seeded sampled latent breaks the test 😭

@yiyixuxu
Copy link
Collaborator

@a-r-r-o-w that's expected, no?

@a-r-r-o-w
Copy link
Contributor Author

Oh sorry, I misunderstood/forgot what was going on. We did always seed the test before, but it was globally seeded. Now we use a different seed/generator passed into the pipeline so yes, this is expected.


if latents is not None:
latent_image_ids = self._prepare_latent_image_ids(batch_size, height, width, device, dtype)
latent_image_ids = self._prepare_latent_image_ids(batch_size, height // 2, width // 2, device, dtype)
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, do you mean I am reverting a previous change that was necessary for something? I have been trying to pass latents for testing purposes but it always fails at this point unless the height and width are correctly adjusted -- it makes sense to me when comparing with other pipelines and doing rough calculation with tensor shapes, but LMK if this is wrong

Copy link
Collaborator

@DN6 DN6 Nov 21, 2024

Choose a reason for hiding this comment

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

No this is fine. We missed scaling the height and width when passing in latents. We do it here when latents aren't passed. Change is good 👍🏽

latent_image_ids = self._prepare_latent_image_ids(batch_size, height // 2, width // 2, device, dtype)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh okay. Then I'll update the slices and merge once CI is green

@a-r-r-o-w
Copy link
Contributor Author

I think only need to update slice for test_controlnet_flux.py despite there being similar changes for other flux pipelines with generator, because pipeline_flux_controlnet_image_to_image and pipeline_flux_controlnet_inpainting don't seem to have individual tests.

@a-r-r-o-w a-r-r-o-w merged commit cd6ca9d into main Nov 21, 2024
16 of 18 checks passed
@a-r-r-o-w a-r-r-o-w deleted the fix-flux-latents branch November 21, 2024 07:32
lawrence-cj pushed a commit to lawrence-cj/diffusers that referenced this pull request Nov 26, 2024
sayakpaul pushed a commit that referenced this pull request Dec 23, 2024
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.

6 participants