-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Modify the implementation of retrieve_timesteps in CogView4-Control. #11125
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
Conversation
…diffusers into cogview4_control
…diffusers into cogview4_control
…diffusers into cogview4_control
@@ -100,10 +100,19 @@ def retrieve_timesteps( | |||
`Tuple[torch.Tensor, int]`: A tuple where the first element is the timestep schedule from the scheduler and the | |||
second element is the number of inference steps. | |||
""" | |||
accepts_timesteps = "timesteps" in set(inspect.signature(scheduler.set_timesteps).parameters.keys()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's update the # Copied from
comment to point to CogView4 pipeline file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that how I understand it?
@@ -68,7 +68,7 @@ def calculate_shift( | |||
return mu | |||
|
|||
|
|||
# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.retrieve_timesteps | |||
# Copied from diffusers.pipelines.cogview4.pipeline_cogview4.retrieve_timesteps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the change here is correct @zRzRzRzRzRzRzR
@@ -100,10 +100,20 @@ def retrieve_timesteps( | |||
`Tuple[torch.Tensor, int]`: A tuple where the first element is the timestep schedule from the scheduler and the | |||
second element is the number of inference steps. | |||
""" | |||
# Copied from diffusers.pipelines.cogview4.pipeline_cogview4.retrieve_timesteps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Copied from diffusers.pipelines.cogview4.pipeline_cogview4.retrieve_timesteps |
This is not needed. Please also run make fix-copies
after removing this to ensure that both the implementation in this file and in pipeline_cogview4.py is the same 🤗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have completed the verification, running make fix-copies did not produce any errors or other improvement suggestions
I have completed the modification. @a-r-r-o-w can check if there are any other places that need to be modified. |
Examples: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zRzRzRzRzRzRzR These should not be removed, otherwise the tests will fail: https://github.com/huggingface/diffusers/actions/runs/14009637640/job/39228136089?pr=11125#step:15:64
Let's add this back and we should be good to merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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. |
@bot /style |
Style fixes have been applied. View the workflow run here. |
Use CogView4 Models one