Package 'stabilityAI'

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]
Maintainer: David Schoch <[email protected]>
License: MIT + file LICENSE
Version: 0.0.1.9000
Built: 2024-11-21 03:19:29 UTC
Source: https://github.com/schochastics/stabilityAI

Help Index


Image data uri to file

Description

Convert a data uri to an image in the correct format and save it to a file.

Usage

base64_to_img(img64, slug)

Arguments

img64

charachter, base64 image string as returned by generate_txt2img

slug

character, name of file to export image to. WITHOUT extension

Value

nothing, called for side effects


Text to Image Create an image from a text prompt

Description

Text to Image Create an image from a text prompt

Usage

generate_txt2img(
  text_prompts = "",
  engine_id = "stable-diffusion-xl-1024-v0-9",
  Accept = "application/json",
  token = NULL,
  ...
)

Arguments

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

Details

for a detailed list of supported parameters see https://platform.stability.ai/docs/api-reference#tag/v1generation/operation/textToImage

Value

png image as base64. can be saved with base64_to_img

Examples

## Not run: 
generate_txt2img(text_prompts = "A lighthouse on a cliff")

## End(Not run)

Account balance get balance from your stability.ai account

Description

Account balance get balance from your stability.ai account

Usage

get_account_balance(token = NULL)

Arguments

token

either the stability.ai API key or NULL to read it from .Renviron

Value

account balance

Examples

## Not run: 
get_account_balance()

## End(Not run)

Account details get details about your stability.ai account

Description

Account details get details about your stability.ai account

Usage

get_account_details(token = NULL)

Arguments

token

either the stability.ai API key or NULL to read it from .Renviron

Value

data frame with account details

Examples

## Not run: 
get_account_details()

## End(Not run)

Engines list get a list of engines to use

Description

Engines list get a list of engines to use

Usage

get_engines_list(token = NULL)

Arguments

token

either the stability.ai API key or NULL to read it from .Renviron

Value

data.frame containing engines

Examples

## Not run: 
get_eninges_list()

## End(Not run)