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

[docs] Kandinsky guide #4555

Merged
merged 12 commits into from
Nov 1, 2023
Merged

[docs] Kandinsky guide #4555

merged 12 commits into from
Nov 1, 2023

Conversation

stevhliu
Copy link
Member

@stevhliu stevhliu commented Aug 10, 2023

Part of the ongoing effort to make the API docs more lightweight (similar to #4428) for some of the pipelines that are more complex and less straightforward to use. This'll also improve #4290.

Since Kandinsky 2.2 usage is so similar to 2.1, do you think it'd make sense to combine the two on a page? I think this can really avoid duplicating content shared by both pipelines. We can copy this code snippet switching thing from the Datasets docs. The only thing we'd have to make super clear is:

  1. don't use prompt in the decoding pipeline for Kandinsky 2.2
  2. have a separate section for ControlNet with Kandinsky 2.2

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 10, 2023

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

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

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

I like the idea of code-switching very much!
Note that we used to have Kandinsky 2.1 and 2.2 on the same page and then later separated Kandinsky 2.2 into its own page. But I think it would work with the code-switching function :)

docs/source/en/using-diffusers/kandinsky.md Show resolved Hide resolved
@stevhliu
Copy link
Member Author

Updated with the ControlNet pipelines and opened a PR here huggingface/doc-builder#389 to enable the code-switching. Once approved, I'll update all the code examples with the 2.2 usage for all the tasks.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Sep 12, 2023
@stevhliu
Copy link
Member Author

Not stale, waiting on huggingface/doc-builder#389 🙂

@stevhliu stevhliu removed the stale Issues that haven't received updates label Sep 12, 2023
@github-actions github-actions bot added the stale Issues that haven't received updates label Oct 18, 2023
@huggingface huggingface deleted a comment from github-actions bot Oct 18, 2023
@stevhliu stevhliu marked this pull request as ready for review October 31, 2023 19:06
@stevhliu
Copy link
Member Author

Thanks to @mishig25 for the code-switcher, I've updated the docs with Kandinsky 2.2 examples! 😄

https://moon-ci-docs.huggingface.co/docs/diffusers/pr_4555/en/using-diffusers/kandinsky


To use the Kandinsky models for any task, you always start by setting up the prior pipeline to encode the prompt and generate the image embeddings. The prior pipeline also generates `negative_image_embeds` that correspond to the negative prompt `""`. For better results, you can pass an actual `negative_prompt` to the prior pipeline, but this'll increase the effective batch size of the prior pipeline by 2x.

<hfoptions id="kandinsky-text-to-image">
Copy link
Contributor

@mishig25 mishig25 Nov 1, 2023

Choose a reason for hiding this comment

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

for the <hfoptions> id, using same id when possible on all hfoptions blocks is better as that would result in changing to one of the options, would change all other hfoptions blocks with same id (probably what the user wants)

Copy link
Member Author

Choose a reason for hiding this comment

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

awesome, thanks for the tip! 🤝

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.

Clean!

@stevhliu stevhliu merged commit 75ea54a into huggingface:main Nov 1, 2023
11 checks passed
@stevhliu stevhliu deleted the kandinsky-docs branch November 1, 2023 22:36
kashif pushed a commit to kashif/diffusers that referenced this pull request Nov 11, 2023
* kandinsky 2.1 first draft

* add kandinsky 2.2

* fix identical section headers

* try hfoptions syntax

* add img2img

* add inpaint

* add interpolate

* fix tag

* more cleanups

* typo

* update hfoptions id

* align hfoptions tags
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* kandinsky 2.1 first draft

* add kandinsky 2.2

* fix identical section headers

* try hfoptions syntax

* add img2img

* add inpaint

* add interpolate

* fix tag

* more cleanups

* typo

* update hfoptions id

* align hfoptions tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues that haven't received updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants