Skip to content

Fix diffusers compatibility: handle renamed pipeline_utils module#72

Open
Mr-Neutr0n wants to merge 1 commit intoVchitect:mainfrom
Mr-Neutr0n:fix/diffusers-pipeline-utils-import
Open

Fix diffusers compatibility: handle renamed pipeline_utils module#72
Mr-Neutr0n wants to merge 1 commit intoVchitect:mainfrom
Mr-Neutr0n:fix/diffusers-pipeline-utils-import

Conversation

@Mr-Neutr0n
Copy link
Copy Markdown

Summary

  • Fixed ModuleNotFoundError: No module named 'diffusers.pipeline_utils' with newer diffusers versions

Problem

In newer versions of diffusers (0.21+), the pipeline_utils module was moved from diffusers.pipeline_utils to diffusers.pipelines.pipeline_utils. This breaks compatibility when users have newer diffusers installed.

Solution

Added a try/except block to handle both import paths, similar to the existing pattern used for randn_tensor:

try:
    from diffusers.pipeline_utils import DiffusionPipeline
except ImportError:
    from diffusers.pipelines.pipeline_utils import DiffusionPipeline

This maintains backward compatibility with older diffusers while supporting newer versions.

Related Issue

Fixes #59

Test Plan

  • Works with diffusers < 0.21 (old import path)
  • Works with diffusers >= 0.21 (new import path)

@Mr-Neutr0n
Copy link
Copy Markdown
Author

following up on this — fixes a broken import after diffusers renamed its pipeline_utils module. lmk if you'd like any changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ModuleNotFoundError: No module named 'diffusers.pipeline_utils'

1 participant