Documentation ¶
Index ¶
- Constants
- Variables
- type ErrEmptyResponse
- type ErrFetchingReturnHeader
- type ErrInvalidAspectRatio
- type ErrInvalidModel
- type ErrInvalidOutputFormat
- type ErrInvalidSeed
- type ErrJsonResponseNotSupported
- type ErrMissingLogger
- type ErrMissingPrompt
- type ErrMissingStability
- type Option
- func WithAspectRatio(aspectRatio string) Option
- func WithLogger(log *slog.Logger) Option
- func WithModel(model string) Option
- func WithNegativePrompt(negativePrompt string) Option
- func WithOutputFormat(outputFormat string) Option
- func WithPrompt(prompt string) Option
- func WithSeed(seed int) Option
- func WithStability(stability *stability.Stability) Option
- type Request
- type Response
- type ResponseErrors
- type ResponseMetadata
- type StabilityV3
- func (c *StabilityV3) Generate() (*Response, error)
- func (c *StabilityV3) SetAspectRatio(aspectRatio string)
- func (c *StabilityV3) SetModel(model string)
- func (c *StabilityV3) SetNegativePrompt(negativePrompt string)
- func (c *StabilityV3) SetPrompt(prompt string)
- func (c *StabilityV3) SetSeed(seed int)
Constants ¶
View Source
const MAX_PROMPT_LENGTH = 10000
MAX_PROMPT_LENGTH is the maximum length of a prompt
View Source
const MAX_SEED = 4294967294
MAX_SEED is the maximum seed value
View Source
const MODULE_NAME = "stabilityV3"
Variables ¶
View Source
var ASPECT_RATIOS = []string{"16:9", "1:1", "21:9", "2:3", "3:2", "4:5", "5:4", "9:16", "9:21"}
ASPECT_RATIOS is a list of valid aspect ratios
View Source
var ENDPOINT = stability.ENDPOINT_ROOT + "/v2beta/stable-image/generate/sd3"
ENDPOINT is the endpoint for V3 requests
View Source
var MODELS = []string{"sd3", "sd3-turbo"}
MODELS is a list of valid models for V3 endpoints
View Source
var OUTPUT_FORMATS = []string{"jpeg", "png"}
OUTPUT_FORMATS is a list of valid output formats for V3 endpoints
Functions ¶
This section is empty.
Types ¶
type ErrEmptyResponse ¶
func (*ErrEmptyResponse) Error ¶
func (e *ErrEmptyResponse) Error() string
type ErrFetchingReturnHeader ¶
func (*ErrFetchingReturnHeader) Error ¶
func (e *ErrFetchingReturnHeader) Error() string
type ErrInvalidAspectRatio ¶
func (*ErrInvalidAspectRatio) Error ¶
func (e *ErrInvalidAspectRatio) Error() string
type ErrInvalidModel ¶
func (*ErrInvalidModel) Error ¶
func (e *ErrInvalidModel) Error() string
type ErrInvalidOutputFormat ¶
func (*ErrInvalidOutputFormat) Error ¶
func (e *ErrInvalidOutputFormat) Error() string
type ErrInvalidSeed ¶
func (*ErrInvalidSeed) Error ¶
func (e *ErrInvalidSeed) Error() string
type ErrJsonResponseNotSupported ¶
func (*ErrJsonResponseNotSupported) Error ¶
func (e *ErrJsonResponseNotSupported) Error() string
type ErrMissingLogger ¶
func (*ErrMissingLogger) Error ¶
func (e *ErrMissingLogger) Error() string
type ErrMissingPrompt ¶
func (*ErrMissingPrompt) Error ¶
func (e *ErrMissingPrompt) Error() string
type ErrMissingStability ¶
func (*ErrMissingStability) Error ¶
func (e *ErrMissingStability) Error() string
type Option ¶
type Option func(config *StabilityV3)
func WithAspectRatio ¶
func WithLogger ¶
func WithNegativePrompt ¶
func WithOutputFormat ¶
func WithPrompt ¶
func WithStability ¶
type Response ¶
type Response struct { Metadata *ResponseMetadata `json:"data,omitempty"` Errors *ResponseErrors `json:"errors,omitempty"` Image *[]byte `json:"image,omitempty"` }
type ResponseErrors ¶
type ResponseMetadata ¶
type StabilityV3 ¶
type StabilityV3 struct {
// contains filtered or unexported fields
}
Configuration structure.
func New ¶
func New(opts ...func(*StabilityV3)) (*StabilityV3, error)
func (*StabilityV3) Generate ¶
func (c *StabilityV3) Generate() (*Response, error)
func (*StabilityV3) SetAspectRatio ¶
func (c *StabilityV3) SetAspectRatio(aspectRatio string)
func (*StabilityV3) SetModel ¶
func (c *StabilityV3) SetModel(model string)
func (*StabilityV3) SetNegativePrompt ¶
func (c *StabilityV3) SetNegativePrompt(negativePrompt string)
func (*StabilityV3) SetPrompt ¶
func (c *StabilityV3) SetPrompt(prompt string)
func (*StabilityV3) SetSeed ¶
func (c *StabilityV3) SetSeed(seed int)
Click to show internal directories.
Click to hide internal directories.