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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LCM] add: locm docs. #5723

Merged
merged 10 commits into from
Nov 9, 2023
Merged

[LCM] add: locm docs. #5723

merged 10 commits into from
Nov 9, 2023

Conversation

sayakpaul
Copy link
Member

No description provided.

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

docs/source/en/using-diffusers/lcm.md Outdated Show resolved Hide resolved
docs/source/en/using-diffusers/lcm.md Show resolved Hide resolved
docs/source/en/using-diffusers/lcm.md Outdated Show resolved Hide resolved
docs/source/en/using-diffusers/lcm.md Outdated Show resolved Hide resolved
docs/source/en/using-diffusers/lcm.md Outdated Show resolved Hide resolved
docs/source/en/using-diffusers/lcm.md Outdated Show resolved Hide resolved
docs/source/en/using-diffusers/lcm.md Outdated Show resolved Hide resolved
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 9, 2023

The documentation is not available anymore as the PR was closed or merged.

sayakpaul and others added 2 commits November 9, 2023 18:01
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>

![](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lcm/lcm_i2i.png)

## ControlNet
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually can we move this section to LoRA? ControlNet only works with the lora distilled yet (maybe show an example of v15 here): https://huggingface.co/latent-consistency/lcm-lora-sdv1-5

Copy link
Member Author

Choose a reason for hiding this comment

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

But the result shows it works:

image

image = pipe(
prompt=prompt,
num_inference_steps=4,
guidance_scale=1,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
guidance_scale=1,
guidance_scale=0,

Actually guidance_scale=0 also disables it and is cleaner.

Copy link
Member Author

Choose a reason for hiding this comment

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

@pcuenca tested it with 1.0.

Copy link
Contributor

Choose a reason for hiding this comment

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

0 and 1 is the same


* By default, _no guidance is performed_ which enables faster inference. It works for most of the prompts. This means `guidance_scale` is set to 1 (as in the example above).
* When `guidance_scale` > 1, regular classifier-free guidance is performed leading to slightly slower inference as this doubles the batch size.
* The recommended range for `guidance_scale` is [1., 2.].
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also show img2img and Controlnet - see: https://github.com/huggingface/diffusers/pull/5723/files#r1388130749

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

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

Very nice work! Added some updates regarding the naming :-)

It would be great if we could add some more examples to the LoRA section, e.g.:

  • Img2Img
  • ControlNet (note that ControlNet doesn't work fully-fine-tuned lcm, but only for LoRA)
  • Adding multiple LoRAs
  • Img2Img
  • Inpainting

@patrickvonplaten patrickvonplaten merged commit bc2ba00 into main Nov 9, 2023
13 checks passed
kashif pushed a commit to kashif/diffusers that referenced this pull request Nov 11, 2023
* add: locm docs.

* correct path

* Apply suggestions from code review

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>

* Apply suggestions from code review

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* up

* add

---------

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
@kashif kashif deleted the lcm-docs branch December 5, 2023 08:59
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* add: locm docs.

* correct path

* Apply suggestions from code review

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>

* Apply suggestions from code review

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* up

* add

---------

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
Co-authored-by: Patrick von Platen <patrick.v.platen@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.

None yet

4 participants