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/using-diffusers/custom_pipeline_overview.md
+14-13Lines changed: 14 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,11 @@ specific language governing permissions and limitations under the License.
16
16
17
17
## Community pipelines
18
18
19
-
Community pipelines are any [`DiffusionPipeline`] class that are different from the original implementation as specified in their paper (for example, the [`StableDiffusionControlNetPipeline`] corresponds to the [Text-to-Image Generation with ControlNet Conditioning](https://arxiv.org/abs/2302.05543) paper). They provide additional functionality or extend the original implementation of a pipeline.
19
+
Community pipelines are any [`DiffusionPipeline`] class that are different from the original paper implementation (for example, the [`StableDiffusionControlNetPipeline`] corresponds to the [Text-to-Image Generation with ControlNet Conditioning](https://arxiv.org/abs/2302.05543) paper). They provide additional functionality or extend the original implementation of a pipeline.
20
20
21
21
There are many cool community pipelines like [Marigold Depth Estimation](https://github.com/huggingface/diffusers/tree/main/examples/community#marigold-depth-estimation) or [InstantID](https://github.com/huggingface/diffusers/tree/main/examples/community#instantid-pipeline), and you can find all the official community pipelines [here](https://github.com/huggingface/diffusers/tree/main/examples/community).
22
22
23
-
There are two types of community pipelines, those stored on the Hugging Face Hub and those stored on Diffusers GitHub repository. Refer to this [table](./contribute_pipeline#share-your-pipeline) for a comparison of Hub vs GitHub community pipelines.
23
+
There are two types of community pipelines, those stored on the Hugging Face Hub and those stored on Diffusers GitHub repository. Hub pipelines are completely customizable (scheduler, models, pipeline code, etc.) while Diffusers GitHub pipelines are only limited to custom pipeline code. Refer to this [table](./contribute_pipeline#share-your-pipeline) for a more detailed comparison of Hub vs GitHub community pipelines.
24
24
25
25
<hfoptionsid="community">
26
26
<hfoptionid="Hub pipelines">
@@ -85,7 +85,7 @@ By default, community pipelines are loaded from the latest stable version of Dif
@@ -166,7 +167,7 @@ Community components allow users to build pipelines that may have customized com
166
167
167
168
This section shows how users should use community components to build a community pipeline.
168
169
169
-
You'll use the [showlab/show-1-base](https://huggingface.co/showlab/show-1-base) pipeline checkpoint as an example. So, let's start loading the components:
170
+
You'll use the [showlab/show-1-base](https://huggingface.co/showlab/show-1-base) pipeline checkpoint as an example.
170
171
171
172
1. Import and load the text encoder from Transformers:
172
173
@@ -202,13 +203,13 @@ In steps 4 and 5, the custom [UNet](https://github.com/showlab/Show-1/blob/main/
202
203
203
204
4. Now you'll load a [custom UNet](https://github.com/showlab/Show-1/blob/main/showone/models/unet_3d_condition.py), which in this example, has already been implemented in [showone_unet_3d_condition.py](https://huggingface.co/sayakpaul/show-1-base-with-code/blob/main/unet/showone_unet_3d_condition.py) for your convenience. You'll notice the [`UNet3DConditionModel`] class name is changed to `ShowOneUNet3DConditionModel` because [`UNet3DConditionModel`] already exists in Diffusers. Any components needed for the `ShowOneUNet3DConditionModel` class should be placed in showone_unet_3d_condition.py.
204
205
205
-
Once this is done, you can initialize the UNet:
206
+
Once this is done, you can initialize the UNet:
206
207
207
-
```python
208
-
from showone_unet_3d_condition import ShowOneUNet3DConditionModel
208
+
```python
209
+
from showone_unet_3d_condition import ShowOneUNet3DConditionModel
5. Finally, you'll load the custom pipeline code. For this example, it has already been created for you in [pipeline_t2v_base_pixel.py](https://huggingface.co/sayakpaul/show-1-base-with-code/blob/main/pipeline_t2v_base_pixel.py). This script contains a custom `TextToVideoIFPipeline` class for generating videos from text. Just like the custom UNet, any code needed for the custom pipeline to work should go in pipeline_t2v_base_pixel.py.
214
215
@@ -235,7 +236,7 @@ Push the pipeline to the Hub to share with the community!
235
236
pipeline.push_to_hub("custom-t2v-pipeline")
236
237
```
237
238
238
-
After the pipeline is successfully pushed, you need a couple of changes:
239
+
After the pipeline is successfully pushed, you need to make a few changes:
239
240
240
241
1. Change the `_class_name` attribute in [model_index.json](https://huggingface.co/sayakpaul/show-1-base-with-code/blob/main/model_index.json#L2) to `"pipeline_t2v_base_pixel"` and `"TextToVideoIFPipeline"`.
241
242
2. Upload `showone_unet_3d_condition.py` to the [unet](https://huggingface.co/sayakpaul/show-1-base-with-code/blob/main/unet/showone_unet_3d_condition.py) subfolder.
0 commit comments