Documentation ¶
Index ¶
- Variables
- type Client
- func (cli *Client) Download(ctx context.Context, transID string) (io.ReadCloser, error)
- func (cli *Client) GetPoint(ctx context.Context) (Response, error)
- func (cli *Client) GetProgress(ctx context.Context, transID string) (Response, error)
- func (cli *Client) ProcessImage(ctx context.Context, uid string, jobConfig job) (Response, error)
- func (cli *Client) UploadImage(ctx context.Context, reader io.Reader, name string) (Response, error)
- type Compress
- type Config
- type Data
- type JobConfig
- type ModuleParams
- type MultipleJob
- type OutParams
- type ProcessRequest
- type ProgressRequest
- type Response
- type SingleConfig
- type Status
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorIllegalParameter = errors.New("illegal parameter") VanceAIInternalError = errors.New("vanceai internal error") FileNotFound = errors.New("file not found") SizeExceedsLimit = errors.New("size exceeds limit") JParamParseError = errors.New("jparam parse error") JobFailed = errors.New("job failed") InvalidAPIKey = errors.New("invalid api key") InsufficientBalance = errors.New("insufficient balance") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { APIKey string BaseURL *url.URL ProcessWebhook string // contains filtered or unexported fields }
func (*Client) GetProgress ¶
func (*Client) ProcessImage ¶
type Config ¶
type Config struct { Module string `json:"module"` ModuleParams ModuleParams `json:"module_params"` OutParams OutParams `json:"out_params"` }
type Data ¶
type Data struct { UID string `json:"uid"` Name string `json:"name"` Thumbnail string `json:"thumbnail"` W int64 `json:"w"` H int64 `json:"h"` FileSize int64 `json:"filesize"` TransID string `json:"trans_id"` Status Status `json:"status"` MaxNum string `json:"max_num"` UsedNum string `json:"used_num"` }
type JobConfig ¶
type JobConfig struct { // https://docs.vanceai.com/?shell#description-of-config-file Job string `json:"job"` Config Config `json:"config"` }
type ModuleParams ¶
type ModuleParams struct { ModelName string `json:"model_name"` SuppressNoise int64 `json:"suppress_noise"` RemoveBlur int64 `json:"remove_blur"` Scale string `json:"scale"` Rescale int64 `json:"rescale"` SingleFace bool `json:"single_face"` Composite bool `json:"composite"` Sigma int64 `json:"sigma"` Alpha int64 `json:"alpha"` AutoMode bool `json:"auto_mode"` WebAutoMode bool `json:"web_auto_mode"` }
type MultipleJob ¶
type MultipleJob struct { Job string `json:"job"` Config []SingleConfig `json:"config"` }
type ProcessRequest ¶
type ProgressRequest ¶
type Response ¶
type SingleConfig ¶
Click to show internal directories.
Click to hide internal directories.