code: def coords_grid(batch, ht, wd, device):
      # Adapted from https://github.com/princeton-vl/RAFT/blob/master/core/utils/utils.py
      coords = torch.meshgrid(
          torch.arange(ht, device=device),
          torch.arange(wd, device=device),
      )
      coords = torch.stack(coords[::-1], dim=0).float()
      return coords[None].repeat(batch, 1, 1, 1)
  
imports: import copy
  import inspect
  from dataclasses import dataclass
  from typing import Callable, List, Optional, Union
  import numpy
  import PIL.Image
  import torch
  import torch.nn.functional
  from torch.nn.functional import grid_sample
  from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
  from ...image_processor import VaeImageProcessor
  from ...loaders import LoraLoaderMixin, TextualInversionLoaderMixin
  from ...models import AutoencoderKL, UNet2DConditionModel
  from ...models.lora import adjust_lora_scale_text_encoder
  from ...schedulers import KarrasDiffusionSchedulers
  from ...utils import USE_PEFT_BACKEND, BaseOutput, logging, scale_lora_layers, unscale_lora_layers
  from ...utils.torch_utils import randn_tensor
  from ..pipeline_utils import DiffusionPipeline
  from ..stable_diffusion import StableDiffusionSafetyChecker
label_desc: Use image node_id 5 for calling a global function with example usage: coords_grid(batch, ht, wd, device) and returns: coords