View source: R/create_image_edit.R
create_image_edit | R Documentation |
Creates an edited or extended image given an original image and a prompt. See this page for details.
create_image_edit(
image,
mask,
prompt,
n = 1,
size = c("1024x1024", "256x256", "512x512"),
response_format = c("url", "b64_json"),
user = NULL,
openai_api_key = Sys.getenv("OPENAI_API_KEY"),
openai_organization = NULL
)
image |
required; a length one character vector. |
mask |
required; a length one character vector. |
prompt |
required; a length one character vector. |
n |
required; defaults to |
size |
required; defaults to |
response_format |
required; defaults to |
user |
optional; defaults to |
openai_api_key |
required; defaults to |
openai_organization |
optional; defaults to |
For arguments description please refer to the official documentation.
Returns a list, an element of which contain either a link to the edited image or the edited image decoded in Base64.
Other image functions:
create_image_variation()
,
create_image()
## Not run:
image <- system.file("extdata", "astronaut.png", package = "openai")
mask <- system.file("extdata", "mask.png", package = "openai")
create_image_edit(
image = image,
mask = mask,
prompt = "goat",
n = 1,
response_format = "url"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.