comfyui

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	KeyType   string `json:"key_type"`
	Filename  string `json:"filename"`
	SubFolder string `json:"subfolder"`
	Type      string `json:"type"`
	Format    string `json:"format"`
}

type ImageResult

type ImageResult struct {
	Images []*Image `json:"images"`
	Text   []string `json:"text"`
	Key    string   `json:"key"`
}

type PromptResponse

type PromptResponse struct {
	NodeErrors interface{} `json:"node_errors"`
	Number     int         `json:"number"`
	PromptID   string      `json:"prompt_id"`
}

type Server

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

func NewServer

func NewServer(host string) *Server

func (Server) Cancel added in v0.0.26

func (s Server) Cancel(promptId ...string) error

func (Server) History

func (s Server) History(promptId string, timeout *time.Duration, keys ...string) ([]*ImageResult, map[string]interface{}, error)

History 查询任务状态 promptId 任务id keys 要取的结果(outputs)的key

func (Server) Prompt

func (s Server) Prompt(clientId string, prompt map[string]interface{}, extraData map[string]interface{}) (*PromptResponse, error)

Prompt 加入队列

func (Server) QueueIsRunning added in v0.0.26

func (s Server) QueueIsRunning(promptId string) (bool, error)

func (Server) UploadImage

func (s Server) UploadImage(payload *bytes.Buffer, writer *multipart.Writer) (*UploadImageResponse, error)

UploadImage 上传图片

type UploadImageResponse

type UploadImageResponse struct {
	Name      string `json:"name"`
	SubFolder string `json:"subfolder"`
	Type      string `json:"type"`
}

Jump to

Keyboard shortcuts

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