code: def create_perlin_noise(
      octaves, width, height, grayscale, side_y, side_x
  ):
      out = perlin_ms(octaves, width, height, grayscale)
      if grayscale:
          out = TF.resize(size=(side_y, side_x), img=out.numpy())
          out = np.uint8(out)
          out = Image.fromarray(out).convert("RGB")
      else:
          out = out.reshape([-1, 3, out.shape[0] // 3, out.shape[1]])
          out = out.squeeze().transpose([1, 2, 0]).numpy()
          out = TF.resize(size=(side_y, side_x), img=out)
          out = out.clip(0, 1) * 255
          out = np.uint8(out)
          out = Image.fromarray(out)
  
      out = ImageOps.autocontrast(out)
      return out
  
file_path: PaddleHub/modules/image/text_to_image/disco_diffusion_clip_rn50/reverse_diffusion/model/perlin_noises.py
imports: import numpy
  import paddle
  import paddle.vision.transforms
  from PIL import Image
  from PIL import ImageOps
label_desc: Use image node_id 4 for calling a global function with example usage: create_perlin_noise(octaves, width, height, grayscale, side_y, side_x) and returns: out