class_docstr: The `MaskConditionDecoder` should be used in combination with [`AsymmetricAutoencoderKL`] to enhance the model's
  decoder with a conditioner on the mask and masked image.
code: def __init__(
      self,
      in_channels=3,
      out_channels=3,
      up_block_types=("UpDecoderBlock2D",),
      block_out_channels=(64,),
      layers_per_block=2,
      norm_num_groups=32,
      act_fn="silu",
      norm_type="group",  # group, spatial
  ):
      super().__init__()
      self.layers_per_block = layers_per_block
  
      self.conv_in = nn.Conv2d(
          in_channels,
          block_out_channels[-1],
          kernel_size=3,
          stride=1,
          padding=1,
      )
  
      self.mid_block = None
      self.up_blocks = nn.ModuleList([])
  
      temb_channels = in_channels if norm_type == "spatial" else None
  
      # mid
      self.mid_block = UNetMidBlock2D(
          in_channels=block_out_channels[-1],
          resnet_eps=1e-6,
          resnet_act_fn=act_fn,
          output_scale_factor=1,
          resnet_time_scale_shift="default"
          if norm_type == "group"
          else norm_type,
          attention_head_dim=block_out_channels[-1],
          resnet_groups=norm_num_groups,
          temb_channels=temb_channels,
      )
  
      # up
      reversed_block_out_channels = list(reversed(block_out_channels))
      output_channel = reversed_block_out_channels[0]
      for i, up_block_type in enumerate(up_block_types):
          prev_output_channel = output_channel
          output_channel = reversed_block_out_channels[i]
  
          is_final_block = i == len(block_out_channels) - 1
  
          up_block = get_up_block(
              up_block_type,
              num_layers=self.layers_per_block + 1,
              in_channels=prev_output_channel,
              out_channels=output_channel,
              prev_output_channel=None,
              add_upsample=not is_final_block,
              resnet_eps=1e-6,
              resnet_act_fn=act_fn,
              resnet_groups=norm_num_groups,
              attention_head_dim=output_channel,
              temb_channels=temb_channels,
              resnet_time_scale_shift=norm_type,
          )
          self.up_blocks.append(up_block)
          prev_output_channel = output_channel
  
      # condition encoder
      self.condition_encoder = MaskConditionEncoder(
          in_ch=out_channels,
          out_ch=block_out_channels[0],
          res_ch=block_out_channels[-1],
      )
  
      # out
      if norm_type == "spatial":
          self.conv_norm_out = SpatialNorm(
              block_out_channels[0], temb_channels
          )
      else:
          self.conv_norm_out = nn.GroupNorm(
              num_channels=block_out_channels[0],
              num_groups=norm_num_groups,
              eps=1e-6,
          )
      self.conv_act = nn.SiLU()
      self.conv_out = nn.Conv2d(
          block_out_channels[0], out_channels, 3, padding=1
      )
  
      self.gradient_checkpointing = False
  
imports: from dataclasses import dataclass
  from typing import Optional
  import numpy
  import torch
  import torch.nn
  from ..utils import BaseOutput, is_torch_version
  from ..utils.torch_utils import randn_tensor
  from .activations import get_activation
  from .attention_processor import SpatialNorm
  from .unet_2d_blocks import AutoencoderTinyBlock, UNetMidBlock2D, get_down_block, get_up_block
label_desc: Use image node_id 1 to create a new MaskConditionDecoder object from inherited base classes: nn with example: obj = MaskConditionDecoder(in_channels, out_channels, up_block_types, block_out_channels, layers_per_block, norm_num_groups, act_fn, norm_type)