Skip to content
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

add capability to interrupt the pipeline #119

Merged
merged 2 commits into from
Feb 4, 2024

Conversation

machineminded
Copy link
Contributor

This PR adds the ability to interrupt the pipeline by passing a callback_on_step_end argument per documentation here:

https://huggingface.co/docs/diffusers/en/using-diffusers/callback#interrupt-the-diffusion-process

The example usage provided in the URL above should work as it is what I am using in Fooocus:

https://github.com/machineminded/Fooocus-inswapper/blob/main/modules/pm.py#L22
https://github.com/machineminded/Fooocus-inswapper/blob/main/modules/pm.py#L131

prompt_embeds = callback_outputs.pop("prompt_embeds", prompt_embeds)
negative_prompt_embeds = callback_outputs.pop("negative_prompt_embeds", negative_prompt_embeds)
add_text_embeds = callback_outputs.pop("add_text_embeds", add_text_embeds)
# negative_pooled_prompt_embeds = callback_outputs.pop(
Copy link
Contributor Author

@machineminded machineminded Feb 4, 2024

Choose a reason for hiding this comment

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

Not sure if these commented lines are needed or not?

@Paper99
Copy link
Collaborator

Paper99 commented Feb 4, 2024

Thanks for your great work!
We've merged your PR.

@Paper99 Paper99 merged commit 93044f8 into TencentARC:main Feb 4, 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.

2 participants