class_docstr: Load LoRA layers into a [`UNet2DCondtionModel`].
code: def _fuse_lora_apply(self, module, adapter_names=None):
      if not USE_PEFT_BACKEND:
          if hasattr(module, "_fuse_lora"):
              module._fuse_lora(self.lora_scale, self._safe_fusing)
  
          if adapter_names is not None:
              raise ValueError(
                  "The `adapter_names` argument is not supported in your environment. Please switch"
                  " to PEFT backend to use this argument by installing latest PEFT and transformers."
                  " `pip install -U peft transformers`"
              )
      else:
          from peft.tuners.tuners_utils import BaseTunerLayer
  
          merge_kwargs = {"safe_merge": self._safe_fusing}
  
          if isinstance(module, BaseTunerLayer):
              if self.lora_scale != 1.0:
                  module.scale_layer(self.lora_scale)
  
              # For BC with prevous PEFT versions, we need to check the signature
              # of the `merge` method to see if it supports the `adapter_names` argument.
              supported_merge_kwargs = list(
                  inspect.signature(module.merge).parameters
              )
              if "adapter_names" in supported_merge_kwargs:
                  merge_kwargs["adapter_names"] = adapter_names
              elif (
                  "adapter_names" not in supported_merge_kwargs
                  and adapter_names is not None
              ):
                  raise ValueError(
                      "The `adapter_names` argument is not supported with your PEFT version. Please upgrade"
                      " to the latest version of PEFT. `pip install -U peft`"
                  )
  
              module.merge(**merge_kwargs)
  
imports: import inspect
  import os
  from collections import defaultdict
  from contextlib import nullcontext
  from functools import partial
  from typing import Callable, Dict, List, Optional, Union
  import safetensors
  import torch
  import torch.nn.functional
  from huggingface_hub.utils import validate_hf_hub_args
  from torch import nn
  from ..models.embeddings import ImageProjection, IPAdapterFullImageProjection, IPAdapterPlusImageProjection
  from ..models.modeling_utils import _LOW_CPU_MEM_USAGE_DEFAULT, load_model_dict_into_meta
  from ..utils import USE_PEFT_BACKEND, _get_model_file, delete_adapter_layers, is_accelerate_available, logging, set_adapter_layers, set_weights_and_activate_adapters
  from .utils import AttnProcsLayers
label_desc: Use image node_id 5 for calling the UNet2DConditionLoadersMixin obj's underlying member method code with example usage: obj._fuse_lora_apply(module, adapter_names) without return types