Skip to content

[docs] Load A1111 LoRA#3629

Merged
sayakpaul merged 4 commits into
huggingface:mainfrom
stevhliu:a1111-format
Jun 5, 2023
Merged

[docs] Load A1111 LoRA#3629
sayakpaul merged 4 commits into
huggingface:mainfrom
stevhliu:a1111-format

Conversation

@stevhliu

@stevhliu stevhliu commented Jun 1, 2023

Copy link
Copy Markdown
Member

A guide for how to load and use an A1111 LoRA checkpoint with load_lora_weights (to be merged after the ongoing PR that adds support for it).

@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Jun 1, 2023

Copy link
Copy Markdown

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

@junjiexv

junjiexv commented Jun 1, 2023

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

the link is broken, @HuggingFaceDocBuilderDev

@patrickvonplaten patrickvonplaten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cc @sayakpaul @takuma104 could you have a look here? :-)

Comment thread docs/source/en/using-diffusers/other-formats.mdx Outdated
@takuma104

Copy link
Copy Markdown
Contributor

@stevhliu I've left a comment, although it might be a bit nitpicky. For the example image, it's a beautiful and easy-to-understand!

@stevhliu

stevhliu commented Jun 2, 2023

Copy link
Copy Markdown
Member Author

Thanks for your feedback (and contributions in general) @takuma104! 🤗

Load the LoRA checkpoint into the pipeline with the [`~LoraLoaderMixin.load_lora_weights`] method:

```py
pipeline.load_lora_weights(".", weight_name="howls_moving_castle.safetensors")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, possible directly load like:

lora_model_id = "sayakpaul/civitai-light-shadow-lora"
lora_filename = "light_and_shadow.safetensors"
pipeline.load_lora_weights(lora_model_id, weight_name=lora_filename)

C.f.: https://huggingface.co/docs/diffusers/main/en/training/lora#supporting-a1111-themed-lora-checkpoints-from-diffusers

```

<div class="flex justify-center">
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/a1111-lora-sf.png"/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The picture is amazing 💘

I also included a with and with LoRA comparison here.

@sayakpaul sayakpaul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome work, @stevhliu!

@sayakpaul sayakpaul merged commit 523a50a into huggingface:main Jun 5, 2023
@stevhliu stevhliu deleted the a1111-format branch June 5, 2023 15:52
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* load a1111 lora

* fix

* apply feedback

* fix
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.

6 participants