class_docstr: Load LoRA layers into [`UNet2DConditionModel`] and
  [`CLIPTextModel`](https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel).
class_docstr_tok: ["Load","LoRA","layers","into","[","`","UNet2DConditionModel","`","]","and","[","`","CLIPTextModel","`","]","(","https",":","\/\/huggingface.co\/docs\/transformers\/model_doc\/clip","#","transformers.CLIPTextModel",")","."]
docstr: Args:
  Deletes the LoRA layers of `adapter_name` for the unet and text-encoder(s).
      adapter_names (`Union[List[str], str]`):
          The names of the adapter to delete. Can be a single string or a list of strings
docstr_tok: ["Args",":","Deletes","the","LoRA","layers","of","`","adapter_name","`","for","the","unet","and","text-encoder","(","s",")",".","adapter_names","(","`","Union","[","List","[","str","]",",","str","]","`",")",":","The","names","of","the","adapter","to","delete",".","Can","be","a","single","string","or","a","list","of","strings"]
code: def delete_adapters(self, adapter_names: Union[List[str], str]):
      """
      Args:
      Deletes the LoRA layers of `adapter_name` for the unet and text-encoder(s).
          adapter_names (`Union[List[str], str]`):
              The names of the adapter to delete. Can be a single string or a list of strings
      """
      if not USE_PEFT_BACKEND:
          raise ValueError("PEFT backend is required for this method.")
  
      if isinstance(adapter_names, str):
          adapter_names = [adapter_names]
  
      # Delete unet adapters
      unet = (
          getattr(self, self.unet_name)
          if not hasattr(self, "unet")
          else self.unet
      )
      unet.delete_adapters(adapter_names)
  
      for adapter_name in adapter_names:
          # Delete text encoder adapters
          if hasattr(self, "text_encoder"):
              delete_adapter_layers(self.text_encoder, adapter_name)
          if hasattr(self, "text_encoder_2"):
              delete_adapter_layers(self.text_encoder_2, adapter_name)
  
imports: import inspect
  import os
  from contextlib import nullcontext
  from pathlib import Path
  from typing import Callable, Dict, List, Optional, Union
  import safetensors
  import torch
  from huggingface_hub import model_info
  from huggingface_hub.constants import HF_HUB_OFFLINE
  from huggingface_hub.utils import validate_hf_hub_args
  from packaging import version
  from torch import nn
  from ..None import __version__
  from ..models.modeling_utils import _LOW_CPU_MEM_USAGE_DEFAULT, load_model_dict_into_meta
  from ..utils import USE_PEFT_BACKEND, _get_model_file, convert_state_dict_to_diffusers, convert_state_dict_to_peft, convert_unet_state_dict_to_peft, delete_adapter_layers, deprecate, get_adapter_name, get_peft_kwargs, is_accelerate_available, is_transformers_available, logging, recurse_remove_peft_layers, scale_lora_layers, set_adapter_layers, set_weights_and_activate_adapters
  from .lora_conversion_utils import _convert_kohya_lora_to_diffusers, _maybe_map_sgm_blocks_to_diffusers
label_desc: Use image node_id 23 for calling the LoraLoaderMixin obj's underlying member method code with example usage: obj.delete_adapters(adapter_names) without return types