generationPixelImage(params: Object)

Requires:
AIKit≥1.8.0@ray-js/ray≥1.7.60
Platforms:
iOSAndroid
import { ai } from '@ray-js/ray';

const { generationPixelImage } = ai;

// Promise usage
try {
  const res = await generationPixelImage({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Generate a pixel image from tags

Parameters

PropertyTypeRequiredDescription
deviceIdstringYesDevice ID
labelstringYesTag
imageWidthnumberYesWidth of the generated image
imageHeightnumberYesHeight of the generated image
outImagePathstringYesImage output directory
complete() => voidNoCompletion callback (executed on both success and failure)
success(params: Object) => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
success callback parameters
PropertyTypeDescription
successbooleanWhether generation succeeded
imagePathstringPath to the generated pixel image
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { ai } from '@ray-js/ray'

ai.generationPixelImage({
  deviceId: "xx",
  label: "xx",
  imageWidth: 1,
  imageHeight: 1,
  outImagePath: "xx",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});