Skip to main content

generateImage()

Create a new text-to-image generation task.
Parameters:
  • text (string): Text prompt (1-8192 characters)
  • callback (string, optional): Webhook URL for completion notification
Returns: Response with job_id and status

varyImage()

Create variations of a generated image.
Parameters:
  • job_id (string): Original image job ID
  • image_no (int): Image index (0-3)
  • type (int): Variation type (0=Subtle, 1=Strong)
  • remix_prompt (string, optional): Additional prompt for variation
  • callback (string, optional): Webhook URL for completion notification

upscaleImage()

Upscale a generated image to higher resolution.
Parameters:
  • job_id (string): Original image job ID
  • image_no (int): Image index (0-3)
  • type (int): Upscale type (0=Subtle, 1=Creative)
  • callback (string, optional): Webhook URL for completion notification

rerollImage()

Regenerate with the same prompt.
Parameters:
  • job_id (string): Original image job ID
  • callback (string, optional): Webhook URL for completion notification

blendImages()

Blend 2-5 images together.
Parameters:
  • img_urls (array): Array of 2-5 image URLs
  • aspect_ratio (string, optional): Output aspect ratio (1:1, 16:9, 9:16, 3:2, 2:3)
  • callback (string, optional): Webhook URL for completion notification

describeImage()

Generate text descriptions from an image.
Parameters:
  • img_url (string): URL of the image to describe
  • callback (string, optional): Webhook URL for completion notification

editImage()

Edit an image with text description.
Parameters:
  • job_id (string): Original image job ID
  • image_no (int): Image index (0-3)
  • canvas (string): Canvas area (full, object, background)
  • img_pos (string): Image position (center, top, bottom, left, right)
  • remix_prompt (string): Edit instructions
  • callback (string, optional): Webhook URL for completion notification

inpaintImage()

Fill masked regions in an image.
Parameters:
  • job_id (string): Original image job ID
  • image_no (int): Image index (0-3)
  • remix_prompt (string): Inpainting prompt
  • mask (array): Mask object with type (‘url’ or ‘coordinates’) and value
  • callback (string, optional): Webhook URL for completion notification

outpaintImage()

Extend image boundaries.
Parameters:
  • job_id (string): Original image job ID
  • image_no (int): Image index (0-3)
  • scale (float): Expansion scale factor (1.1-3.0)
  • remix_prompt (string, optional): Outpaint prompt
  • callback (string, optional): Webhook URL for completion notification

panImage()

Create panoramic or panned views.
Parameters:
  • job_id (string): Original image job ID
  • image_no (int): Image index (0-3)
  • direction (int): Pan direction (0=Down, 1=Right, 2=Up, 3=Left)
  • scale (float): Scale factor (1.1-3.0)
  • remix_prompt (string, optional): Pan prompt
  • callback (string, optional): Webhook URL for completion notification

remixImage()

Create variations using remix modes (strong or subtle modification).
Parameters:
  • job_id (string): Original image job ID
  • image_no (int): Image index (0-3)
  • mode (int): Remix mode (0=Strong, 1=Subtle)
  • remix_prompt (string, optional): Remix instructions
  • callback (string, optional): Webhook URL for completion notification

shortenPrompt()

Optimize and simplify prompts.
Parameters:
  • prompt (string): Long prompt to optimize
  • callback (string, optional): Webhook URL for completion notification
Returns: Response with shortened_prompt

Complete Example


Error Handling


Retry Logic


Next Steps