code: def adjust_lora_scale_text_encoder(
      text_encoder, lora_scale: float = 1.0
  ):
      for _, attn_module in text_encoder_attn_modules(text_encoder):
          if isinstance(attn_module.q_proj, PatchedLoraProjection):
              attn_module.q_proj.lora_scale = lora_scale
              attn_module.k_proj.lora_scale = lora_scale
              attn_module.v_proj.lora_scale = lora_scale
              attn_module.out_proj.lora_scale = lora_scale
  
      for _, mlp_module in text_encoder_mlp_modules(text_encoder):
          if isinstance(mlp_module.fc1, PatchedLoraProjection):
              mlp_module.fc1.lora_scale = lora_scale
              mlp_module.fc2.lora_scale = lora_scale
  
imports: from typing import Optional, Tuple, Union
  import torch
  import torch.nn.functional
  from torch import nn
  from ..loaders import PatchedLoraProjection, text_encoder_attn_modules, text_encoder_mlp_modules
  from ..utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: adjust_lora_scale_text_encoder(text_encoder, lora_scale) without return types