stabilityai

package module
v0.0.0-...-a973d05 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 8 Imported by: 0

README

stabilityai-go

CI

Stability AI API client for Go.

Please note, it may not be fully functional or up-to-date. If you have any issues, please open an issue or submit a pull request.

Requirements

  • Go 1.22 or later

Installation

go get -u github.com/alexprogrammr/stabilityai-go

Resources

License

Licensed under The MIT License, see LICENSE.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AspectRatio

type AspectRatio string
const (
	AspectRatio1x1  AspectRatio = "1:1"
	AspectRatio3x2  AspectRatio = "3:2"
	AspectRatio2x3  AspectRatio = "2:3"
	AspectRatio5x4  AspectRatio = "5:4"
	AspectRatio4x5  AspectRatio = "4:5"
	AspectRatio16x9 AspectRatio = "16:9"
	AspectRatio9x16 AspectRatio = "9:16"
	AspectRatio21x9 AspectRatio = "21:9"
	AspectRatio9x21 AspectRatio = "9:21"
)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient HTTPClient, apiKey string) *Client

func (*Client) GenerateCore

func (c *Client) GenerateCore(ctx context.Context, req GenerateRequest, out io.Writer) error

func (*Client) GenerateDiffusion

func (c *Client) GenerateDiffusion(ctx context.Context, req GenerateRequest, out io.Writer) error

func (*Client) GenerateUltra

func (c *Client) GenerateUltra(ctx context.Context, req GenerateRequest, out io.Writer) error

func (*Client) GenerateVideo

func (c *Client) GenerateVideo(ctx context.Context, req GenerateVideoRequest, out io.Writer) error

func (*Client) UpscaleConservative

func (c *Client) UpscaleConservative(ctx context.Context, req UpscaleConservativeRequest, out io.Writer) error

type GenerateRequest

type GenerateRequest struct {
	Prompt      string
	AspectRatio AspectRatio
	Style       Style // Used only in GenerateCore
	Output      Output
}

type GenerateVideoRequest

type GenerateVideoRequest struct {
	Image          io.Reader
	CfgScale       int // [ 0 .. 10 ]
	MotionBucketId int // [ 1 .. 255 ]
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type Output

type Output string
const (
	OutputPNG  Output = "png"
	OutputJPEG Output = "jpeg"
	OutputWEBP Output = "webp"
)

type Style

type Style string
const (
	Style3dModel      Style = "3d-model"
	StyleAnalogFilm   Style = "analog-film"
	StyleAnime        Style = "anime"
	StyleCinematic    Style = "cinematic"
	StyleComicBook    Style = "comic-book"
	StyleDigitalArt   Style = "digital-art"
	StyleEnhance      Style = "enhance"
	StyleFantasyArt   Style = "fantasy-art"
	StyleIsometric    Style = "isometric"
	StyleLineArt      Style = "line-art"
	StyleLowPoly      Style = "low-poly"
	StyleModeling     Style = "modeling-compound"
	StyleNeonPunk     Style = "neon-punk"
	StyleOrigami      Style = "origami"
	StylePhotographic Style = "photographic"
	StylePixelArt     Style = "pixel-art"
	StyleTileTexture  Style = "tile-texture"
)

type UpscaleConservativeRequest

type UpscaleConservativeRequest struct {
	Image          io.Reader
	Prompt         string
	NegativePrompt string
	Seed           int
	Output         Output
	Creativity     float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL