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
  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 diffusers.models import AutoencoderKL, UNet2DConditionModel
  from diffusers.pipelines.stable_diffusion import StableDiffusionPipeline, StableDiffusionSafetyChecker
  from diffusers.schedulers import KarrasDiffusionSchedulers
  from diffusers.utils import BaseOutput
label_desc: Use image node_id 5 for calling a global function with example usage: coords_grid(batch, ht, wd, device) and returns: coords