Skip to content

Commit 1a4db89

Browse files
[Custom Pipelines] Make sure that community pipelines can use repo revision (#5659)
fix custom pipelines
1 parent df60b35 commit 1a4db89

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/diffusers/pipelines/pipeline_utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,18 @@ def _get_pipeline_class(
353353
else:
354354
file_name = CUSTOM_PIPELINE_FILE_NAME
355355

356+
if repo_id is not None and hub_revision is not None:
357+
# if we load the pipeline code from the Hub
358+
# make sure to overwrite the `revison`
359+
revision = hub_revision
360+
356361
return get_class_from_dynamic_module(
357362
custom_pipeline,
358363
module_file=file_name,
359364
class_name=class_name,
360365
repo_id=repo_id,
361366
cache_dir=cache_dir,
362-
revision=revision if hub_revision is None else hub_revision,
367+
revision=revision,
363368
)
364369

365370
if class_obj != DiffusionPipeline:

0 commit comments

Comments
 (0)