scale

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

README

scale

采用叔叔的模型放大二次元图片

输入 输出

API

注意:由于云函数内存较小,请将图片分辨率控制在0.25MP,即500*500之内

func Get(u string, model, scale, tile int) ([]byte, error)
func Post(body io.Reader, model, scale, tile int) ([]byte, error)

返回:webp格式的输出图片

Documentation

Index

Constants

View Source
const (
	ModelConservative = "conservative"
	ModelNoDenoise    = "no-denoise"
	ModelDenoise1x    = "denoise1x"
	ModelDenoise2x    = "denoise2x"
	ModelDenoise3x    = "denoise3x"
)

Variables

View Source
var (
	Models      = [...]string{ModelConservative, ModelNoDenoise, ModelDenoise1x, ModelDenoise2x, ModelDenoise3x}
	ErrInvModel = errors.New("invaild model")
	ErrInvScale = errors.New("invaild scale")
	ErrInvTile  = errors.New("invaild tile")
)

Functions

func Get

func Get(u string, model, scale, tile int) ([]byte, error)

Get model 0-4, scale 2-4, tile 0-4

func Post

func Post(body io.Reader, model, scale, tile int) ([]byte, error)

Post model 0-4, scale 2-4, tile 0-4

Types

This section is empty.

Jump to

Keyboard shortcuts

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