mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-22 05:57:50 +00:00
36 lines
610 B
Go
36 lines
610 B
Go
//go:build stablediffusion
|
|
// +build stablediffusion
|
|
|
|
package stablediffusion
|
|
|
|
import (
|
|
stableDiffusion "github.com/mudler/go-stable-diffusion"
|
|
)
|
|
|
|
func GenerateImage(height, width, mode, step, seed int, positive_prompt, negative_prompt, dst, asset_dir string) error {
|
|
if height > 512 || width > 512 {
|
|
return stableDiffusion.GenerateImageUpscaled(
|
|
height,
|
|
width,
|
|
step,
|
|
seed,
|
|
positive_prompt,
|
|
negative_prompt,
|
|
dst,
|
|
asset_dir,
|
|
)
|
|
}
|
|
return stableDiffusion.GenerateImage(
|
|
height,
|
|
width,
|
|
mode,
|
|
step,
|
|
seed,
|
|
positive_prompt,
|
|
negative_prompt,
|
|
dst,
|
|
"",
|
|
asset_dir,
|
|
)
|
|
}
|