LocalAI/pkg/tinydream/tinydream.go
Gianluca Boiano cae7b197ec
feat: add tiny dream stable diffusion support (#1283)
Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
2023-12-24 19:27:24 +00:00

21 lines
467 B
Go

package tinydream
import "os"
type TinyDream struct {
assetDir string
}
func New(assetDir string) (*TinyDream, error) {
if _, err := os.Stat(assetDir); err != nil {
return nil, err
}
return &TinyDream{
assetDir: assetDir,
}, nil
}
func (td *TinyDream) GenerateImage(height, width, step, seed int, positive_prompt, negative_prompt, dst string) error {
return GenerateImage(height, width, step, seed, positive_prompt, negative_prompt, dst, td.assetDir)
}