Skip to content

Commit 27ae317

Browse files
committed
feedback
1 parent 7711ddd commit 27ae317

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/source/en/tutorials/autopipeline.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ specific language governing permissions and limitations under the License.
1212

1313
# AutoPipeline
1414

15-
[AutoPipeline](../api/models/auto_model) is a *task-first* pipeline that automatically selects the correct pipeline subclass based on the task. It handles the complexity of loading different pipeline subclasses without needing to know the specific pipeline subclass name.
15+
[AutoPipeline](../api/models/auto_model) is a *task-and-model* pipeline that automatically selects the correct pipeline subclass based on the task. It handles the complexity of loading different pipeline subclasses without needing to know the specific pipeline subclass name.
1616

17-
This is unlike [`DiffusionPipeline`], a *model-first* pipeline that automatically selects the pipeline subclass based on the model.
17+
This is unlike [`DiffusionPipeline`], a *model-only* pipeline that automatically selects the pipeline subclass based on the model.
1818

19-
[`AutoPipelineForImage2Image`] returns the specific pipeline subclass, [`StableDiffusionXLImg2ImgPipeline`], which can only be used for image-to-image tasks.
19+
[`AutoPipelineForImage2Image`] returns the specific pipeline subclass, [`StableDiffusionXLImg2ImgPipeline`] in the example below, which can only be used for image-to-image tasks.
2020

2121
```py
2222
import torch
@@ -60,4 +60,8 @@ pipeline = AutoPipelineForImage2Image.from_pretrained(
6060
"openai/shap-e-img2img", torch_dtype=torch.float16,
6161
)
6262
"ValueError: AutoPipeline can't find a pipeline linked to ShapEImg2ImgPipeline for None"
63-
```
63+
```
64+
65+
There are three types of [AutoPipeline](../api/models/auto_model) classes, [`AutoPipelineForText2Image`], [`AutoPipelineForImage2Image`] and [`AutoPipelineForInpainting`]. Each of these classes have a predefined mapping, linking a pipeline to their task-specific subclass.
66+
67+
When [`~AutoPipeline.from_pretrained`] is called, it extracts the class name from the `model_index.json` file and selects the appropriate pipeline subclass for the task based on the mapping.

0 commit comments

Comments
 (0)