code: def generate(self, prompt: str, img_size: int = 512):
      assert len(prompt), "prompt parameter cannot be empty"
  
      with torch.autocast("cuda"):
          image = self.pipe(
              prompt, height=img_size, width=img_size
          ).images[0]
          return image
  
file_path: ray/doc/source/serve/doc_code/stable_diffusion.py
imports: from io import BytesIO
  from fastapi import FastAPI
  from fastapi.responses import Response
  import torch
  from ray import serve
  from ray.serve.handle import DeploymentHandle
label_desc: Use image node_id 2 for calling the StableDiffusionV2 obj's underlying member method code with example usage: obj.generate(prompt, img_size) and returns: image