editRawImage method

Future<Map<String, dynamic>> editRawImage({
  1. required File image,
  2. File? mask,
  3. required String prompt,
})

Creates an edited or extended image given an original image and a prompt. Provide a mask is optional An mask is: An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.

Implementation

Future<Map<String, dynamic>> editRawImage({
  required File image,
  File? mask,
  required String prompt,
}) async {
  try {
    _checkApi(values: [prompt]);

    final result = await service.editImage(
        prompt: prompt, image: image, apiKey: _apiKey, config: _configImages);
    return result.toMap();
  } catch (e) {
    throw _exceptionCheck(e);
  }
}