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
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