class_docstr: Tests that diffusers StableDiffusion model works with PEFT as expected.
code: def test_add_weighted_adapter_base_unchanged(
      self, test_name, model_id, config_cls, config_kwargs
  ):
      # Instantiate model & adapters
      model = self.instantiate_sd_peft(
          model_id, config_cls, config_kwargs
      )
  
      # Get current available adapter config
      text_encoder_adapter_name = next(
          iter(model.text_encoder.peft_config.keys())
      )
      unet_adapter_name = next(iter(model.unet.peft_config.keys()))
      text_encoder_adapter_config = replace(
          model.text_encoder.peft_config[text_encoder_adapter_name]
      )
      unet_adapter_config = replace(
          model.unet.peft_config[unet_adapter_name]
      )
  
      # Create weighted adapters
      model.text_encoder.add_weighted_adapter(
          [unet_adapter_name], [0.5], "weighted_adapter_test"
      )
      model.unet.add_weighted_adapter(
          [unet_adapter_name], [0.5], "weighted_adapter_test"
      )
  
      # Assert that base adapters config did not change
      self.assertTrue(
          asdict(text_encoder_adapter_config)
          == asdict(
              model.text_encoder.peft_config[text_encoder_adapter_name]
          )
      )
      self.assertTrue(
          asdict(unet_adapter_config)
          == asdict(model.unet.peft_config[unet_adapter_name])
      )
  
file_path: peft/tests/test_stablediffusion.py
imports: from dataclasses import asdict, replace
  from unittest import TestCase
  import numpy
  from diffusers import StableDiffusionPipeline
  from parameterized import parameterized
  from peft import LoHaConfig, LoraConfig, OFTConfig, get_peft_model
  from .testing_common import ClassInstantier, PeftCommonTester
  from .testing_utils import temp_seed
label_desc: Use image node_id 4 for calling the StableDiffusionModelTester obj's underlying member method code with example usage: obj.test_add_weighted_adapter_base_unchanged(test_name, model_id, config_cls, config_kwargs) without return types