Generates a dictionary containing the supported auto classes for each pipeline type, using the content of the auto modules.
()
| 44 | |
| 45 | |
| 46 | def get_supported_pipeline_table() -> dict: |
| 47 | """ |
| 48 | Generates a dictionary containing the supported auto classes for each pipeline type, |
| 49 | using the content of the auto modules. |
| 50 | """ |
| 51 | # All supported pipelines for automatic mapping. |
| 52 | all_supported_pipeline_classes = [ |
| 53 | (class_name.__name__, "text-to-image", "AutoPipelineForText2Image") |
| 54 | for _, class_name in AUTO_TEXT2IMAGE_PIPELINES_MAPPING.items() |
| 55 | ] |
| 56 | all_supported_pipeline_classes += [ |
| 57 | (class_name.__name__, "image-to-image", "AutoPipelineForImage2Image") |
| 58 | for _, class_name in AUTO_IMAGE2IMAGE_PIPELINES_MAPPING.items() |
| 59 | ] |
| 60 | all_supported_pipeline_classes += [ |
| 61 | (class_name.__name__, "image-to-image", "AutoPipelineForInpainting") |
| 62 | for _, class_name in AUTO_INPAINT_PIPELINES_MAPPING.items() |
| 63 | ] |
| 64 | all_supported_pipeline_classes = list(set(all_supported_pipeline_classes)) |
| 65 | all_supported_pipeline_classes.sort(key=lambda x: x[0]) |
| 66 | |
| 67 | data = {} |
| 68 | data["pipeline_class"] = [sample[0] for sample in all_supported_pipeline_classes] |
| 69 | data["pipeline_tag"] = [sample[1] for sample in all_supported_pipeline_classes] |
| 70 | data["auto_class"] = [sample[2] for sample in all_supported_pipeline_classes] |
| 71 | |
| 72 | return data |
| 73 | |
| 74 | |
| 75 | def update_metadata(commit_sha: str): |