docstr: Initialize the stability wrapper api client.
  
  Args:
      api_key: Stability AI API Key
      dir_to_save: The local directory path to save the response images from the API
      engine (str, optional): Stability AI engine to use. Defaults to "stable-diffusion-xl-1024-v1-0".
      upscale_engine (str, optional): Stability AI upscaling engine to use. Defaults to "esrgan-v1-x2plus".
  
  Raises:
      ValueError: For unknown engine or upscale engine
docstr_tok: ["Initialize","the","stability","wrapper","api","client",".","Args",":","api_key",":","Stability","AI","API","Key","dir_to_save",":","The","local","directory","path","to","save","the","response","images","from","the","API","engine","(","str",",","optional",")",":","Stability","AI","engine","to","use",".","Defaults","to","``","stable-diffusion-xl-1024-v1-0","''",".","upscale_engine","(","str",",","optional",")",":","Stability","AI","upscaling","engine","to","use",".","Defaults","to","``","esrgan-v1-x2plus","''",".","Raises",":","ValueError",":","For","unknown","engine","or","upscale","engine"]
code: def _init_(
      self,
      api_key,
      dir_to_save,
      engine="stable-diffusion-xl-1024-v1-0",
      upscale_engine="esrgan-v1-x2plus",
  ):
      """Initialize the stability wrapper api client.
  
      Args:
          api_key: Stability AI API Key
          dir_to_save: The local directory path to save the response images from the API
          engine (str, optional): Stability AI engine to use. Defaults to "stable-diffusion-xl-1024-v1-0".
          upscale_engine (str, optional): Stability AI upscaling engine to use. Defaults to "esrgan-v1-x2plus".
  
      Raises:
          ValueError: For unknown engine or upscale engine
      """
      self.api_key = api_key
      self.STABILITY_HOST = "grpc.stability.ai:443"
      self.save_dir = (
          dir_to_save + "/"
          if not dir_to_save.endswith("/")
          else dir_to_save
      )
      self.available_engines = self.get_existing_engines()
      if not self._is_valid_engine(engine):
          raise ValueError(
              "Unknown engine. The available engines are - "
              + self.available_engines
          )
      if not self._is_valid_engine(upscale_engine):
          raise ValueError(
              "Unknown upscale engine. The available engines are - "
              + self.available_engines
          )
  
      self.stability_api = client.StabilityInference(
          host=self.STABILITY_HOST,
          key=self.api_key,
          engine=engine,
          upscale_engine=upscale_engine,
          verbose=True,
      )
  
file_path: mindsdb/mindsdb/integrations/handlers/stabilityai_handler/stabilityai.py
imports: from stability_sdk import client
  from stability_sdk.client import generation
  from PIL import Image
  import io
  import requests
label_desc: Use image node_id 1 for calling the StabilityAPIClient obj's underlying member method code with example usage: obj._init_(api_key, dir_to_save, engine, upscale_engine) without return types