You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/en/api/loaders/ip_adapter.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,11 @@ specific language governing permissions and limitations under the License.
12
12
13
13
# IP-Adapter
14
14
15
-
[IP-Adapter](https://hf.co/papers/2308.06721) is a lightweight adapter that enables prompting a diffusion model with an image. This method decouples the cross-attention layers of the image and text features. The image features are generated from an image encoder. Files generated from IP-Adapter are only ~100MBs.
15
+
[IP-Adapter](https://hf.co/papers/2308.06721) is a lightweight adapter that enables prompting a diffusion model with an image. This method decouples the cross-attention layers of the image and text features. The image features are generated from an image encoder.
16
16
17
17
<Tip>
18
18
19
-
Learn how to load an IP-Adapter checkpoint and image in the [IP-Adapter](../../using-diffusers/loading_adapters#ip-adapter)loading guide.
19
+
Learn how to load an IP-Adapter checkpoint and image in the IP-Adapter[loading](../../using-diffusers/loading_adapters#ip-adapter)guide, and you can see how to use it in the [usage](../../using-diffusers/ip_adapter) guide.
You can use PEFT to easily fuse/unfuse multiple adapters directly into the model weights (both UNet and text encoder) using the [`~diffusers.loaders.LoraLoaderMixin.fuse_lora`] method, which can lead to a speed-up in inference and lower VRAM usage.
Community pipelines can also be loaded from a local file if you pass a file path instead. The path to the passed directory must contain a `pipeline.py` file that contains the pipeline class in order to successfully load it.
62
+
63
+
```py
64
+
pipeline = DiffusionPipeline.from_pretrained(
65
+
"runwayml/stable-diffusion-v1-5",
66
+
custom_pipeline="./path/to/pipeline_directory/",
67
+
clip_model=clip_model,
68
+
feature_extractor=feature_extractor,
69
+
use_safetensors=True,
70
+
)
71
+
```
72
+
73
+
### Load from a specific version
74
+
75
+
By default, community pipelines are loaded from the latest stable version of Diffusers. To load a community pipeline from another version, use the `custom_revision` parameter.
76
+
77
+
<hfoptionsid="version">
78
+
<hfoptionid="main">
79
+
80
+
For example, to load from the `main` branch:
81
+
82
+
```py
83
+
pipeline = DiffusionPipeline.from_pretrained(
84
+
"runwayml/stable-diffusion-v1-5",
85
+
custom_pipeline="clip_guided_stable_diffusion",
86
+
custom_revision="main",
87
+
clip_model=clip_model,
88
+
feature_extractor=feature_extractor,
89
+
use_safetensors=True,
90
+
)
91
+
```
92
+
93
+
</hfoption>
94
+
<hfoptionid="older version">
95
+
96
+
For example, to load from a previous version of Diffusers like `v0.25.0`:
97
+
98
+
```py
99
+
pipeline = DiffusionPipeline.from_pretrained(
100
+
"runwayml/stable-diffusion-v1-5",
101
+
custom_pipeline="clip_guided_stable_diffusion",
102
+
custom_revision="v0.25.0",
103
+
clip_model=clip_model,
104
+
feature_extractor=feature_extractor,
105
+
use_safetensors=True,
106
+
)
107
+
```
108
+
109
+
</hfoption>
110
+
</hfoptions>
111
+
112
+
59
113
For more information about community pipelines, take a look at the [Community pipelines](custom_pipeline_examples) guide for how to use them and if you're interested in adding a community pipeline check out the [How to contribute a community pipeline](contribute_pipeline) guide!
0 commit comments