Skip to content

Sd example opt#261

Merged
mrwyattii merged 13 commits into
masterfrom
SD-example-opt
Jun 14, 2023
Merged

Sd example opt#261
mrwyattii merged 13 commits into
masterfrom
SD-example-opt

Conversation

@PareesaMS
Copy link
Copy Markdown
Contributor

@PareesaMS PareesaMS commented Apr 6, 2023

Applies optimization to the SD example:

  • Adds opt_percentage argument which determines which percentage of the iterations to be optimized. For instance opt_percentage = 0 means no optimization and opt_percentage = 20 means %20 of the iterations to be optimized
  • Adds prompt and guidance scale as input arguments
  • The SD pipeline is extracted from the HF library and replaces with the local version which includes the optimization: local_pipeline_stable_diffusion.py
  • The optimization includes limiting the noise computation to only conditional noise for the optimized iterations. This cuts the UNET computation in half for those iterations.

Comment thread inference/huggingface/stable-diffusion/test-stable-diffusion.py Outdated
Comment thread inference/huggingface/stable-diffusion/test-stable-diffusion.py Outdated
@mrwyattii mrwyattii merged commit 353603d into master Jun 14, 2023
@mrwyattii mrwyattii deleted the SD-example-opt branch June 14, 2023 23:32
hwchen2017 pushed a commit that referenced this pull request Jun 8, 2025
Co-authored-by: Pareesa <pgolnari@gmail.com>
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.

4 participants