mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-30 09:28:51 +00:00
21 lines
507 B
Go
21 lines
507 B
Go
|
package stablediffusion
|
||
|
|
||
|
import "os"
|
||
|
|
||
|
type StableDiffusion struct {
|
||
|
assetDir string
|
||
|
}
|
||
|
|
||
|
func New(assetDir string) (*StableDiffusion, error) {
|
||
|
if _, err := os.Stat(assetDir); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return &StableDiffusion{
|
||
|
assetDir: assetDir,
|
||
|
}, nil
|
||
|
}
|
||
|
|
||
|
func (s *StableDiffusion) GenerateImage(height, width, mode, step, seed int, positive_prompt, negative_prompt, dst string) error {
|
||
|
return GenerateImage(height, width, mode, step, seed, positive_prompt, negative_prompt, dst, s.assetDir)
|
||
|
}
|