code: def __init__(
      self, positive_len, out_dim, feature_type, fourier_freqs=8
  ):
      super().__init__()
      self.positive_len = positive_len
      self.out_dim = out_dim
  
      self.fourier_embedder = FourierEmbedder(num_freqs=fourier_freqs)
      self.position_dim = fourier_freqs * 2 * 4  # 2: sin/cos, 4: xyxy
  
      if isinstance(out_dim, tuple):
          out_dim = out_dim[0]
  
      if feature_type == "text-only":
          self.linears = nn.Sequential(
              nn.Linear(self.positive_len + self.position_dim, 512),
              nn.SiLU(),
              nn.Linear(512, 512),
              nn.SiLU(),
              nn.Linear(512, out_dim),
          )
          self.null_positive_feature = torch.nn.Parameter(
              torch.zeros([self.positive_len])
          )
  
      elif feature_type == "text-image":
          self.linears_text = nn.Sequential(
              nn.Linear(self.positive_len + self.position_dim, 512),
              nn.SiLU(),
              nn.Linear(512, 512),
              nn.SiLU(),
              nn.Linear(512, out_dim),
          )
          self.linears_image = nn.Sequential(
              nn.Linear(self.positive_len + self.position_dim, 512),
              nn.SiLU(),
              nn.Linear(512, 512),
              nn.SiLU(),
              nn.Linear(512, out_dim),
          )
          self.null_text_feature = torch.nn.Parameter(
              torch.zeros([self.positive_len])
          )
          self.null_image_feature = torch.nn.Parameter(
              torch.zeros([self.positive_len])
          )
  
      self.null_position_feature = torch.nn.Parameter(
          torch.zeros([self.position_dim])
      )
  
imports: from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from ...configuration_utils import ConfigMixin, register_to_config
  from ...models import ModelMixin
  from ...models.activations import get_activation
  from ...models.attention import Attention
  from ...models.attention_processor import ADDED_KV_ATTENTION_PROCESSORS, CROSS_ATTENTION_PROCESSORS, AttentionProcessor, AttnAddedKVProcessor, AttnAddedKVProcessor2_0, AttnProcessor
  from ...models.dual_transformer_2d import DualTransformer2DModel
  from ...models.embeddings import GaussianFourierProjection, ImageHintTimeEmbedding, ImageProjection, ImageTimeEmbedding, TextImageProjection, TextImageTimeEmbedding, TextTimeEmbedding, TimestepEmbedding, Timesteps
  from ...models.transformer_2d import Transformer2DModel
  from ...models.unet_2d_condition import UNet2DConditionOutput
  from ...utils import USE_PEFT_BACKEND, is_torch_version, logging, scale_lora_layers, unscale_lora_layers
  from ...utils.torch_utils import apply_freeu
label_desc: Use image node_id 1 to create a new PositionNet object from inherited base classes: nn with example: obj = PositionNet(positive_len, out_dim, feature_type, fourier_freqs)