| Title: | Interact with the API of 'stability.ai' |
|---|---|
| Description: | An implementation of calls to interact with the API of 'stability.ai'. The API is documented at <https://platform.stability.ai/docs/api-reference>. |
| Authors: | David Schoch [aut, cre] (ORCID: <https://orcid.org/0000-0003-2952-4812>) |
| Maintainer: | David Schoch <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.1.9000 |
| Built: | 2026-05-19 10:04:52 UTC |
| Source: | https://github.com/schochastics/stabilityAI |
Convert a data uri to an image in the correct format and save it to a file.
base64_to_img(img64, slug)base64_to_img(img64, slug)
img64 |
charachter, base64 image string as returned by generate_txt2img |
slug |
character, name of file to export image to. WITHOUT extension |
nothing, called for side effects
Text to Image Create an image from a text prompt
generate_txt2img( text_prompts = "", engine_id = "stable-diffusion-xl-1024-v0-9", Accept = "application/json", token = NULL, ... )generate_txt2img( text_prompts = "", engine_id = "stable-diffusion-xl-1024-v0-9", Accept = "application/json", token = NULL, ... )
text_prompts |
string. |
engine_id |
string. |
Accept |
string. One of "application/json" "image/png". |
token |
either the stability.ai API key or NULL to read it from .Renviron |
... |
further parameters to pass to the API |
for a detailed list of supported parameters see https://platform.stability.ai/docs/api-reference#tag/v1generation/operation/textToImage
png image as base64. can be saved with base64_to_img
## Not run: generate_txt2img(text_prompts = "A lighthouse on a cliff") ## End(Not run)## Not run: generate_txt2img(text_prompts = "A lighthouse on a cliff") ## End(Not run)
Account balance get balance from your stability.ai account
get_account_balance(token = NULL)get_account_balance(token = NULL)
token |
either the stability.ai API key or NULL to read it from .Renviron |
account balance
## Not run: get_account_balance() ## End(Not run)## Not run: get_account_balance() ## End(Not run)
Account details get details about your stability.ai account
get_account_details(token = NULL)get_account_details(token = NULL)
token |
either the stability.ai API key or NULL to read it from .Renviron |
data frame with account details
## Not run: get_account_details() ## End(Not run)## Not run: get_account_details() ## End(Not run)
Engines list get a list of engines to use
get_engines_list(token = NULL)get_engines_list(token = NULL)
token |
either the stability.ai API key or NULL to read it from .Renviron |
data.frame containing engines
## Not run: get_eninges_list() ## End(Not run)## Not run: get_eninges_list() ## End(Not run)