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: Disables the LoRA layers for the text encoder.
  
  Args:
      text_encoder (`torch.nn.Module`, *optional*):
          The text encoder module to disable the LoRA layers for. If `None`, it will try to get the
          `text_encoder` attribute.
docstr_tok: ["Disables","the","LoRA","layers","for","the","text","encoder",".","Args",":","text_encoder","(","`","torch.nn.Module","`",",","*","optional","*",")",":","The","text","encoder","module","to","disable","the","LoRA","layers","for",".","If","`","None","`",",","it","will","try","to","get","the","`","text_encoder","`","attribute","."]
code: def disable_lora_for_text_encoder(
      self, text_encoder: Optional["PreTrainedModel"] = None
  ):
      """
      Disables the LoRA layers for the text encoder.
  
      Args:
          text_encoder (`torch.nn.Module`, *optional*):
              The text encoder module to disable the LoRA layers for. If `None`, it will try to get the
              `text_encoder` attribute.
      """
      if not USE_PEFT_BACKEND:
          raise ValueError("PEFT backend is required for this method.")
  
      text_encoder = text_encoder or getattr(self, "text_encoder", None)
      if text_encoder is None:
          raise ValueError("Text Encoder not found.")
      set_adapter_layers(text_encoder, enabled=False)
  
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 18 for calling the LoraLoaderMixin obj's underlying member method code with example usage: obj.disable_lora_for_text_encoder(text_encoder) without return types