Skip to content

Commit

Permalink
Add diffusers version check
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Mar 8, 2024
1 parent 9b55ebb commit 2767a5b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib_layerdiffusion/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
from diffusers.models.unet_2d_blocks import UNetMidBlock2D, get_down_block, get_up_block


def check_diffusers_version():
import diffusers
from packaging.version import parse

assert parse(diffusers.__version__) >= parse(
"0.25.0"
), "diffusers>=0.25.0 requirement not satisfied. Please install correct diffusers version."


check_diffusers_version()


def zero_module(module):
"""
Zero out the parameters of a module and return it.
Expand Down

0 comments on commit 2767a5b

Please sign in to comment.