liblib

package module
v0.0.0-...-6517c93 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 13 Imported by: 0

README

liblib

LiblibAI-哩布哩布AI的API接口 https://www.liblib.art/

功能

  • Text2Img
  • Img2Img
  • Text2ImgUltra
  • Img2ImgUltra
  • Text2ImgClassic
  • Img2ImgClassic
  • Status

示例

建立任务
api := liblib.NewAPI("AccessKey", "SecretKey")
req := []byte(`{
    "templateUuid": "6f7c4652458d4802969f8d089cf5b91f",
    "generateParams": {
        "prompt": "filmfotos, Asian portrait,A young woman wearing a green baseball cap,covering one eye with her hand",
        "steps": 20,
        "width": 768,
        "height": 1024,
        "imgCount": 1, 
        "seed": -1,
        "restoreFaces": 0,
        "additionalNetwork": [
            {
                "modelId": "169505112cee468b95d5e4a5db0e5669",
                "weight": 1.0
            }
        ]
    }
}`)
resp, err := api.Generate(liblib.Text2Img, req)
fmt.Println(resp, err)
// resp.Data.GenerateUuid
查询任务结果
api := liblib.NewAPI("AccessKey", "SecretKey")
req := &schema.StatusReq{GenerateUuid: "GenerateUuid"}
resp, err := api.Status(req)
// resp.Data.GenerateStatus

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(ak, sk string) *API

func (*API) Generate

func (a *API) Generate(endpoint string, req []byte) (resp *schema.GenerateResp, err error)

func (*API) Img2Img

func (a *API) Img2Img(req *schema.Img2ImgReq) (result *schema.GenerateResp, err error)

func (*API) Img2ImgClassic

func (a *API) Img2ImgClassic(req *schema.Img2ImgClassicReq) (result *schema.GenerateResp, err error)

func (*API) Img2ImgUltra

func (a *API) Img2ImgUltra(req *schema.Img2ImgUltraReq) (result *schema.GenerateResp, err error)

func (*API) Status

func (a *API) Status(req *schema.StatusReq) (result *schema.StatusResp, err error)

func (*API) Text2Img

func (a *API) Text2Img(req *schema.Text2ImgReq) (result *schema.GenerateResp, err error)

func (*API) Text2ImgClassic

func (a *API) Text2ImgClassic(req *schema.Text2ImgClassicReq) (result *schema.GenerateResp, err error)

func (*API) Text2ImgUltra

func (a *API) Text2ImgUltra(req *schema.Text2ImgUltraReq) (result *schema.GenerateResp, err error)

Directories

Path Synopsis
example
status command
text2img command

Jump to

Keyboard shortcuts

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