class_docstr: A simple ResNet-like model that accepts images containing control signals such as keyposes and depth. The model
  generates multiple feature maps that are used as additional conditioning in [`UNet2DConditionModel`]. The model's
  architecture follows the original implementation of
  [Adapter](https://github.com/TencentARC/T2I-Adapter/blob/686de4681515662c0ac2ffa07bf5dda83af1038a/ldm/modules/encoders/adapter.py#L97)
   and
   [AdapterLight](https://github.com/TencentARC/T2I-Adapter/blob/686de4681515662c0ac2ffa07bf5dda83af1038a/ldm/modules/encoders/adapter.py#L235).
  
  This model inherits from [`ModelMixin`]. Check the superclass documentation for the generic methods the library
  implements for all the model (such as downloading or saving, etc.)
  
  Parameters:
      in_channels (`int`, *optional*, defaults to 3):
          Number of channels of Aapter's input(*control image*). Set this parameter to 1 if you're using gray scale
          image as *control image*.
      channels (`List[int]`, *optional*, defaults to `(320, 640, 1280, 1280)`):
          The number of channel of each downsample block's output hidden state. The `len(block_out_channels)` will
          also determine the number of downsample blocks in the Adapter.
      num_res_blocks (`int`, *optional*, defaults to 2):
          Number of ResNet blocks in each downsample block.
      downscale_factor (`int`, *optional*, defaults to 8):
          A factor that determines the total downscale factor of the Adapter.
      adapter_type (`str`, *optional*, defaults to `full_adapter`):
          The type of Adapter to use. Choose either `full_adapter` or `full_adapter_xl` or `light_adapter`.
class_docstr_tok: ["A","simple","ResNet-like","model","that","accepts","images","containing","control","signals","such","as","keyposes","and","depth",".","The","model","generates","multiple","feature","maps","that","are","used","as","additional","conditioning","in","[","`","UNet2DConditionModel","`","]",".","The","model's","architecture","follows","the","original","implementation","of","[","Adapter","]","(","https",":","\/\/github.com\/TencentARC\/T2I-Adapter\/blob\/686de4681515662c0ac2ffa07bf5dda83af1038a\/ldm\/modules\/encoders\/adapter.py","#","L97",")","and","[","AdapterLight","]","(","https",":","\/\/github.com\/TencentARC\/T2I-Adapter\/blob\/686de4681515662c0ac2ffa07bf5dda83af1038a\/ldm\/modules\/encoders\/adapter.py","#","L235",")",".","This","model","inherits","from","[","`","ModelMixin","`","]",".","Check","the","superclass","documentation","for","the","generic","methods","the","library","implements","for","all","the","model","(","such","as","downloading","or","saving",",","etc",".",")","Parameters",":","in_channels","(","`","int","`",",","*","optional","*",",","defaults","to","3",")",":","Number","of","channels","of","Aapter","'s","input","(","*","control","image","*",")",".","Set","this","parameter","to","1","if","you","'re","using","gray","scale","image","as","*","control","image","*",".","channels","(","`","List","[","int","]","`",",","*","optional","*",",","defaults","to","`","(","320",",","640",",","1280",",","1280",")","`",")",":","The","number","of","channel","of","each","downsample","block","'s","output","hidden","state",".","The","`","len","(","block_out_channels",")","`","will","also","determine","the","number","of","downsample","blocks","in","the","Adapter",".","num_res_blocks","(","`","int","`",",","*","optional","*",",","defaults","to","2",")",":","Number","of","ResNet","blocks","in","each","downsample","block",".","downscale_factor","(","`","int","`",",","*","optional","*",",","defaults","to","8",")",":","A","factor","that","determines","the","total","downscale","factor","of","the","Adapter",".","adapter_type","(","`","str","`",",","*","optional","*",",","defaults","to","`","full_adapter","`",")",":","The","type","of","Adapter","to","use",".","Choose","either","`","full_adapter","`","or","`","full_adapter_xl","`","or","`","light_adapter","`","."]
code: def __init__(
      self,
      in_channels: int = 3,
      channels: List[int] = [320, 640, 1280, 1280],
      num_res_blocks: int = 2,
      downscale_factor: int = 8,
      adapter_type: str = "full_adapter",
  ):
      super().__init__()
  
      if adapter_type == "full_adapter":
          self.adapter = FullAdapter(
              in_channels, channels, num_res_blocks, downscale_factor
          )
      elif adapter_type == "full_adapter_xl":
          self.adapter = FullAdapterXL(
              in_channels, channels, num_res_blocks, downscale_factor
          )
      elif adapter_type == "light_adapter":
          self.adapter = LightAdapter(
              in_channels, channels, num_res_blocks, downscale_factor
          )
      else:
          raise ValueError(
              f"Unsupported adapter_type: '{adapter_type}'. Choose either 'full_adapter' or "
              "'full_adapter_xl' or 'light_adapter'."
          )
  
imports: import os
  from typing import Callable, List, Optional, Union
  import torch
  import torch.nn
  from ..configuration_utils import ConfigMixin, register_to_config
  from ..utils import logging
  from .modeling_utils import ModelMixin
label_desc: Use image node_id 1 to create a new T2IAdapter object from inherited base classes: ModelMixin, ConfigMixin with example: obj = T2IAdapter(in_channels, channels, num_res_blocks, downscale_factor, adapter_type)