"git@developer.sourcefind.cn:OpenDAS/apex.git" did not exist on "03204b8451ba962a0844621c22fd3748d65dfc11"
Unverified Commit d81cc6f1 authored by Steven Liu's avatar Steven Liu Committed by GitHub
Browse files

[docs] Fix internal links (#10418)



fix links
Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
parent 476795c5
...@@ -56,7 +56,7 @@ image ...@@ -56,7 +56,7 @@ image
With the `adapter_name` parameter, it is really easy to use another adapter for inference! Load the [nerijs/pixel-art-xl](https://huggingface.co/nerijs/pixel-art-xl) adapter that has been fine-tuned to generate pixel art images and call it `"pixel"`. With the `adapter_name` parameter, it is really easy to use another adapter for inference! Load the [nerijs/pixel-art-xl](https://huggingface.co/nerijs/pixel-art-xl) adapter that has been fine-tuned to generate pixel art images and call it `"pixel"`.
The pipeline automatically sets the first loaded adapter (`"toy"`) as the active adapter, but you can activate the `"pixel"` adapter with the [`~PeftAdapterMixin.set_adapters`] method: The pipeline automatically sets the first loaded adapter (`"toy"`) as the active adapter, but you can activate the `"pixel"` adapter with the [`~loaders.peft.PeftAdapterMixin.set_adapters`] method:
```python ```python
pipe.load_lora_weights("nerijs/pixel-art-xl", weight_name="pixel-art-xl.safetensors", adapter_name="pixel") pipe.load_lora_weights("nerijs/pixel-art-xl", weight_name="pixel-art-xl.safetensors", adapter_name="pixel")
...@@ -85,7 +85,7 @@ By default, if the most up-to-date versions of PEFT and Transformers are detecte ...@@ -85,7 +85,7 @@ By default, if the most up-to-date versions of PEFT and Transformers are detecte
You can also merge different adapter checkpoints for inference to blend their styles together. You can also merge different adapter checkpoints for inference to blend their styles together.
Once again, use the [`~PeftAdapterMixin.set_adapters`] method to activate the `pixel` and `toy` adapters and specify the weights for how they should be merged. Once again, use the [`~loaders.peft.PeftAdapterMixin.set_adapters`] method to activate the `pixel` and `toy` adapters and specify the weights for how they should be merged.
```python ```python
pipe.set_adapters(["pixel", "toy"], adapter_weights=[0.5, 1.0]) pipe.set_adapters(["pixel", "toy"], adapter_weights=[0.5, 1.0])
...@@ -114,7 +114,7 @@ Impressive! As you can see, the model generated an image that mixed the characte ...@@ -114,7 +114,7 @@ Impressive! As you can see, the model generated an image that mixed the characte
> [!TIP] > [!TIP]
> Through its PEFT integration, Diffusers also offers more efficient merging methods which you can learn about in the [Merge LoRAs](../using-diffusers/merge_loras) guide! > Through its PEFT integration, Diffusers also offers more efficient merging methods which you can learn about in the [Merge LoRAs](../using-diffusers/merge_loras) guide!
To return to only using one adapter, use the [`~PeftAdapterMixin.set_adapters`] method to activate the `"toy"` adapter: To return to only using one adapter, use the [`~loaders.peft.PeftAdapterMixin.set_adapters`] method to activate the `"toy"` adapter:
```python ```python
pipe.set_adapters("toy") pipe.set_adapters("toy")
...@@ -127,7 +127,7 @@ image = pipe( ...@@ -127,7 +127,7 @@ image = pipe(
image image
``` ```
Or to disable all adapters entirely, use the [`~PeftAdapterMixin.disable_lora`] method to return the base model. Or to disable all adapters entirely, use the [`~loaders.peft.PeftAdapterMixin.disable_lora`] method to return the base model.
```python ```python
pipe.disable_lora() pipe.disable_lora()
...@@ -141,7 +141,7 @@ image ...@@ -141,7 +141,7 @@ image
### Customize adapters strength ### Customize adapters strength
For even more customization, you can control how strongly the adapter affects each part of the pipeline. For this, pass a dictionary with the control strengths (called "scales") to [`~PeftAdapterMixin.set_adapters`]. For even more customization, you can control how strongly the adapter affects each part of the pipeline. For this, pass a dictionary with the control strengths (called "scales") to [`~loaders.peft.PeftAdapterMixin.set_adapters`].
For example, here's how you can turn on the adapter for the `down` parts, but turn it off for the `mid` and `up` parts: For example, here's how you can turn on the adapter for the `down` parts, but turn it off for the `mid` and `up` parts:
```python ```python
...@@ -214,7 +214,7 @@ list_adapters_component_wise ...@@ -214,7 +214,7 @@ list_adapters_component_wise
{"text_encoder": ["toy", "pixel"], "unet": ["toy", "pixel"], "text_encoder_2": ["toy", "pixel"]} {"text_encoder": ["toy", "pixel"], "unet": ["toy", "pixel"], "text_encoder_2": ["toy", "pixel"]}
``` ```
The [`~PeftAdapterMixin.delete_adapters`] function completely removes an adapter and their LoRA layers from a model. The [`~loaders.peft.PeftAdapterMixin.delete_adapters`] function completely removes an adapter and their LoRA layers from a model.
```py ```py
pipe.delete_adapters("toy") pipe.delete_adapters("toy")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment