Documentation ¶
Index ¶
- Constants
- Variables
- type CLogCallback
- type CStableDiffusion
- type CStableDiffusionCtx
- type CStableDiffusionImpl
- func (c *CStableDiffusionImpl) Close() error
- func (c *CStableDiffusionImpl) FreeCtx(ctx *CStableDiffusionCtx)
- func (c *CStableDiffusionImpl) FreeUpscalerCtx(ctx *CUpScalerCtx)
- func (c *CStableDiffusionImpl) GetSystemInfo() string
- func (c *CStableDiffusionImpl) ImagePredictImage(ctx *CStableDiffusionCtx, img Image, prompt string, negativePrompt string, ...) []Image
- func (c *CStableDiffusionImpl) NewCtx(modelPath string, vaePath string, taesdPath string, loraModelDir string, ...) *CStableDiffusionCtx
- func (c *CStableDiffusionImpl) NewUpscalerCtx(esrganPath string, nThreads int, wType WType) *CUpScalerCtx
- func (c *CStableDiffusionImpl) PredictImage(ctx *CStableDiffusionCtx, prompt string, negativePrompt string, clipSkip int, ...) []Image
- func (c *CStableDiffusionImpl) SetLogCallBack(cb CLogCallback)
- func (c *CStableDiffusionImpl) UpscaleImage(ctx *CUpScalerCtx, img Image, upscaleFactor uint32) Image
- type CUpScalerCtx
- type FullParams
- type Image
- type LogLevel
- type Model
- func (sd *Model) Close() error
- func (sd *Model) ImagePredict(reader io.Reader, prompt string, params FullParams, writer []io.Writer) error
- func (sd *Model) LoadFromFile(path string) error
- func (sd *Model) Predict(prompt string, params FullParams, writer []io.Writer) error
- func (sd *Model) SetLogCallback(cb CLogCallback)
- func (sd *Model) SetOptions(options Options)
- func (sd *Model) UpscaleImage(reader io.Reader, esrganPath string, upscaleFactor uint32, writer io.Writer) error
- type Options
- type OutputsImageType
- type RNGType
- type SampleMethod
- type Schedule
- type WType
Constants ¶
View Source
const ( F32 WType = 0 F16 = 1 Q4_0 = 2 Q4_1 = 3 Q5_0 = 6 Q5_1 = 7 Q8_0 = 8 Q8_1 = 9 Q2_K = 10 Q3_K = 11 Q4_K = 12 Q5_K = 13 Q6_K = 14 Q8_K = 15 I8 = 16 I16 = 17 I32 = 18 COUNT = 19 // don't use this when specifying a type )
Variables ¶
View Source
var DefaultFullParams = FullParams{ NegativePrompt: "out of frame, lowers, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature", CfgScale: 7.0, Width: 512, Height: 512, SampleMethod: EULER_A, SampleSteps: 20, Strength: 0.4, Seed: 42, BatchCount: 1, OutputsImageType: PNG, }
Functions ¶
This section is empty.
Types ¶
type CLogCallback ¶ added in v0.1.0
type CStableDiffusion ¶
type CStableDiffusion interface { NewCtx(modelPath string, vaePath string, taesdPath string, loraModelDir string, vaeDecodeOnly bool, vaeTiling bool, freeParamsImmediately bool, nThreads int, wType WType, rngType RNGType, schedule Schedule) *CStableDiffusionCtx PredictImage(ctx *CStableDiffusionCtx, prompt string, negativePrompt string, clipSkip int, cfgScale float32, width int, height int, sampleMethod SampleMethod, sampleSteps int, seed int64, batchCount int) []Image ImagePredictImage(ctx *CStableDiffusionCtx, img Image, prompt string, negativePrompt string, clipSkip int, cfgScale float32, width int, height int, sampleMethod SampleMethod, sampleSteps int, strength float32, seed int64, batchCount int) []Image SetLogCallBack(cb CLogCallback) GetSystemInfo() string FreeCtx(ctx *CStableDiffusionCtx) NewUpscalerCtx(esrganPath string, nThreads int, wType WType) *CUpScalerCtx FreeUpscalerCtx(ctx *CUpScalerCtx) UpscaleImage(ctx *CUpScalerCtx, img Image, upscaleFactor uint32) Image Close() error }
type CStableDiffusionCtx ¶ added in v0.1.0
type CStableDiffusionCtx struct {
// contains filtered or unexported fields
}
type CStableDiffusionImpl ¶
type CStableDiffusionImpl struct {
// contains filtered or unexported fields
}
func NewCStableDiffusion ¶
func NewCStableDiffusion(libraryPath string) (*CStableDiffusionImpl, error)
func (*CStableDiffusionImpl) Close ¶ added in v0.1.0
func (c *CStableDiffusionImpl) Close() error
func (*CStableDiffusionImpl) FreeCtx ¶ added in v0.1.0
func (c *CStableDiffusionImpl) FreeCtx(ctx *CStableDiffusionCtx)
func (*CStableDiffusionImpl) FreeUpscalerCtx ¶ added in v0.1.0
func (c *CStableDiffusionImpl) FreeUpscalerCtx(ctx *CUpScalerCtx)
func (*CStableDiffusionImpl) GetSystemInfo ¶ added in v0.1.0
func (c *CStableDiffusionImpl) GetSystemInfo() string
func (*CStableDiffusionImpl) ImagePredictImage ¶ added in v0.1.0
func (c *CStableDiffusionImpl) ImagePredictImage(ctx *CStableDiffusionCtx, img Image, prompt string, negativePrompt string, clipSkip int, cfgScale float32, width int, height int, sampleMethod SampleMethod, sampleSteps int, strength float32, seed int64, batchCount int) []Image
func (*CStableDiffusionImpl) NewUpscalerCtx ¶ added in v0.1.0
func (c *CStableDiffusionImpl) NewUpscalerCtx(esrganPath string, nThreads int, wType WType) *CUpScalerCtx
func (*CStableDiffusionImpl) PredictImage ¶ added in v0.1.0
func (c *CStableDiffusionImpl) PredictImage(ctx *CStableDiffusionCtx, prompt string, negativePrompt string, clipSkip int, cfgScale float32, width int, height int, sampleMethod SampleMethod, sampleSteps int, seed int64, batchCount int) []Image
func (*CStableDiffusionImpl) SetLogCallBack ¶ added in v0.1.0
func (c *CStableDiffusionImpl) SetLogCallBack(cb CLogCallback)
func (*CStableDiffusionImpl) UpscaleImage ¶ added in v0.1.0
func (c *CStableDiffusionImpl) UpscaleImage(ctx *CUpScalerCtx, img Image, upscaleFactor uint32) Image
type CUpScalerCtx ¶ added in v0.1.0
type CUpScalerCtx struct {
// contains filtered or unexported fields
}
type FullParams ¶ added in v0.1.0
type Model ¶ added in v0.1.0
type Model struct {
// contains filtered or unexported fields
}
func NewAutoModel ¶ added in v0.1.0
func (*Model) ImagePredict ¶ added in v0.1.0
func (*Model) LoadFromFile ¶ added in v0.1.0
func (*Model) SetLogCallback ¶ added in v0.1.0
func (sd *Model) SetLogCallback(cb CLogCallback)
func (*Model) SetOptions ¶ added in v0.1.0
type OutputsImageType ¶
type OutputsImageType string
const ( PNG OutputsImageType = "PNG" JPEG = "JPEG" )
type SampleMethod ¶
type SampleMethod int
const ( EULER_A SampleMethod = iota EULER HEUN DPM2 DPMPP2S_A DPMPP2M DPMPP2Mv2 LCM N_SAMPLE_METHODS )
Click to show internal directories.
Click to hide internal directories.