Skip to content

Test sigmas in PipelineTesterMixin #10101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SahilCarterr
Copy link
Contributor

@SahilCarterr SahilCarterr commented Dec 3, 2024

What does this PR do?

Added sigmas test for FluxPipelines

Continuation of Issues #10071 and #10081
Adding Test for PR #10081

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed.
@yiyixuxu

@hlky
Copy link
Contributor

hlky commented Dec 3, 2024

Thanks @SahilCarterr! I think we can add this to the PipelineTesterMixin so it works with all supported pipelines.

class PipelineTesterMixin:

def test_cfg(self):
sig = inspect.signature(self.pipeline_class.__call__)
if "guidance_scale" not in sig.parameters:
return
components = self.get_dummy_components()
pipe = self.pipeline_class(**components)
pipe = pipe.to(torch_device)
pipe.set_progress_bar_config(disable=None)
inputs = self.get_dummy_inputs(torch_device)
inputs["guidance_scale"] = 1.0
out_no_cfg = pipe(**inputs)[0]
inputs["guidance_scale"] = 7.5
out_cfg = pipe(**inputs)[0]
assert out_cfg.shape == out_no_cfg.shape

cc @sayakpaul @DN6 WDYT? We currently test this for AYS schedule on stable_diffusion and stable_diffusion_xl pipelines

def test_stable_diffusion_ays(self):

@sayakpaul
Copy link
Member

sayakpaul commented Dec 4, 2024

cc @sayakpaul @DN6 WDYT? We currently test this for AYS schedule on stable_diffusion and stable_diffusion_xl pipelines

Indeed! Perhaps a better way to cover scheduler compatibility for pipelines would be to define a known scheduler support matrix somewhere at the top of the test_pipelines_common and loop through it. But this is just an idea and I am okay if we want to do it in some other way.

@hlky
Copy link
Contributor

hlky commented Dec 4, 2024

@SahilCarterr would you like to move this test into PipelineTesterMixin? or I can take over if you'd prefer.

@hlky
Copy link
Contributor

hlky commented Dec 4, 2024

@SahilCarterr Thanks for moving the test! Looks like some changes to example notebooks got added to this PR, could we remove that?

This reverts commit 5d6b21c.
make style and quality automatically formated these files
@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.

@SahilCarterr
Copy link
Contributor Author

Just removed it. Notebooks were added due to make style and quality

@hlky
Copy link
Contributor

hlky commented Dec 4, 2024

Looks like this has revealed issues with some pipelines, I've found similar issues adding a test for timesteps. I'll work through them to determine if the argument is unsupported (due to required scheduler etc.) or if there's something to be fixed.

@SahilCarterr
Copy link
Contributor Author

Thank you for the update and for looking into these issues and further Continuing this PR ! I appreciate your efforts in working through them. @hlky

@hlky hlky added the wip label Dec 4, 2024
@hlky hlky changed the title [Add]Added sigmas test for FluxPipelines Test sigmas in PipelineTesterMixin Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants