code: def set_adapter_layers(model, enabled=True):
      from peft.tuners.tuners_utils import BaseTunerLayer
  
      for module in model.modules():
          if isinstance(module, BaseTunerLayer):
              # The recent version of PEFT needs to call `enable_adapters` instead
              if hasattr(module, "enable_adapters"):
                  module.enable_adapters(enabled=enabled)
              else:
                  module.disable_adapters = not enabled
  
file_path: diffusers/src/diffusers/utils/peft_utils.py
imports: import collections
  import importlib
  from typing import Optional
  from packaging import version
  from .import_utils import is_peft_available, is_torch_available
label_desc: Use image node_id 6 for calling a global function with example usage: set_adapter_layers(model, enabled) without return types